|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Defines a reliable and efficient lookup of a persistent object instance
via its unique identifier. An IDCache works like a local hashtable of
global instance data.
It is recommended, but not required, that an IDCache implementation
provide a default no-args constructor. Other ctors may take additional
parameters to provide for size limits to be enforced during calls to
the putInstance method, or to automatically handle proactive
updates.
See
Persist.html
in the top level docs for overview information on caching.
| Method Summary | |
void |
clear()
Remove all entries from this cache. |
SandPersistMessage |
getInstance(long id)
Given a persistent ID, return the associated message instance. |
java.util.Map |
getMap()
Return the underlying map used by the cache. |
boolean |
putInstance(SandPersistMessage msg)
Given a persistent messsage, store it in the cache. |
SandPersistMessage |
removeInstance(long id)
Given a persistent ID, remove it from the cache. |
| Method Detail |
public boolean putInstance(SandPersistMessage msg)
public SandPersistMessage getInstance(long id)
public SandPersistMessage removeInstance(long id)
public void clear()
public java.util.Map getMap()
putInstance(org.sandev.basics.structs.SandPersistMessage)
and removeInstance(long) methods should be used for cache manipulation,
and this method should only be used for read-only access like iteration
over the map's contents.
If the IDCache is not backed by a map, returns null.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||