|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectiitb.con.caching.LRUCache<K>
public class LRUCache<K>
LRU cache. The least recently used objects are replaced when the cache is full.
Field Summary | |
---|---|
int |
MAX_ENTRIES
Maximum entries in the cache |
Constructor Summary | |
---|---|
LRUCache()
|
|
LRUCache(int maxEntries)
|
Method Summary | |
---|---|
void |
clear()
Clears the cache |
long |
freeSpace()
Returns the available free space |
CacheObject |
get(K key)
Returns the cached object for the given key |
long |
getSize()
Returns the size of cache in bytes |
boolean |
put(K key,
CacheObject object)
Places the cache object in the cache using the key |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int MAX_ENTRIES
Constructor Detail |
---|
public LRUCache()
public LRUCache(int maxEntries)
Method 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
CacheObject
public long getSize()
getSize
in interface Cache<K>
public boolean put(K key, CacheObject object)
put
in interface Cache<K>
key
- key used to place the objectobject
- cache object
CacheObject
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |