NASA World Wind

gov.nasa.worldwind.render
Class AbstractSurfaceShape.SurfaceShapeStateKey

java.lang.Object
  extended by gov.nasa.worldwind.render.AbstractSurfaceObject.SurfaceObjectStateKey
      extended by gov.nasa.worldwind.render.AbstractSurfaceShape.SurfaceShapeStateKey
All Implemented Interfaces:
Cacheable
Enclosing class:
AbstractSurfaceShape

protected static class AbstractSurfaceShape.SurfaceShapeStateKey
extends AbstractSurfaceObject.SurfaceObjectStateKey

Represents a surface shapes's current state. SurfaceShapeStateKey extends AbstractSurfaceObject.SurfaceObjectStateKey by adding the shape's current ShapeAttributes and the globe's state key.

SurfaceShapeStateKey uniquely identifies a surface shapes's current state exactly as SurfaceObjectStateKey does, but also distinguishes the shape's active ShapeAttributes from any previous attributes, and distinguishes between different globes via the globe state key.


Field Summary
protected  ShapeAttributes attributes
          The SurfaceShape's attributes.
protected  Object globeStateKey
          The Globe's state key.
 
Fields inherited from class gov.nasa.worldwind.render.AbstractSurfaceObject.SurfaceObjectStateKey
modifiedTime, uniqueId
 
Constructor Summary
AbstractSurfaceShape.SurfaceShapeStateKey(long uniqueID, long modifiedTime, ShapeAttributes attributes, Object globeStateKey)
          Constructs a new SurfaceShapeStateKey with the specified unique ID, modified time, attributes, and globe state key.
 
Method Summary
 boolean equals(Object o)
           
 long getSizeInBytes()
          Returns the state key's size in bytes.
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

attributes

protected final ShapeAttributes attributes
The SurfaceShape's attributes. May be null if the shape has no attributes.


globeStateKey

protected final Object globeStateKey
The Globe's state key. May be null if the shape's state does not depend on the globe.

Constructor Detail

AbstractSurfaceShape.SurfaceShapeStateKey

public AbstractSurfaceShape.SurfaceShapeStateKey(long uniqueID,
                                                 long modifiedTime,
                                                 ShapeAttributes attributes,
                                                 Object globeStateKey)
Constructs a new SurfaceShapeStateKey with the specified unique ID, modified time, attributes, and globe state key. The globe state key should be null if the surface shape does not depend on the globe.

Parameters:
uniqueID - the SurfaceShape's unique ID.
modifiedTime - the SurfaceShape's modified time.
attributes - the SurfaceShape's attributes, or null if the shape has no attributes.
globeStateKey - the globe's state key, or null if the shape does not depend on the globe.
See Also:
Globe.getStateKey(DrawContext)
Method Detail

equals

public boolean equals(Object o)
Overrides:
equals in class AbstractSurfaceObject.SurfaceObjectStateKey

getSizeInBytes

public long getSizeInBytes()
Returns the state key's size in bytes. Overridden to include the attributes and the reference to the globe state key.

Specified by:
getSizeInBytes in interface Cacheable
Overrides:
getSizeInBytes in class AbstractSurfaceObject.SurfaceObjectStateKey
Returns:
The state key's size in bytes.

hashCode

public int hashCode()
Overrides:
hashCode in class AbstractSurfaceObject.SurfaceObjectStateKey

NASA World Wind