Class ImageCacheStatistics
java.lang.Object
org.apache.xmlgraphics.image.loader.cache.ImageCacheStatistics
- All Implemented Interfaces:
EventListener, ImageCacheListener
Convenience class that gathers statistical information about the image cache.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcacheHitImage(ImageKey key) An Image was found in the cachevoidcacheHitImageInfo(String uri) An ImageInfo was found in the cachevoidcacheMissImage(ImageKey key) An Image was not in the cachevoidcacheMissImageInfo(String uri) An ImageInfo was not in the cacheReturns a Map<ImageKey, Integer> with the number of cache hits.intReturns the number of cache hits for Image instances.intReturns the number of cache misses for Image instances.Returns a Map<ImageKey, Integer> with the number of cache misses.intReturns the number of cache hits for ImageInfo instances.intReturns the number of cache misses for ImageInfo instances.intReturns the number of times an invalid URI is tried.voidinvalidHit(String uri) An URi previously identified as invalid was requested againvoidreset()Reset the gathered statistics information.
-
Constructor Details
-
ImageCacheStatistics
public ImageCacheStatistics(boolean detailed) Main constructor.- Parameters:
detailed- true if the cache hits/misses for each Image instance should be recorded.
-
-
Method Details
-
reset
public void reset()Reset the gathered statistics information. -
invalidHit
An URi previously identified as invalid was requested again- Specified by:
invalidHitin interfaceImageCacheListener- Parameters:
uri- the invalid URI
-
cacheHitImageInfo
An ImageInfo was found in the cache- Specified by:
cacheHitImageInfoin interfaceImageCacheListener- Parameters:
uri- the image's URI
-
cacheMissImageInfo
An ImageInfo was not in the cache- Specified by:
cacheMissImageInfoin interfaceImageCacheListener- Parameters:
uri- the image's URI
-
cacheHitImage
An Image was found in the cache- Specified by:
cacheHitImagein interfaceImageCacheListener- Parameters:
key- the image key
-
cacheMissImage
An Image was not in the cache- Specified by:
cacheMissImagein interfaceImageCacheListener- Parameters:
key- the image key
-
getInvalidHits
public int getInvalidHits()Returns the number of times an invalid URI is tried.- Returns:
- the number of times an invalid URI is tried.
-
getImageInfoCacheHits
public int getImageInfoCacheHits()Returns the number of cache hits for ImageInfo instances.- Returns:
- the number of cache hits for ImageInfo instances.
-
getImageInfoCacheMisses
public int getImageInfoCacheMisses()Returns the number of cache misses for ImageInfo instances.- Returns:
- the number of cache misses for ImageInfo instances.
-
getImageCacheHits
public int getImageCacheHits()Returns the number of cache hits for Image instances.- Returns:
- the number of cache hits for Image instances.
-
getImageCacheMisses
public int getImageCacheMisses()Returns the number of cache misses for Image instances.- Returns:
- the number of cache misses for Image instances.
-
getImageCacheHitMap
Returns a Map<ImageKey, Integer> with the number of cache hits.- Returns:
- a Map<ImageKey, Integer> with the number of cache hits
-
getImageCacheMissMap
Returns a Map<ImageKey, Integer> with the number of cache misses.- Returns:
- a Map<ImageKey, Integer> with the number of cache misses
-