com.zwares.base.cache
Class HashCache
java.lang.Object
|
+--com.zwares.base.cache.HashCache
- public class HashCache
- extends java.lang.Object
|
Constructor Summary |
HashCache(int maxSize,
int maxObjectSize,
long maxAge)
|
HashCache(int maxSize,
int maxObjectSize,
long maxAge,
long tidyInterval)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
DEFAULT_TIDY_INTERVAL
public static final long DEFAULT_TIDY_INTERVAL
- See Also:
- Constant Field Values
_clock
protected static Clock _clock
_tidyTimer
protected static java.util.Timer _tidyTimer
_lookupLock
protected ReaderWriterLock _lookupLock
_lookup
protected java.util.Map _lookup
_ageList
protected com.zwares.base.cache.LockedLinkedList _ageList
_accessList
protected com.zwares.base.cache.LockedLinkedList _accessList
_maxSize
protected int _maxSize
_maxObjectSize
protected int _maxObjectSize
_maxAge
protected long _maxAge
_currentSize
protected int _currentSize
_cacheHits
protected long _cacheHits
_cacheMisses
protected long _cacheMisses
HashCache
public HashCache(int maxSize,
int maxObjectSize,
long maxAge)
HashCache
public HashCache(int maxSize,
int maxObjectSize,
long maxAge,
long tidyInterval)
acquireForWrite
protected void acquireForWrite()
releaseForWrite
protected void releaseForWrite()
getCurrentSize
public int getCurrentSize()
remove
public Cacheable remove(java.lang.Object key)
put
public Cacheable put(java.lang.Object key,
Cacheable object)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
get
public Cacheable get(java.lang.Object key)
cleanLongestDeath
public void cleanLongestDeath()
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object
getNumberOfCacheHits
public long getNumberOfCacheHits()
getNumberOfCacheMisses
public long getNumberOfCacheMisses()
main
public static void main(java.lang.String[] args)