|
|||||||||
| Home >> All >> com >> RuntimeCollective >> [ webapps overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.RuntimeCollective.webapps
Class PermanentCache

java.lang.Objectcom.RuntimeCollective.webapps.PermanentCache
- All Implemented Interfaces:
- Cache
- public class PermanentCache
- extends java.lang.Object
- implements Cache
- extends java.lang.Object
The PermanentCache is a Cache which keeps objects forever. They never disappear from the Cache: once you put one in there, it will stay there forever. For this reason, be very careful when using it: a PermanentCache could easily end up eating all the memory. We suggest using it only for limited, set number of objects (eg for a Class which is never instantiated beyond initialization time).
- Version:
- $Id: PermanentCache.java,v 1.3 2003/09/30 15:13:04 joe Exp $
| Field Summary | |
protected java.util.HashMap |
ObjectList
The internal Hashtable of Objects |
| Constructor Summary | |
PermanentCache()
|
|
| Method Summary | |
void |
clear()
Empty the whole cache |
java.util.Iterator |
getIndexedObjects()
Get all (id, Object) couples return An Iterator of Iterators |
int |
getNoObjects()
Get the number of Objects in the cache |
java.lang.Object |
getObject(int id)
Get an object for a given key |
java.util.Iterator |
getObjects()
Get all Objects return An Iterator of Objects |
void |
removeObject(int id)
Remove an object for a given key |
void |
setObject(int id,
java.lang.Object object)
Set an object for a given key |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
ObjectList
protected java.util.HashMap ObjectList
- The internal Hashtable of Objects
| Constructor Detail |
PermanentCache
public PermanentCache()
| Method Detail |
setObject
public void setObject(int id,
java.lang.Object object)
getObject
public java.lang.Object getObject(int id)
removeObject
public void removeObject(int id)
- Remove an object for a given key
- Specified by:
removeObjectin interfaceCache
getObjects
public java.util.Iterator getObjects()
- Get all Objects
return An Iterator of Objects
- Specified by:
getObjectsin interfaceCache
getIndexedObjects
public java.util.Iterator getIndexedObjects()
- Get all (id, Object) couples
return An Iterator of Iterators
- Specified by:
getIndexedObjectsin interfaceCache
getNoObjects
public int getNoObjects()
- Get the number of Objects in the cache
- Specified by:
getNoObjectsin interfaceCache
clear
public void clear()
|
|||||||||
| Home >> All >> com >> RuntimeCollective >> [ webapps overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
com.RuntimeCollective.webapps.PermanentCache