|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.ontopia.utils.CachedDecider<T>
public class CachedDecider<T>
INTERNAL: Decider that maintains a cache of decisions made on a set of objects. It works with any implementation of DeciderIF.
The cache is first checked to see if a decision has already been made. Otherwise a new decision is evaluated and the cache is updated.
Field Summary | |
---|---|
protected java.util.Map<T,java.lang.Boolean> |
cache
|
protected DeciderIF<T> |
decider
|
Constructor Summary | |
---|---|
CachedDecider(DeciderIF<T> decider)
|
Method Summary | |
---|---|
DeciderIF<T> |
getDecider()
Gets the decider that being cached. |
boolean |
ok(T object)
PUBLIC: Returns true if the object is accepted. |
void |
refresh()
Refreshes the cache. |
void |
setDecider(DeciderIF<T> decider)
Sets the decider that is to be cached. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected DeciderIF<T> decider
protected java.util.Map<T,java.lang.Boolean> cache
Constructor Detail |
---|
public CachedDecider(DeciderIF<T> decider)
Method Detail |
---|
public DeciderIF<T> getDecider()
public void setDecider(DeciderIF<T> decider)
public boolean ok(T object)
DeciderIF
ok
in interface DeciderIF<T>
public void refresh()
CachedIF
refresh
in interface CachedIF
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |