|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.oroad.stxx.cache.SimpleCacheImpl
Basic implementation an LRU cache.
Constructor Summary | |
SimpleCacheImpl()
Creates the cache |
Method Summary | |
void |
addCacheable(Cacheable cacheable)
Adds an object to the cache |
void |
clear()
Clears the cache of all cacheables |
void |
expire()
Removes all the expired objects from the cache |
Cacheable |
getCacheable(java.lang.Object identifier)
Gets a cached object |
java.lang.String |
getName()
Gets the name of the cache |
int |
getSize()
Gets the maximum number of objects it can cache |
void |
removeCacheable(java.lang.Object identifier)
Removes a cached object |
void |
setName(java.lang.String name)
Sets the name of the cache |
void |
setSize(int size)
Sets the maximum number of objects it will cache |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SimpleCacheImpl()
Method Detail |
public java.lang.String getName()
getName
in interface Cache
public void setName(java.lang.String name)
setName
in interface Cache
name
- The namepublic int getSize()
getSize
in interface Cache
public void setSize(int size)
setSize
in interface Cache
size
- The size of the cachepublic void removeCacheable(java.lang.Object identifier)
removeCacheable
in interface Cache
identifier
- The key of the object to removepublic Cacheable getCacheable(java.lang.Object identifier)
getCacheable
in interface Cache
identifier
- The key to find the object
public void expire()
expire
in interface Cache
public void addCacheable(Cacheable cacheable)
addCacheable
in interface Cache
cacheable
- The object to addpublic void clear()
clear
in interface Cache
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |