Class TransitiveClosureNode
java.lang.Object
tools.refinery.interpreter.rete.network.BaseNode
tools.refinery.interpreter.rete.network.StandardNode
tools.refinery.interpreter.rete.single.SingleInputNode
tools.refinery.interpreter.rete.single.TransitiveClosureNode
- All Implemented Interfaces:
Clearable
,ITcObserver<Object>
,NetworkStructureChangeSensitiveNode
,Node
,Receiver
,ReinitializedNode
,Supplier
,Tunnel
public class TransitiveClosureNode
extends SingleInputNode
implements Clearable, ITcObserver<Object>, NetworkStructureChangeSensitiveNode, ReinitializedNode
This class represents a transitive closure node in the Rete net.
This node must not be used in recursive CommunicationGroup
s.
-
Field Summary
Fields inherited from class tools.refinery.interpreter.rete.single.SingleInputNode
mailbox, parent
Fields inherited from class tools.refinery.interpreter.rete.network.StandardNode
childMailboxes, children
Fields inherited from class tools.refinery.interpreter.rete.network.BaseNode
nodeId, reteContainer, tag, traceInfos
-
Constructor Summary
ConstructorsConstructorDescriptionTransitiveClosureNode
(ReteContainer reteContainer) Create a new transitive closure rete node. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
void
At the time of the invocation, the dependency graph has already been updated.void
pullInto
(Collection<Tuple> collector, boolean flush) Pulls the contents of this object in this particular moment into a target collection.void
pullIntoWithTimeline
(Map<Tuple, Timeline<Timestamp>> collector, boolean flush) void
reinitializeWith
(Collection<Tuple> tuples) Initializes the graph data source with the given collection of tuples.void
tupleDeleted
(Object source, Object target) Used to notify when a tuple is deleted from the transitive closure relation.void
tupleInserted
(Object source, Object target) Used to notify when a tuple is inserted into the transitive closure relation.void
Updates the receiver with a newly found or lost partial matching.Methods inherited from class tools.refinery.interpreter.rete.single.SingleInputNode
appendParent, assignTraceInfo, getCommunicationTracker, getMailbox, getParents, instantiateMailbox, propagatePullInto, propagatePullIntoWithTimestamp, removeParent
Methods inherited from class tools.refinery.interpreter.rete.network.StandardNode
appendChild, constructIndex, getChildMailboxes, getPulledContents, getReceivers, issueError, propagateUpdate, removeChild
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, assignTraceInfo, getCommunicationTracker, getContainer, getNodeId, getTag, getTraceInfos, setTag
Methods inherited from interface tools.refinery.interpreter.rete.network.Receiver
batchUpdate
Methods inherited from interface tools.refinery.interpreter.rete.network.Supplier
appendChild, constructIndex, getPulledContents, getPulledContents, getReceivers, removeChild
-
Constructor Details
-
TransitiveClosureNode
Create a new transitive closure rete node. Client may optionally callreinitializeWith(Collection)
before using the node, instead of inserting the initial set of tuples one by one.- Parameters:
reteContainer
- the rete container of the node
-
-
Method Details
-
networkStructureChanged
public void networkStructureChanged()Description copied from interface:NetworkStructureChangeSensitiveNode
At the time of the invocation, the dependency graph has already been updated.- Specified by:
networkStructureChanged
in interfaceNetworkStructureChangeSensitiveNode
- Overrides:
networkStructureChanged
in classStandardNode
-
reinitializeWith
Initializes the graph data source with the given collection of tuples.- Specified by:
reinitializeWith
in interfaceReinitializedNode
- Parameters:
tuples
- the initial collection of tuples
-
pullInto
Description copied from interface:Supplier
Pulls the contents of this object in this particular moment into a target collection. -
pullIntoWithTimeline
- Specified by:
pullIntoWithTimeline
in interfaceSupplier
-
update
Description copied from interface:Receiver
Updates the receiver with a newly found or lost partial matching. -
clear
public void clear() -
tupleInserted
Description copied from interface:ITcObserver
Used to notify when a tuple is inserted into the transitive closure relation.- Specified by:
tupleInserted
in interfaceITcObserver<Object>
- Parameters:
source
- the source of the tupletarget
- the target of the tuple
-
tupleDeleted
Description copied from interface:ITcObserver
Used to notify when a tuple is deleted from the transitive closure relation.- Specified by:
tupleDeleted
in interfaceITcObserver<Object>
- Parameters:
source
- the source of the tupletarget
- the target of the tuple
-