Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| xmlgraphics-commons 2.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.xmlgraphics.image.loader.cache
Class ImageCacheStatistics

    java.lang.Object
      org.apache.xmlgraphics.image.loader.cache.ImageCacheStatistics

All Implemented Interfaces:
  EventListener, ImageCacheListener

    public class ImageCacheStatistics

extends Object
implements ImageCacheListener

Convenience class that gathers statistical information about the image cache.

Constructor Summary
`ImageCacheStatistics(boolean detailed)` Main constructor.

Method Summary
`void` | `cacheHitImage(ImageKey key)` An Image was found in the cache
`void` | `cacheHitImageInfo(String uri)` An ImageInfo was found in the cache
`void` | `cacheMissImage(ImageKey key)` An Image was not in the cache
`void` | `cacheMissImageInfo(String uri)` An ImageInfo was not in the cache
`Map` | `getImageCacheHitMap()` Returns a Map<ImageKey, Integer> with the number of cache hits.
`int` | `getImageCacheHits()` Returns the number of cache hits for Image instances.
`int` | `getImageCacheMisses()` Returns the number of cache misses for Image instances.
`Map` | `getImageCacheMissMap()` Returns a Map<ImageKey, Integer> with the number of cache misses.
`int` | `getImageInfoCacheHits()` Returns the number of cache hits for ImageInfo instances.
`int` | `getImageInfoCacheMisses()` Returns the number of cache misses for ImageInfo instances.
`int` | `getInvalidHits()` Returns the number of times an invalid URI is tried.
`void` | `invalidHit(String uri)` An URi previously identified as invalid was requested again
`void` | `reset()` Reset the gathered statistics information.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ImageCacheStatistics

    public ImageCacheStatistics(boolean detailed)

  Main constructor.

  Parameters:
    `detailed` - true if the cache hits/misses for each Image instance should be recorded.

Method Detail

### reset

    public void reset()

  Reset the gathered statistics information.

### invalidHit

    public void invalidHit(String uri)

  An URi previously identified as invalid was requested again

  Specified by:
    `invalidHit` in interface `ImageCacheListener`
  Parameters:
    `uri` - the invalid URI

### cacheHitImageInfo

    public void cacheHitImageInfo(String uri)

  An ImageInfo was found in the cache

  Specified by:
    `cacheHitImageInfo` in interface `ImageCacheListener`
  Parameters:
    `uri` - the image's URI

### cacheMissImageInfo

    public void cacheMissImageInfo(String uri)

  An ImageInfo was not in the cache

  Specified by:
    `cacheMissImageInfo` in interface `ImageCacheListener`
  Parameters:
    `uri` - the image's URI

### cacheHitImage

    public void cacheHitImage(ImageKey key)

  An Image was found in the cache

  Specified by:
    `cacheHitImage` in interface `ImageCacheListener`
  Parameters:
    `key` - the image key

### cacheMissImage

    public void cacheMissImage(ImageKey key)

  An Image was not in the cache

  Specified by:
    `cacheMissImage` in interface `ImageCacheListener`
  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

    public Map getImageCacheHitMap()

  Returns a Map<ImageKey, Integer> with the number of cache hits.

  Returns:
    a Map<ImageKey, Integer> with the number of cache hits

### getImageCacheMissMap

    public Map getImageCacheMissMap()

  Returns a Map<ImageKey, Integer> with the number of cache misses.

  Returns:
    a Map<ImageKey, Integer> with the number of cache misses

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| xmlgraphics-commons 2.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright 1999-2016 The Apache Software Foundation. All Rights Reserved.