org.sape.carbon.services.cache.mru
Interface MRUCache

All Superinterfaces:
Cache, FunctionalInterface, Map, Schedulable
All Known Implementing Classes:
AbstractMRUCache, MultiGetMRUCache

public interface MRUCache
extends Cache

This interface represents caches that hold a limited number of items and remove older items or items that haven't been accessed in a while to make room for new items. MRU stands for Most Recently Used and refers to the algorithm where by the item used the longest ago is the item to be removed for new items. This cache primarily acts the same as other caches, but also provides information about its hit ratio that other caches do not provide.

Since:
carbon 1.0
Version:
$Revision: 1.8 $($Author: dvoet $ / $Date: 2003/05/05 21:21:07 $)
Copyright 2002 Sapient
Author:
Greg Hinkle, January 2002

Method Summary
 Float getHitPercentage()
          The percentage of cache lookups that resulted in the item being found.
 Long getHits()
          The count of times an item was looked up and was in the cache.
 Long getMisses()
          The count of times an item was looked up and was not in the cache.
 Long getSize()
          The count of items currently in the cache.
 
Methods inherited from interface org.sape.carbon.services.cache.Cache
refreshAll
 
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from interface org.sape.carbon.services.scheduler.Schedulable
runScheduledTask
 

Method Detail

getHits

public Long getHits()
The count of times an item was looked up and was in the cache.

Returns:
the count of hits to this cache

getMisses

public Long getMisses()
The count of times an item was looked up and was not in the cache.

Returns:
the number of cache misses

getHitPercentage

public Float getHitPercentage()
The percentage of cache lookups that resulted in the item being found.

Returns:
the percentage of hits to misses

getSize

public Long getSize()
The count of items currently in the cache.

Returns:
the number of items in the cache


Copyright 1999-2003 Sapient Corporation. All Rights Reserved.