|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.hammurapi.eventbus.PredicatedInferenceNode<E,P,C,K,H,S>
E - P - C - public abstract class PredicatedInferenceNode<E,P extends Comparable<P>,C,K,H extends EventBus.Handle<E,P,C>,S extends EventStore<E,P,C,H,S>>
| Field Summary | |
|---|---|
protected PredicateChainingMatcher<E,P,C,K,H,S> |
matcher
|
| Constructor Summary | |
|---|---|
PredicatedInferenceNode(PredicatedInferenceNode<E,P,C,K,H,S> parent,
PredicateChainingMatcher<E,P,C,K,H,S> matcher,
|
|
| Method Summary | |
|---|---|
void |
collectHandlers(Map<C,Map<
Collects handlers synchronously. |
void |
collectHandlers(Map<C,Map<
Collects handlers asynchronously. |
protected abstract Callable<Collection<EventHandlerWrapper<E,P,C,K,H,S>>> |
createCollectorTask(Map<C,Map<
|
Collection<EventHandlerWrapper<E,P,C,K,H,S>> |
getAllHandlers()
This method is used when this node is moved under another node. |
C |
getContext()
|
protected abstract List<PredicatedInferenceNode<E,P,C,K,H,S>> |
getFalseChildren()
|
protected abstract List<EventHandlerWrapper<E,P,C,K,H,S>> |
getFalseHandlers()
|
K |
getId()
|
protected PredicateChainingMatcher<E,P,C,K,H,S> |
getMatcher()
|
|
getPredicate()
|
protected abstract List<PredicatedInferenceNode<E,P,C,K,H,S>> |
getTrueChildren()
|
protected abstract List<EventHandlerWrapper<E,P,C,K,H,S>> |
getTrueHandlers()
|
boolean |
isRoot()
|
void |
rebuild()
Rebuilds inference network. |
boolean |
remove(List<PredicatedInferenceNode<E,P,C,K,H,S>> parentTrueChildren,
List<PredicatedInferenceNode<E,P,C,K,H,S>> parentFalseChildren,
boolean isTrueChild,
Iterable<K> keys)
Removes handler(s) specified by the key(s). |
void |
reset()
Resets state of the node and its children. |
void |
setRoot(boolean isRoot)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected PredicateChainingMatcher<E,P extends Comparable<P>,C,K,H extends EventBus.Handle<E,P,C>,S extends EventStore<E,P,C,H,S>> matcher
| Constructor Detail |
|---|
public PredicatedInferenceNode(PredicatedInferenceNode<E,P,C,K,H,S> parent,
PredicateChainingMatcher<E,P,C,K,H,S> matcher,
predicate,
C context,
K id)
| Method Detail |
|---|
protected abstract List<PredicatedInferenceNode<E,P,C,K,H,S>> getFalseChildren()
protected abstract List<PredicatedInferenceNode<E,P,C,K,H,S>> getTrueChildren()
protected abstract List<EventHandlerWrapper<E,P,C,K,H,S>> getFalseHandlers()
protected abstract List<EventHandlerWrapper<E,P,C,K,H,S>> getTrueHandlers()
protected PredicateChainingMatcher<E,P,C,K,H,S> getMatcher()
protected abstract Callable<Collection<EventHandlerWrapper<E,P,C,K,H,S>>> createCollectorTask(Map<C,Map<,? super Boolean>> cache, ExecutorService executor, AtomicReference<Collection<Future<Collection<EventHandlerWrapper<E,P,C,K,H,S>>>>> collector, E event)
public void setRoot(boolean isRoot)
public boolean isRoot()
public K getId()
publicgetPredicate()
public C getContext()
public void rebuild()
public void collectHandlers(Map<C,Map<,? super Boolean>> cache, Collection<EventHandlerWrapper<E,P,C,K,H,S>> collector, E event)
public void collectHandlers(Map<C,Map<,? super Boolean>> cache, ExecutorService executor, AtomicReference<Collection<Future<Collection<EventHandlerWrapper<E,P,C,K,H,S>>>>> collector, E event)
cache - Cache of extracted values.executor - Executor for asynchronous handler collection.collector - Collector of handlers.event - Event to match.
public boolean remove(List<PredicatedInferenceNode<E,P,C,K,H,S>> parentTrueChildren,
List<PredicatedInferenceNode<E,P,C,K,H,S>> parentFalseChildren,
boolean isTrueChild,
Iterable<K> keys)
parentTrueChildren - Parent true children list or even bus root nodes list. If a node doesn't have its own
handlers and only sub-nodes and all sub-nodes are more restrictive, it promotes the sub-nodes to the parent/root and
removes itself from the inference network. Null for the root node.parentFalseChildren - Same purpose as above. Null for the root node.isTrueChild - True if this node is a true child of parent. Always true for the root nodes.
public void reset()
public Collection<EventHandlerWrapper<E,P,C,K,H,S>> getAllHandlers()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||