| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clear the cache.
|
CacheObject |
find(int pos)
Get an element from the cache if it is available.
|
CacheObject |
get(int pos)
Get an element in the cache if it is available.
|
ArrayList<CacheObject> |
getAllChanged()
Get all objects in the cache that have been changed.
|
static Cache |
getCache(CacheWriter writer,
String cacheType,
int cacheSize)
Create a cache of the given type and size.
|
int |
getMaxMemory()
Get the maximum memory to be used.
|
int |
getMemory()
Get the used size in KB.
|
void |
put(CacheObject rec)
Add an element to the cache.
|
boolean |
remove(int pos)
Remove an object from the cache.
|
void |
setMaxMemory(int maxKb)
Set the maximum memory to be used by this cache.
|
CacheObject |
update(int pos,
CacheObject rec)
Update an element in the cache.
|
public static Cache getCache(CacheWriter writer, String cacheType, int cacheSize)
writer - the cache writercacheType - the cache typecacheSize - the sizepublic void clear()
Cachepublic void put(CacheObject rec)
Cachepublic CacheObject update(int pos, CacheObject rec)
Cachepublic boolean remove(int pos)
Cachepublic CacheObject find(int pos)
Cachepublic CacheObject get(int pos)
Cachepublic ArrayList<CacheObject> getAllChanged()
CachegetAllChanged in interface Cachepublic void setMaxMemory(int maxKb)
CachesetMaxMemory in interface CachemaxKb - the maximum size in KBpublic int getMaxMemory()
CachegetMaxMemory in interface CacheCopyright © 2012 JBoss by Red Hat. All Rights Reserved.