|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object grinda.common.HashedCache
public class HashedCache
A simple cache that contains object. Each new object has a counter associated with it that is used to check if the object can really be deleted. It simply take trace of the other object interested in it like a garbage collector does.
Constructor Summary | |
---|---|
HashedCache()
|
Method Summary | |
---|---|
java.lang.Object |
get(java.lang.Object key)
Retrives an object using its key and increasing its reference counter |
java.lang.Object |
getRegistered(java.lang.Object key)
|
void |
put(java.lang.Object key,
java.lang.Object value)
Puts a new object in the cache. |
java.lang.Object |
remove(java.lang.Object key)
Removes an object from the cache. |
int |
size()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HashedCache()
Method Detail |
---|
public void put(java.lang.Object key, java.lang.Object value)
key
- the key for the objectvalue
- its valuepublic java.lang.Object get(java.lang.Object key)
key
-
public java.lang.Object getRegistered(java.lang.Object key)
public java.lang.Object remove(java.lang.Object key)
key
-
public int size()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |