Class SurfaceObjectTileBuilder.SurfaceObjectTileStateKey

  • All Implemented Interfaces:
    Cacheable
    Enclosing class:
    SurfaceObjectTileBuilder

    protected static class SurfaceObjectTileBuilder.SurfaceObjectTileStateKey
    extends java.lang.Object
    implements Cacheable
    Represents a surface renderable tile's current state. TileStateKey distinguishes the tile's state by comparing the individual state keys of the surface renderables intersecting the tile. This does not retain any references to the surface renderables themselves. Should the tile state key live longer than the surface renderables, the state key does not prevent those objects from being reclaimed by the garbage collector.
    • Field Detail

      • tileKey

        protected final TileKey tileKey
      • intersectingObjectKeys

        protected final java.lang.Object[] intersectingObjectKeys
    • Constructor Detail

      • SurfaceObjectTileStateKey

        public SurfaceObjectTileStateKey​(DrawContext dc,
                                         SurfaceObjectTileBuilder.SurfaceObjectTile tile)
        Construsts a tile state key for the specified surface renderable tile.
        Parameters:
        dc - the draw context the state key is related to.
        tile - the tile to construct a state key for.
    • Method Detail

      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • getSizeInBytes

        public long getSizeInBytes()
        Returns the tile state key's size in bytes. The total size of the intersecting object keys, plus the size of the array itself. The tileKey is owned by the SurfaceObjectTile, so we don't include it in the state key's size.
        Specified by:
        getSizeInBytes in interface Cacheable
        Returns:
        The state key's size in bytes.