com.supermap.services.util.cache
Class DefaultImageCache
- java.lang.Object
-
- com.supermap.services.util.cache.DefaultImageCache
-
- All Implemented Interfaces:
- ImageCache
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 Summary
Constructors Constructor and Description DefaultImageCache(java.lang.String mapName, java.lang.String outputDir)
-
Method Summary
Methods Modifier and Type Method and Description voidadd(CacheItem item, int width, int height)Add cache item.booleancacheExists(CacheItem cacheItem, int width, int height)Determine whether the corresponding cache existsvoidclear(Rectangle2D bounds)Clear the cachevoidclear(Rectangle2D bounds, int width, int height)Clear the cachevoidclearAll()Clear all cache.CacheItem[]getCacheItems(Rectangle2D bounds, double scale)Get the corresponding cache item according to the range and scaleCacheItem[]getCacheItems(Rectangle2D bounds, int width, int height, double scale)Get the cache item in corresponding rangevoidremove(CacheItem item)Remove the corresponding image item
-
-
-
Constructor Detail
-
DefaultImageCache
public DefaultImageCache(java.lang.String mapName, java.lang.String outputDir)
-
-
Method Detail
-
add
public void add(CacheItem item, int width, int height)
Description copied from interface:ImageCacheAdd cache item.
- Specified by:
addin interfaceImageCache
-
cacheExists
public boolean cacheExists(CacheItem cacheItem, int width, int height)
Description copied from interface:ImageCacheDetermine whether the corresponding cache exists
- Specified by:
cacheExistsin interfaceImageCache- Returns:
-
clear
public void clear(Rectangle2D bounds)
Description copied from interface:ImageCacheClear the cache
- Specified by:
clearin interfaceImageCache
-
clear
public void clear(Rectangle2D bounds, int width, int height)
Description copied from interface:ImageCacheClear the cache
- Specified by:
clearin interfaceImageCache
-
clearAll
public void clearAll()
Description copied from interface:ImageCacheClear all cache.
- Specified by:
clearAllin interfaceImageCache
-
getCacheItems
public CacheItem[] getCacheItems(Rectangle2D bounds, int width, int height, double scale)
Get the cache item in corresponding range
- Specified by:
getCacheItemsin interfaceImageCache- Returns:
-
getCacheItems
public CacheItem[] getCacheItems(Rectangle2D bounds, double scale)
Description copied from interface:ImageCacheGet the corresponding cache item according to the range and scale
- Specified by:
getCacheItemsin interfaceImageCache- Returns:
-
remove
public void remove(CacheItem item)
Remove the corresponding image item
- Specified by:
removein interfaceImageCache
-
-