public class DefaultImageCache extends java.lang.Object implements ImageCache
默认图片缓存实现,用于保存已经生成的图片缓存索引以及文件路径等信息,便于快速查找对应的缓存对象。
| 构造器和说明 |
|---|
DefaultImageCache(java.lang.String mapName, java.lang.String outputDir) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
add(CacheItem item, int width, int height)
添加缓存项。
|
boolean |
cacheExists(CacheItem cacheItem, int width, int height)
判断对应的缓存是否存在
|
void |
clear(Rectangle2D bounds)
清除缓存
|
void |
clear(Rectangle2D bounds, int width, int height)
清除缓存
|
void |
clearAll()
清除所有缓存。
|
CacheItem[] |
getCacheItems(Rectangle2D bounds, double scale)
根据范围和比例尺获取对应的缓存项
|
CacheItem[] |
getCacheItems(Rectangle2D bounds, int width, int height, double scale)
获取对应范围内的缓存项
|
void |
remove(CacheItem item)
移除对应的缓存项
|
public DefaultImageCache(java.lang.String mapName,
java.lang.String outputDir)
public void add(CacheItem item, int width, int height)
ImageCache添加缓存项。
add 在接口中 ImageCachepublic boolean cacheExists(CacheItem cacheItem, int width, int height)
ImageCache判断对应的缓存是否存在
cacheExists 在接口中 ImageCachepublic void clear(Rectangle2D bounds)
ImageCache清除缓存
clear 在接口中 ImageCachepublic void clear(Rectangle2D bounds, int width, int height)
ImageCache清除缓存
clear 在接口中 ImageCachepublic void clearAll()
ImageCache清除所有缓存。
clearAll 在接口中 ImageCachepublic CacheItem[] getCacheItems(Rectangle2D bounds, int width, int height, double scale)
获取对应范围内的缓存项
getCacheItems 在接口中 ImageCachepublic CacheItem[] getCacheItems(Rectangle2D bounds, double scale)
ImageCache根据范围和比例尺获取对应的缓存项
getCacheItems 在接口中 ImageCachepublic void remove(CacheItem item)
移除对应的缓存项
remove 在接口中 ImageCache