|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectorg.melati.poem.util.CachedIndexFactory
public abstract class CachedIndexFactory
Supply and cache objects identified by a numeric index.
Subtypes define how the object for a given index is obtained, and hence the mapping of indexes to objects used in the caller.
The name is a touch misleading - the objects returned are not (necessarily) indexes.
null object references can be cached and returned.
Individual elements can be removed from the cache or all elements may be removed.
| Constructor Summary | |
|---|---|
CachedIndexFactory()
|
|
| Method Summary | |
|---|---|
Object |
get(int index)
Get either from cache or, failing that, really get it. |
void |
invalidate()
Invalidate whole cache. |
void |
invalidate(int index)
Invalidate an entry in the cache. |
protected abstract Object |
reallyGet(int index)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CachedIndexFactory()
| Method Detail |
|---|
protected abstract Object reallyGet(int index)
index - of the item, possibly a troid
public Object get(int index)
get in interface IndexFactoryindex - the index
IndexFactory.get(int)public void invalidate(int index)
index - the entry's index to invalidatepublic void invalidate()
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||