|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.Dictionary
java.util.Hashtable
org.mmbase.util.LRUHashtable
org.mmbase.cache.Cache
A base class for all Caches. Extend this class for other caches.
| Nested Class Summary |
| Nested classes inherited from class org.mmbase.util.LRUHashtable |
LRUHashtable.LRUEntry, LRUHashtable.LRUEntrySet, LRUHashtable.LRUEntrySetIterator |
| Field Summary | |
protected int |
maxEntrySize
|
| Constructor Summary | |
Cache(int size)
|
|
| Method Summary | |
java.lang.Object |
get(java.lang.Object key)
Like 'get' of LRUHashtable but considers if the cache is active or not. |
int |
getByteSize()
Determins the byte-size of this object |
int |
getByteSize(SizeOf sizeof)
Determins the byte-size of this object using the given SizeOf instance. |
static Cache |
getCache(java.lang.String name)
Returns the Cache with a certain name. |
static java.util.Set |
getCaches()
Returns the names of all caches. |
protected int |
getDefaultMaxEntrySize()
This has to be overridden by Caches which support max entry size. |
java.lang.String |
getDescription()
Gives a description for this cache type. |
int |
getMaxEntrySize()
Return the maximum entry size for the cache in bytes. |
java.lang.String |
getName()
Returns a name for this cache type. |
static int |
getTotalByteSize()
|
boolean |
isActive()
Wether this cache is active or not. |
static void |
main(java.lang.String[] args)
|
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Like 'put' of LRUHashtable but considers if the cache is active or not. |
Cache |
putCache()
Puts this cache in the caches repository. |
protected static Cache |
putCache(Cache cache)
Puts a cache in the caches repository. |
void |
setActive(boolean a)
Sets this cache to active or passive. |
| Methods inherited from class org.mmbase.util.LRUHashtable |
clear, clone, elements, entrySet, getCount, getHits, getMisses, getOrderedElements, getOrderedElements, getOrderedEntries, getOrderedEntries, getPuts, getRatio, getSize, getStats, keySet, remove, setSize, size, toString, toString, values |
| Methods inherited from class java.util.Hashtable |
contains, containsKey, containsValue, equals, hashCode, isEmpty, keys, putAll, rehash |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected int maxEntrySize
| Constructor Detail |
public Cache(int size)
| Method Detail |
public java.lang.String getName()
public java.lang.String getDescription()
public int getMaxEntrySize()
protected int getDefaultMaxEntrySize()
protected static Cache putCache(Cache cache)
public Cache putCache()
public static Cache getCache(java.lang.String name)
getCaches()public static java.util.Set getCaches()
public java.lang.Object get(java.lang.Object key)
get in interface java.util.Mapget in class LRUHashtablekey - the key of the element
null if it could not be found
public java.lang.Object put(java.lang.Object key,
java.lang.Object value)
put in interface java.util.Mapput in class LRUHashtablekey - the key of the elementvalue - the value of the element
null if it could not be foundpublic void setActive(boolean a)
public final boolean isActive()
public int getByteSize()
SizeMeasurable
getByteSize in interface SizeMeasurablepublic int getByteSize(SizeOf sizeof)
SizeMeasurable
getByteSize in interface SizeMeasurablepublic static int getTotalByteSize()
public static void main(java.lang.String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||