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 class
AgingCache.AgingCacheEntry<U extends T>
A cache entry for Aging caches.protected class
AgingCache.AgingNullCacheEntry<U extends T>
A null cache entry for Aging caches. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.deltava.util.cache.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:
addNullEntry
in classCache<T extends Cacheable>
- Parameters:
key
- the entry key
-
get
-