Class AgingCache<T extends Cacheable>
java.lang.Object
org.deltava.util.cache.Cache<T>
org.deltava.util.cache.AgingCache<T>
- Type Parameters:
T- the Cacheable object type
An object cache that supports creation dates. The major difference between this cache and a
ExpiringCache is
that this cache does not purge an entry until the cache overflows, whereas an ExpiringCache invalidates data
based on age.- Since:
- 1.0
- Version:
- 7.2
- Author:
- Luke
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classAgingCache.AgingCacheEntry<U extends T>A cache entry for Aging caches.protected classAgingCache.AgingNullCacheEntry<U extends T>A null cache entry for Aging caches. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class Cache
add, addAll, addNull, checkOverflow, clear, contains, getAll, getErrors, getHits, getMaxSize, getRequests, hit, isRemote, remove, request, setMaxSize, size
-
Field Details
-
_lastCreationTime
protected long _lastCreationTime
-
-
Constructor Details
-
AgingCache
public AgingCache(int maxSize) Creates a new aging cache.- Parameters:
maxSize- the maximum size of the cache- Throws:
IllegalArgumentException- if maxSize is zero or negative- See Also:
-
-
Method Details
-
addEntry
-
addNullEntry
Adds a null entry to the cache.- Specified by:
addNullEntryin classCache<T extends Cacheable>- Parameters:
key- the entry key
-
get
-