public class LruCache extends Object
throwCount
.
This LRU cache implementation is thread-safe.Constructor and Description |
---|
LruCache() |
Modifier and Type | Method and Description |
---|---|
void |
addObject(Object id,
Object object) |
void |
addObject(Object id,
Object object,
long expireTime) |
void |
flushCache()
This method will flush all objects from the cache.
|
int |
getMaxSize()
Get the max number of cached objects
|
Object |
getObject(Object id)
Get an object from the cache.
|
int |
getSize() |
int |
getThrowCount() |
void |
setMaxSize(int maxSize)
Set the max number of cached objects
|
void |
setThrowCount(int throwCount) |
protected void |
throwOutCachedItems() |
String |
toString() |
public int getMaxSize()
public void setMaxSize(int maxSize)
maxSize
- the max number of cached objectspublic void setThrowCount(int throwCount)
throwCount
- public int getThrowCount()
public Object getObject(Object id)
id
- The id of the object to get.public void addObject(Object id, Object object, long expireTime)
object
- expireTime
- public int getSize()
public void flushCache()
protected void throwOutCachedItems()
© 1998- 2014 Escenic
Contact Escenic Support for bug submission or feature requests. For further API reference and developer documentation, see Technet. The Technet documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Escenic A/S, Sommerrogt. 13-15 Solli, 0255 Oslo, Norway.