|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.larvalabs.megamap.MegaMap
An efficient, unbounded map (hashtable) that can optionally persist between VM invocations. Keys are stored in memory, but values may be extremely large. They will be persisted to disk as required by the garbage collector of the VM.
| Method Summary | |
java.io.Serializable |
get(java.io.Serializable key)
Gets the value for the given key. |
java.util.Set |
getKeys()
Gets all the keys stored in the MegaMap. |
boolean |
hasKey(java.io.Serializable key)
Checks if there is a value stored in the MegaMap for the given key. |
void |
put(java.io.Serializable key,
java.io.Serializable value)
Put a value in the MegaMap. |
void |
remove(java.io.Serializable key)
Removes the value for the given key. |
void |
run()
Called by the thread that managed the MegaMap disk persistence. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public void put(java.io.Serializable key,
java.io.Serializable value)
public java.io.Serializable get(java.io.Serializable key)
throws MegaMapException
key -
MegaMapExceptionhasKey(java.io.Serializable)public void remove(java.io.Serializable key)
key - public boolean hasKey(java.io.Serializable key)
get(java.io.Serializable) as
it could be far more efficient than get(java.io.Serializable).
This is becauseget may have to load the object from disk.
key - the key to search for.
true if there is a value stored for the given key, false otherwise.public java.util.Set getKeys()
public void run()
run in interface java.lang.Runnable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||