Modifier and Type | Method and Description |
---|---|
long |
getTimestamp()
Returns the timestamp of the tile in milliseconds since January 1, 1970 GMT or 0 if this timestamp is unknown.
|
boolean |
isExpired()
Whether the TileBitmap has expired.
|
void |
setExpiration(long expiration)
Sets the timestamp when this tile will be expired in milliseconds since January 1, 1970 GMT or 0 if this
timestamp is unknown.
|
void |
setTimestamp(long timestamp)
Sets the timestamp of the tile in milliseconds since January 1, 1970 GMT.
|
compress, decrementRefCount, getHeight, getWidth, incrementRefCount, isDestroyed, scaleTo, setBackgroundColor
long getTimestamp()
boolean isExpired()
org.mapsforge.map.layer.download.tilesource.TileSource
).true
if expired, false
otherwise.void setExpiration(long expiration)
isExpired()
will return
true
. For a downloaded tile, pass the value returned by
java.net.HttpURLConnection#getExpiration()
, if set by the server. In all other cases you can pass current
time plus a fixed TTL in order to have the tile expire after the specified time.void setTimestamp(long timestamp)
org.mapsforge.map.reader.header.MapFileInfo#mapDate
. For a tile read from a disk cache, it
should be the file's timestamp. In all other cases (including downloaded tiles), the timestamp should be set to
wall clock time (as returned by System.currentTimeMillis()
) when the tile is created.
Classes that implement this interface should call System.currentTimeMillis()
upon creating an
instance, store the result and return it unless setTimestamp()
has been called for that instance.