NASA World Wind

gov.nasa.worldwind.util
Class LevelSet

java.lang.Object
  extended by gov.nasa.worldwind.avlist.AVListImpl
      extended by gov.nasa.worldwind.WWObjectImpl
          extended by gov.nasa.worldwind.util.LevelSet
All Implemented Interfaces:
AVList, MessageListener, WWObject, PropertyChangeListener, EventListener

public class LevelSet
extends WWObjectImpl


Nested Class Summary
static class LevelSet.SectorResolution
           
 
Constructor Summary
LevelSet(AVList params)
           
LevelSet(LevelSet source)
           
 
Method Summary
 Sector computeSectorForKey(TileKey key)
           
 Tile createTile(TileKey key)
           
 Level getFirstLevel()
           
 Level getLastLevel()
           
 Level getLastLevel(Angle latitude, Angle longitude)
           
 Level getLastLevel(Sector sector)
           
 Level getLevel(int levelNumber)
           
 ArrayList<Level> getLevels()
           
 LatLon getLevelZeroTileDelta()
           
 Level getNextToLastLevel()
           
 int getNumLevels()
           
 Sector getSector()
           
 LevelSet.SectorResolution[] getSectorLevelLimits()
           
 LatLon getTileOrigin()
           
 Object getValue(String key)
          Returns the value for a specified key.
 boolean isFinalLevel(int levelNum)
           
 boolean isLevelEmpty(int levelNumber)
           
 boolean isResourceAbsent(Tile tile)
          Indicates whether a tile has been marked as absent.
 boolean isResourceAbsent(TileKey tileKey)
          Indicates whether a tile has been marked as absent.
 void markResourceAbsent(Tile tile)
          Instructs the level set that a tile is likely to be absent.
 void setExpiryTime(long expiryTime)
           
 Object setValue(String key, Object value)
          Adds a key/value pair to the list.
 void unmarkResourceAbsent(Tile tile)
          Removes the absent-tile mark associated with a tile, if one is associatied.
 
Methods inherited from class gov.nasa.worldwind.WWObjectImpl
onMessage, propertyChange
 
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, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValues
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.nasa.worldwind.avlist.AVList
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValues
 

Constructor Detail

LevelSet

public LevelSet(AVList params)

LevelSet

public LevelSet(LevelSet source)
Method Detail

computeSectorForKey

public Sector computeSectorForKey(TileKey key)

createTile

public Tile createTile(TileKey key)

getFirstLevel

public final Level getFirstLevel()

getLastLevel

public final Level getLastLevel()

getLastLevel

public final Level getLastLevel(Angle latitude,
                                Angle longitude)

getLastLevel

public final Level getLastLevel(Sector sector)

getLevel

public final Level getLevel(int levelNumber)

getLevels

public final ArrayList<Level> getLevels()

getLevelZeroTileDelta

public final LatLon getLevelZeroTileDelta()

getNextToLastLevel

public final Level getNextToLastLevel()

getNumLevels

public final int getNumLevels()

getSector

public final Sector getSector()

getSectorLevelLimits

public final LevelSet.SectorResolution[] getSectorLevelLimits()

getTileOrigin

public final LatLon getTileOrigin()

getValue

public Object getValue(String key)
Description copied from interface: AVList
Returns the value for a specified key.

Specified by:
getValue in interface AVList
Overrides:
getValue in class AVListImpl
Parameters:
key - the attribute name. May not be null.
Returns:
the attribute value if one exists in the collection, otherwise null.

isFinalLevel

public final boolean isFinalLevel(int levelNum)

isLevelEmpty

public final boolean isLevelEmpty(int levelNumber)

isResourceAbsent

public final boolean isResourceAbsent(Tile tile)
Indicates whether a tile has been marked as absent.

Parameters:
tile - The tile in question.
Returns:
true if the tile is marked absent, otherwise false.
Throws:
IllegalArgumentException - if tile is null

isResourceAbsent

public final boolean isResourceAbsent(TileKey tileKey)
Indicates whether a tile has been marked as absent.

Parameters:
tileKey - The key of the tile in question.
Returns:
true if the tile is marked absent, otherwise false.
Throws:
IllegalArgumentException - if tile is null

markResourceAbsent

public final void markResourceAbsent(Tile tile)
Instructs the level set that a tile is likely to be absent.

Parameters:
tile - The tile to mark as having an absent resource.
Throws:
IllegalArgumentException - if tile is null

setExpiryTime

public void setExpiryTime(long expiryTime)

setValue

public Object setValue(String key,
                       Object value)
Description copied from interface: AVList
Adds a key/value pair to the list. Replaces an existing key/value pair if the list already contains the key.

Specified by:
setValue in interface AVList
Overrides:
setValue in class AVListImpl
Parameters:
key - the attribute name. May not be null.
value - the attribute value. May be null, in which case any existing value for the key is removed from the collection.
Returns:
previous value associated with specified key, or null if there was no mapping for key. A null return can also indicate that the map previously associated null with the specified key, if the implementation supports null values.

unmarkResourceAbsent

public final void unmarkResourceAbsent(Tile tile)
Removes the absent-tile mark associated with a tile, if one is associatied.

Parameters:
tile - The tile to unmark.
Throws:
IllegalArgumentException - if tile is null

NASA World Wind