Class DeltaMonitor<MatchType>
- Direct Known Subclasses:
DefaultDeltaMonitor
Usage. If a new matching is found, it appears in the matchFoundEvents collection, and disappears when that particular matching cannot be found anymore. If the event of finding a match has been processed by the client, it can be removed manually. In this case, when a previously found matching is lost, the Tuple will appear in the matchLostEvents collection, and disappear upon finding the same matching again. "Matching lost" events can also be acknowledged by removing a Tuple from the collection. If the matching is found once again, it will return to matchFoundEvents.
Technical notes. Does NOT propagate updates! By overriding statelessConvert(), results can be stored to a MatchType. MatchType must provide equals() and hashCode() reflecting its contents. The default implementation (DefaultDeltaMonitor) uses Tuple as MatchType. By overriding statelessFilter(), some tuples can be filtered.
-
Field Summary
FieldsModifier and TypeFieldDescriptionmatches that are newly foundmatches that are newly lostFields inherited from class tools.refinery.interpreter.rete.misc.SimpleReceiver
mailbox, parentFields inherited from class tools.refinery.interpreter.rete.network.BaseNode
nodeId, reteContainer, tag, traceInfos -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()abstract MatchTypestatelessConvert(Tuple tuple) booleanstatelessFilter(Tuple tuple) Override this method to provide a lightweight, stateless filter on the tuplesvoidUpdates the receiver with a newly found or lost partial matching.Methods inherited from class tools.refinery.interpreter.rete.misc.SimpleReceiver
appendParent, assignTraceInfo, disconnectFromNetwork, getMailbox, getParents, instantiateMailbox, removeParentMethods inherited from class tools.refinery.interpreter.rete.network.BaseNode
acceptPropagatedTraceInfo, getContainer, getNodeId, getTag, getTraceInfoPatternsEnumerated, getTraceInfos, setTag, toString, toStringCoreMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface tools.refinery.interpreter.rete.network.Node
acceptPropagatedTraceInfo, getCommunicationTracker, getContainer, getNodeId, getTag, getTraceInfos, setTagMethods inherited from interface tools.refinery.interpreter.rete.network.Receiver
batchUpdate
-
Field Details
-
matchFoundEvents
matches that are newly found -
matchLostEvents
matches that are newly lost
-
-
Constructor Details
-
DeltaMonitor
- Parameters:
reteContainer-
-
-
Method Details
-
statelessFilter
Override this method to provide a lightweight, stateless filter on the tuples- Parameters:
tuple- the occurrence that is to be filtered- Returns:
- true if this tuple should be monitored, false if ignored
-
statelessConvert
-
update
Description copied from interface:ReceiverUpdates the receiver with a newly found or lost partial matching. -
clear
public void clear()
-