NASA World Wind

gov.nasa.worldwind.cache
Class ShapeDataCache.ShapeDataCacheEntry

java.lang.Object
  extended by gov.nasa.worldwind.avlist.AVListImpl
      extended by gov.nasa.worldwind.cache.ShapeDataCache.ShapeDataCacheEntry
All Implemented Interfaces:
AVList
Direct Known Subclasses:
AbstractShape.AbstractShapeData, KMLRegion.RegionData
Enclosing class:
ShapeDataCache

public static class ShapeDataCache.ShapeDataCacheEntry
extends AVListImpl


Field Summary
protected  Extent extent
          Indicates the associated shape's extent, in model coordinates relative to the associated globe.
protected  double eyeDistance
          Indicates the eye distance of the shape in the globe-relative coordinate system.
protected  GlobeStateKey globeStateKey
          Identifies the associated globe's state at the time the entry was created.
protected  long lastUsed
          Indicates the last time, in milliseconds, the entry was requested or added.
protected  TimedExpirySupport timer
          Determines whether the cache entry has expired.
protected  double verticalExaggeration
          Indicates the vertical exaggeration in effect when the entry was cached.
 
Constructor Summary
ShapeDataCache.ShapeDataCacheEntry(DrawContext dc, long minExpiryTime, long maxExpiryTime)
          Constructs an entry using the globe and vertical exaggeration of a specified draw context.
 
Method Summary
 Extent getExtent()
          Returns this entry's extent.
 double getEyeDistance()
          Indicates this entry's eye distance.
 GlobeStateKey getGlobeStateKey()
          Indicates this entry's globe state key, captured when this entry was constructed or when explicitly set.
 TimedExpirySupport getTimer()
          Returns this entry's expiration timer.
 double getVerticalExaggeration()
          Indicates this entry's vertical exaggeration, captured when the entry was constructed or when explicitly set.
 boolean isExpired(DrawContext dc)
          Indicates whether this entry has expired.
 boolean isValid(DrawContext dc)
          Indicates whether this shape data's globe state and vertical exaggeration are the same as that in the current draw context.
 void restartTimer(DrawContext dc)
          Resets the timer to the current time.
 void setExpired(boolean isExpired)
          Sets this entry's expiration state.
 void setExtent(Extent extent)
          Specifies this entry's extent.
 void setEyeDistance(double eyeDistance)
          Specifies this entry's eye distance.
 void setGlobeStateKey(GlobeStateKey globeStateKey)
          Specifies this entry's globe state key.
 void setTimer(TimedExpirySupport timer)
          Specifies this entry's expiration timer.
 void setVerticalExaggeration(double verticalExaggeration)
           
 
Methods inherited from class gov.nasa.worldwind.avlist.AVListImpl
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getBooleanValue, getBooleanValue, getChangeSupport, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getRestorableStateForAVPair, getStringValue, getStringValue, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

extent

protected Extent extent
Indicates the associated shape's extent, in model coordinates relative to the associated globe.


eyeDistance

protected double eyeDistance
Indicates the eye distance of the shape in the globe-relative coordinate system.


globeStateKey

protected GlobeStateKey globeStateKey
Identifies the associated globe's state at the time the entry was created.


lastUsed

protected long lastUsed
Indicates the last time, in milliseconds, the entry was requested or added.


timer

protected TimedExpirySupport timer
Determines whether the cache entry has expired.


verticalExaggeration

protected double verticalExaggeration
Indicates the vertical exaggeration in effect when the entry was cached.

Constructor Detail

ShapeDataCache.ShapeDataCacheEntry

public ShapeDataCache.ShapeDataCacheEntry(DrawContext dc,
                                          long minExpiryTime,
                                          long maxExpiryTime)
Constructs an entry using the globe and vertical exaggeration of a specified draw context.

Parameters:
dc - the draw context. Must contain a globe.
minExpiryTime - the minimum expiration duration, in milliseconds.
maxExpiryTime - the maximum expiration duration, in milliseconds.
Throws:
IllegalArgumentException - if the draw context is null.
Method Detail

getExtent

public Extent getExtent()
Returns this entry's extent.

Returns:
this entry's extent.

getEyeDistance

public double getEyeDistance()
Indicates this entry's eye distance.

Returns:
this entry's eye distance, in meters.

getGlobeStateKey

public GlobeStateKey getGlobeStateKey()
Indicates this entry's globe state key, captured when this entry was constructed or when explicitly set.

Returns:
this entry's globe state key.

getTimer

public TimedExpirySupport getTimer()
Returns this entry's expiration timer.

Returns:
this entry's expiration timer.

getVerticalExaggeration

public double getVerticalExaggeration()
Indicates this entry's vertical exaggeration, captured when the entry was constructed or when explicitly set.

Returns:
this entry's vertical exaggeration.

isExpired

public boolean isExpired(DrawContext dc)
Indicates whether this entry has expired.

Parameters:
dc - the current draw context.
Returns:
true if the entry has expired, otherwise false.

isValid

public boolean isValid(DrawContext dc)
Indicates whether this shape data's globe state and vertical exaggeration are the same as that in the current draw context.

Parameters:
dc - the current draw context.
Returns:
true if the shape is valid, otherwise false.

restartTimer

public void restartTimer(DrawContext dc)
Resets the timer to the current time.

Parameters:
dc - the current draw context.
Throws:
IllegalArgumentException - if the draw context is null.

setExpired

public void setExpired(boolean isExpired)
Sets this entry's expiration state.

Parameters:
isExpired - true to expire the entry, otherwise false.

setExtent

public void setExtent(Extent extent)
Specifies this entry's extent.

Parameters:
extent - the new extent. May be null.

setEyeDistance

public void setEyeDistance(double eyeDistance)
Specifies this entry's eye distance.

Parameters:
eyeDistance - the eye distance, in meters.

setGlobeStateKey

public void setGlobeStateKey(GlobeStateKey globeStateKey)
Specifies this entry's globe state key.

Parameters:
globeStateKey - the new globe state key.

setTimer

public void setTimer(TimedExpirySupport timer)
Specifies this entry's expiration timer.

Parameters:
timer - the new expiration timer.

setVerticalExaggeration

public void setVerticalExaggeration(double verticalExaggeration)

NASA World Wind