public class VPFFeatureCache extends CacheHandler
Modifier and Type | Class and Description |
---|---|
static class |
VPFFeatureCache.VPFListCacheObject
CacheObject used by VPFFeatureCache.
|
DEFAULT_MAX_CACHE_SIZE, logger, logicalClock, objs
Constructor and Description |
---|
VPFFeatureCache()
Create a VPFFeatureCache of the default maximum size.
|
VPFFeatureCache(int maxSize)
Create a VPFFeatureCache of the specified maximum size.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addToCachedList(java.lang.String libraryName,
OMGraphic omg,
java.lang.String featureType,
PrimitiveTable pt,
java.lang.String type)
Adds an OMGraphic to a list, signified by the feature type and the table.
|
static java.lang.String |
createTableCacheKey(java.lang.String libraryName,
java.lang.String featureType,
java.lang.String tilePath)
Create an identifying key from the feature type and tile path.
|
java.lang.Object |
get(java.lang.String key,
java.lang.String featureType)
Additional get method that will call a load() method that takes into
account the featureType.
|
CacheObject |
load(java.lang.Object key)
CacheHandler method to load the new OMGraphicLists
(FeatureCacheGraphicLists).
|
CacheObject |
load(java.lang.String key,
java.lang.String featureType)
CacheHandler method to load the new OMGraphicLists
(FeatureCacheGraphicLists).
|
FeatureCacheGraphicList |
loadCachedGraphicList(java.lang.String libraryName,
java.lang.String featureType,
java.lang.String tilePath,
OMGraphicList requestor)
Returns true if the features from a tile (as described by the key)
existed and was added to the warehouse graphics list.
|
FeatureCacheGraphicList |
needToFetchTileContents(java.lang.String libraryName,
java.lang.String currentFeature,
TileDirectory currentTile,
OMGraphicList requestor)
Query that the CoverageTable makes to decide whether to read the file
contents or to used the cached version.
|
clear, get, getCacheSize, listIterator, replaceLeastUsed, resetCache, resetCache, searchCache
public VPFFeatureCache()
public VPFFeatureCache(int maxSize)
protected void addToCachedList(java.lang.String libraryName, OMGraphic omg, java.lang.String featureType, PrimitiveTable pt, java.lang.String type)
omg
- OMGraphic to addfeatureType
- the feature code of the OMGraphicpt
- the PrimitiveTable containing the path to the CoverageTile.public static java.lang.String createTableCacheKey(java.lang.String libraryName, java.lang.String featureType, java.lang.String tilePath)
public FeatureCacheGraphicList loadCachedGraphicList(java.lang.String libraryName, java.lang.String featureType, java.lang.String tilePath, OMGraphicList requestor)
featureType
- the feature type code.tilePath
- the relative path to the tile file.requestor
- the OMGraphicList used to contain cached lists. The
cached list will for the featureType/path code will be added to
this list, regardless of whether it's been populated or not. The
requestor list will be returned when the warehouse is asked for
the graphics list.public FeatureCacheGraphicList needToFetchTileContents(java.lang.String libraryName, java.lang.String currentFeature, TileDirectory currentTile, OMGraphicList requestor)
currentFeature
- the feature typecurrentTile
- the tile directoryrequestor
- the OMGraphicList to add the cached list to. If the
CoverageTable reads the data files, the OMGraphics created from
the files will be added to the list added to the requestor.public java.lang.Object get(java.lang.String key, java.lang.String featureType)
key
- the created key for cached list, see createTableCacheKeyfeatureType
- the kind of feature, VPFUtil.Area, VPFUtil.Edge,
VPFUtil.Point or VPFUtil.Text.public CacheObject load(java.lang.Object key)
load
in class CacheHandler
public CacheObject load(java.lang.String key, java.lang.String featureType)
Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details