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)
ImageCache
Add cache item.
add
in interface ImageCache
public boolean cacheExists(CacheItem cacheItem, int width, int height)
ImageCache
Determine whether the corresponding cache exists
cacheExists
in interface ImageCache
public void clear(Rectangle2D bounds)
ImageCache
Clear the cache
clear
in interface ImageCache
public void clear(Rectangle2D bounds, int width, int height)
ImageCache
Clear the cache
clear
in interface ImageCache
public void clearAll()
ImageCache
Clear all cache.
clearAll
in interface ImageCache
public CacheItem[] getCacheItems(Rectangle2D bounds, int width, int height, double scale)
Get the cache item in corresponding range
getCacheItems
in interface ImageCache
public CacheItem[] getCacheItems(Rectangle2D bounds, double scale)
ImageCache
Get the corresponding cache item according to the range and scale
getCacheItems
in interface ImageCache
public void remove(CacheItem item)
Remove the corresponding image item
remove
in interface ImageCache