public class PersistentCacheTileDataSource extends CacheTileDataSource
swigCMemOwn| Constructor and Description |
|---|
PersistentCacheTileDataSource(long cPtr,
boolean cMemoryOwn) |
PersistentCacheTileDataSource(TileDataSource dataSource,
java.lang.String databasePath)
Constructs a PersistentCacheTileDataSource object from tile data source
and a sqlite database. |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clear the cache.
|
void |
close()
Close the cache database.
|
void |
delete() |
protected void |
finalize() |
long |
getCapacity()
Returns the compressed tile cache capacity.
|
static long |
getCPtr(PersistentCacheTileDataSource obj) |
boolean |
isCacheOnlyMode()
Returns the state of cache only mode.
|
TileData |
loadTile(MapTile mapTile)
Loads the specified tile.
|
void |
setCacheOnlyMode(boolean enabled)
Switches the datasource to 'cache only' mode or switches back from the mode.
If enabled, tiles are loaded from the cache only and the original data source is not used. By default, cache only mode is off. |
void |
setCapacity(long capacity)
Sets the cache capacity.
|
static PersistentCacheTileDataSource |
swigCreatePolymorphicInstance(long cPtr,
boolean cMemoryOwn)
Creates a polymorphic instance of the given native object.
|
protected void |
swigDirectorDisconnect() |
java.lang.String |
swigGetClassName()
Returns the actual class name of this object.
|
java.lang.Object |
swigGetDirectorObject()
Returns the connected director object.
|
void |
swigReleaseOwnership() |
void |
swigTakeOwnership() |
getCPtr, notifyTilesChangedgetCPtr, getMaxZoom, getMinZoom, getProjectionpublic PersistentCacheTileDataSource(long cPtr,
boolean cMemoryOwn)
public PersistentCacheTileDataSource(TileDataSource dataSource, java.lang.String databasePath)
dataSource - The datasource to be cached.databasePath - The path to the sqlite database, where the tiles will be cached.public static long getCPtr(PersistentCacheTileDataSource obj)
protected void finalize()
finalize in class CacheTileDataSourcepublic void delete()
delete in class CacheTileDataSourceprotected void swigDirectorDisconnect()
swigDirectorDisconnect in class CacheTileDataSourcepublic void swigReleaseOwnership()
swigReleaseOwnership in class CacheTileDataSourcepublic void swigTakeOwnership()
swigTakeOwnership in class CacheTileDataSourcepublic static PersistentCacheTileDataSource swigCreatePolymorphicInstance(long cPtr, boolean cMemoryOwn)
public boolean isCacheOnlyMode()
public void setCacheOnlyMode(boolean enabled)
enabled - True when the mode should be enabled, false otherwise.public void close()
public TileData loadTile(MapTile mapTile)
TileDataSourceloadTile in class TileDataSourcemapTile - The tile to load.public void clear()
CacheTileDataSourceclear in class CacheTileDataSourcepublic long getCapacity()
CacheTileDataSourcegetCapacity in class CacheTileDataSourcepublic void setCapacity(long capacity)
CacheTileDataSourcesetCapacity in class CacheTileDataSourcepublic java.lang.String swigGetClassName()
swigGetClassName in class CacheTileDataSourcepublic java.lang.Object swigGetDirectorObject()
swigGetDirectorObject in class CacheTileDataSource