Package gov.nasa.worldwind.util
Class Level
- java.lang.Object
-
- gov.nasa.worldwind.avlist.AVListImpl
-
- gov.nasa.worldwind.util.Level
-
public class Level extends AVListImpl implements java.lang.Comparable<Level>
-
-
Field Summary
Fields Modifier and Type Field Description protected AbsentResourceList
absentTiles
protected boolean
active
protected java.lang.String
cacheName
protected java.lang.String
dataset
protected long
expiryTime
protected java.lang.String
formatSuffix
protected java.lang.String
levelName
protected int
levelNumber
protected AVList
params
protected java.lang.String
path
protected java.lang.String
service
protected double
texelSize
protected LatLon
tileDelta
protected int
tileHeight
protected int
tileWidth
protected TileUrlBuilder
urlBuilder
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Level that)
Sector
computeSectorForPosition(Angle latitude, Angle longitude, LatLon tileOrigin)
boolean
equals(java.lang.Object o)
AbsentResourceList
getAbsentTiles()
java.lang.String
getCacheName()
java.lang.String
getDataset()
long
getExpiryTime()
java.lang.String
getFormatSuffix()
java.lang.String
getLevelName()
int
getLevelNumber()
AVList
getParams()
java.lang.String
getPath()
java.lang.String
getService()
double
getTexelSize()
LatLon
getTileDelta()
int
getTileHeight()
java.net.URL
getTileResourceURL(Tile tile, java.lang.String imageFormat)
Returns the URL necessary to retrieve the specified tile.int
getTileWidth()
java.lang.Object
getValue(java.lang.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)
java.lang.Object
setValue(java.lang.String key, java.lang.Object value)
Adds a key/value pair to the list.java.lang.String
toString()
void
unmarkResourceAbsent(long tileNumber)
protected java.lang.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
-
-
-
-
Field Detail
-
params
protected AVList params
-
levelNumber
protected int levelNumber
-
levelName
protected java.lang.String levelName
-
tileDelta
protected LatLon tileDelta
-
tileWidth
protected int tileWidth
-
tileHeight
protected int tileHeight
-
cacheName
protected java.lang.String cacheName
-
service
protected java.lang.String service
-
dataset
protected java.lang.String dataset
-
formatSuffix
protected java.lang.String formatSuffix
-
texelSize
protected double texelSize
-
path
protected java.lang.String path
-
urlBuilder
protected TileUrlBuilder urlBuilder
-
expiryTime
protected long expiryTime
-
active
protected boolean active
-
absentTiles
protected AbsentResourceList absentTiles
-
-
Constructor Detail
-
Level
public Level(AVList params)
-
-
Method Detail
-
validate
protected java.lang.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.
-
getParams
public AVList getParams()
-
getPath
public java.lang.String getPath()
-
getLevelNumber
public int getLevelNumber()
-
getLevelName
public java.lang.String getLevelName()
-
getTileDelta
public LatLon getTileDelta()
-
getTileWidth
public int getTileWidth()
-
getTileHeight
public int getTileHeight()
-
getFormatSuffix
public java.lang.String getFormatSuffix()
-
getService
public java.lang.String getService()
-
getDataset
public java.lang.String getDataset()
-
getCacheName
public java.lang.String getCacheName()
-
getTexelSize
public double getTexelSize()
-
isEmpty
public boolean isEmpty()
-
markResourceAbsent
public void markResourceAbsent(long tileNumber)
-
isResourceAbsent
public boolean isResourceAbsent(long tileNumber)
-
unmarkResourceAbsent
public void unmarkResourceAbsent(long tileNumber)
-
getExpiryTime
public long getExpiryTime()
-
setExpiryTime
public void setExpiryTime(long expTime)
-
isActive
public boolean isActive()
-
setActive
public void setActive(boolean active)
-
getAbsentTiles
public AbsentResourceList getAbsentTiles()
-
setValue
public java.lang.Object setValue(java.lang.String key, java.lang.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 interfaceAVList
- Overrides:
setValue
in classAVListImpl
- Parameters:
key
- the attribute name. May not benull
.value
- the attribute value. May benull
, 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.
-
getValue
public java.lang.Object getValue(java.lang.String key)
Description copied from interface:AVList
Returns the value for a specified key.- Specified by:
getValue
in interfaceAVList
- Overrides:
getValue
in classAVListImpl
- Parameters:
key
- the attribute name. May not benull
.- Returns:
- the attribute value if one exists in the collection, otherwise
null
.
-
getTileResourceURL
public java.net.URL getTileResourceURL(Tile tile, java.lang.String imageFormat) throws java.net.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:
java.net.MalformedURLException
- if the URL cannot be formed from the tile's parameters.java.lang.IllegalArgumentException
- iftile
is null.
-
computeSectorForPosition
public Sector computeSectorForPosition(Angle latitude, Angle longitude, LatLon tileOrigin)
-
compareTo
public int compareTo(Level that)
- Specified by:
compareTo
in interfacejava.lang.Comparable<Level>
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-