|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectiitb.con.caching.MRUCache<K>
public class MRUCache<K>
MRU cache. The most recently used objects are replaced when the cache is full.
Constructor Summary | |
---|---|
MRUCache(long cacheSize)
Initializes the cache with specified size |
Method Summary | |
---|---|
void |
clear()
Clears the cache |
long |
freeSpace()
Returns the available free space |
CacheObject |
get(K key)
Returns the instance from the cache for the given instance id |
long |
getSize()
Returns the size of cache in bytes |
boolean |
put(K key,
CacheObject obj)
Places the instance into the cache |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MRUCache(long cacheSize)
cacheSize
- cache size in bytesMethod Detail |
---|
public void clear()
clear
in interface Cache<K>
public long freeSpace()
freeSpace
in interface Cache<K>
public CacheObject get(K key)
get
in interface Cache<K>
key
- key used to retrieve the object
Instance
if present in cache or else return NULLCacheObject
public long getSize()
getSize
in interface Cache<K>
public boolean put(K key, CacheObject obj)
put
in interface Cache<K>
key
- key used to place the cache objectobj
- CacheObject
CacheObject
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |