NASA World Wind

gov.nasa.worldwind.util
Class Level

java.lang.Object
  extended by gov.nasa.worldwind.avlist.AVListImpl
      extended by gov.nasa.worldwind.util.Level
All Implemented Interfaces:
AVList, Comparable<Level>

public class Level
extends AVListImpl
implements Comparable<Level>


Field Summary
protected  AbsentResourceList absentTiles
           
protected  boolean active
           
protected  String cacheName
           
protected  String dataset
           
protected  long expiryTime
           
protected  String formatSuffix
           
protected  String levelName
           
protected  int levelNumber
           
protected  AVList params
           
protected  String path
           
protected  String service
           
protected  double texelSize
           
protected  LatLon tileDelta
           
protected  int tileHeight
           
protected  int tileWidth
           
protected  TileUrlBuilder urlBuilder
           
 
Constructor Summary
Level(AVList params)
           
 
Method Summary
 int compareTo(Level that)
           
 Sector computeSectorForPosition(Angle latitude, Angle longitude, LatLon tileOrigin)
           
 boolean equals(Object o)
           
 AbsentResourceList getAbsentTiles()
           
 String getCacheName()
           
 String getDataset()
           
 long getExpiryTime()
           
 String getFormatSuffix()
           
 String getLevelName()
           
 int getLevelNumber()
           
 AVList getParams()
           
 String getPath()
           
 String getService()
           
 double getTexelSize()
           
 LatLon getTileDelta()
           
 int getTileHeight()
           
 URL getTileResourceURL(Tile tile, String imageFormat)
          Returns the URL necessary to retrieve the specified tile.
 int getTileWidth()
           
 Object getValue(String key)
          Returns the value for a specified key.
 int hashCode()
           
 boolean isActive()
           
 boolean isEmpty()
           
 boolean isResourceAbsent(long tileNumber)
           
 void markResourceAbsent(long tileNumber)
           
 void setActive(boolean active)
           
 void setExpiryTime(long expTime)
           
 Object setValue(String key, Object value)
          Adds a key/value pair to the list.
 String toString()
           
 void unmarkResourceAbsent(long tileNumber)
           
protected  String validate(AVList params)
          Determines whether the constructor arguments are valid.
 
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, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

absentTiles

protected AbsentResourceList absentTiles

active

protected boolean active

cacheName

protected String cacheName

dataset

protected String dataset

expiryTime

protected long expiryTime

formatSuffix

protected String formatSuffix

levelName

protected String levelName

levelNumber

protected int levelNumber

params

protected AVList params

path

protected String path

service

protected String service

texelSize

protected double texelSize

tileDelta

protected LatLon tileDelta

tileHeight

protected int tileHeight

tileWidth

protected int tileWidth

urlBuilder

protected TileUrlBuilder urlBuilder
Constructor Detail

Level

public Level(AVList params)
Method Detail

compareTo

public int compareTo(Level that)
Specified by:
compareTo in interface Comparable<Level>

computeSectorForPosition

public Sector computeSectorForPosition(Angle latitude,
                                       Angle longitude,
                                       LatLon tileOrigin)

equals

public boolean equals(Object o)
Overrides:
equals in class Object

getAbsentTiles

public AbsentResourceList getAbsentTiles()

getCacheName

public String getCacheName()

getDataset

public String getDataset()

getExpiryTime

public long getExpiryTime()

getFormatSuffix

public String getFormatSuffix()

getLevelName

public String getLevelName()

getLevelNumber

public int getLevelNumber()

getParams

public AVList getParams()

getPath

public String getPath()

getService

public String getService()

getTexelSize

public double getTexelSize()

getTileDelta

public LatLon getTileDelta()

getTileHeight

public int getTileHeight()

getTileResourceURL

public URL getTileResourceURL(Tile tile,
                              String imageFormat)
                       throws MalformedURLException
Returns the URL necessary to retrieve the specified tile.

Parameters:
tile - the tile who's resources will be retrieved.
imageFormat - a string identifying the mime type of the desired image format
Returns:
the resource URL.
Throws:
MalformedURLException - if the URL cannot be formed from the tile's parameters.
IllegalArgumentException - if tile is null.

getTileWidth

public int getTileWidth()

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.

hashCode

public int hashCode()
Overrides:
hashCode in class Object

isActive

public boolean isActive()

isEmpty

public boolean isEmpty()

isResourceAbsent

public boolean isResourceAbsent(long tileNumber)

markResourceAbsent

public void markResourceAbsent(long tileNumber)

setActive

public void setActive(boolean active)

setExpiryTime

public void setExpiryTime(long expTime)

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.

toString

public String toString()
Overrides:
toString in class Object

unmarkResourceAbsent

public void unmarkResourceAbsent(long tileNumber)

validate

protected String validate(AVList params)
Determines whether the constructor arguments are valid.

Parameters:
params - the list of parameters to validate.
Returns:
null if valid, otherwise a String containing a description of why it's invalid.

NASA World Wind