public interface TileCache extends ObservableInterface
Modifier and Type | Method and Description |
---|---|
boolean |
containsKey(Job key) |
void |
destroy()
Destroys this cache.
|
org.mapsforge.core.graphics.TileBitmap |
get(Job key) |
int |
getCapacity() |
int |
getCapacityFirstLevel() |
org.mapsforge.core.graphics.TileBitmap |
getImmediately(Job key)
Returns tileBitmap only if available at fastest cache in case of multi-layered cache, null otherwise.
|
void |
purge()
Purges this cache.
|
void |
put(Job key,
org.mapsforge.core.graphics.TileBitmap bitmap) |
void |
setWorkingSet(java.util.Set<Job> workingSet)
Reserves a working set in this cache, for multi-level caches this means bringing the elements in workingSet into
the fastest cache.
|
addObserver, removeObserver
boolean containsKey(Job key)
Map.containsKey(java.lang.Object)
void destroy()
purge()
should be used for this purpose. The earlier practice is now discouraged and may lead to
unexpected results when used with features introduced in 0.5.1 or later.org.mapsforge.core.graphics.TileBitmap get(Job key)
Map.get(java.lang.Object)
int getCapacity()
int getCapacityFirstLevel()
org.mapsforge.core.graphics.TileBitmap getImmediately(Job key)
void purge()
get(Job)
issued after purging will not return any tiles added before the purge operation.
Applications should purge the tile cache when map model parameters change, such as the render style for locally
rendered tiles, or the source for downloaded tiles. Applications which frequently alternate between a limited
number of map model configurations may want to consider using a different cache for each.void put(Job key, org.mapsforge.core.graphics.TileBitmap bitmap)
java.lang.IllegalArgumentException
- if any of the parameters is null
.Map.put(K, V)
void setWorkingSet(java.util.Set<Job> workingSet)