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, parent
Fields inherited from class tools.refinery.interpreter.rete.network.BaseNode
nodeId, reteContainer, tag, traceInfos
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
abstract MatchType
statelessConvert
(Tuple tuple) boolean
statelessFilter
(Tuple tuple) Override this method to provide a lightweight, stateless filter on the tuplesvoid
Updates 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, removeParent
Methods inherited from class tools.refinery.interpreter.rete.network.BaseNode
acceptPropagatedTraceInfo, getContainer, getNodeId, getTag, getTraceInfoPatternsEnumerated, getTraceInfos, setTag, toString, toStringCore
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface tools.refinery.interpreter.rete.network.Node
acceptPropagatedTraceInfo, getCommunicationTracker, getContainer, getNodeId, getTag, getTraceInfos, setTag
Methods 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:Receiver
Updates the receiver with a newly found or lost partial matching. -
clear
public void clear()
-