public class DefaultImageCache extends java.lang.Object implements ImageCache
It's used to save the generated image cache index and the files location, etc, to help quickly search relevant cache object.
| Constructor and Description |
|---|
DefaultImageCache(java.lang.String mapName, java.lang.String outputDir) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(CacheItem item, int width, int height)
Add cache item.
|
boolean |
cacheExists(CacheItem cacheItem, int width, int height)
Determine whether the corresponding cache exists
|
void |
clear(Rectangle2D bounds)
Clear the cache
|
void |
clear(Rectangle2D bounds, int width, int height)
Clear the cache
|
void |
clearAll()
Clear all cache.
|
CacheItem[] |
getCacheItems(Rectangle2D bounds, double scale)
Get the corresponding cache item according to the range and scale
|
CacheItem[] |
getCacheItems(Rectangle2D bounds, int width, int height, double scale)
Get the cache item in corresponding range
|
void |
remove(CacheItem item)
Remove the corresponding image item
|
public DefaultImageCache(java.lang.String mapName,
java.lang.String outputDir)
public void add(CacheItem item, int width, int height)
ImageCacheAdd cache item.
add in interface ImageCachepublic boolean cacheExists(CacheItem cacheItem, int width, int height)
ImageCacheDetermine whether the corresponding cache exists
cacheExists in interface ImageCachepublic void clear(Rectangle2D bounds)
ImageCacheClear the cache
clear in interface ImageCachepublic void clear(Rectangle2D bounds, int width, int height)
ImageCacheClear the cache
clear in interface ImageCachepublic void clearAll()
ImageCacheClear all cache.
clearAll in interface ImageCachepublic CacheItem[] getCacheItems(Rectangle2D bounds, int width, int height, double scale)
Get the cache item in corresponding range
getCacheItems in interface ImageCachepublic CacheItem[] getCacheItems(Rectangle2D bounds, double scale)
ImageCacheGet the corresponding cache item according to the range and scale
getCacheItems in interface ImageCachepublic void remove(CacheItem item)
Remove the corresponding image item
remove in interface ImageCache