Class TransitiveClosureNode
- java.lang.Object
-
- org.eclipse.viatra.query.runtime.rete.network.BaseNode
-
- org.eclipse.viatra.query.runtime.rete.network.StandardNode
-
- org.eclipse.viatra.query.runtime.rete.single.SingleInputNode
-
- org.eclipse.viatra.query.runtime.rete.single.TransitiveClosureNode
-
- All Implemented Interfaces:
ITcObserver<java.lang.Object>,Clearable,NetworkStructureChangeSensitiveNode,Node,Receiver,Supplier,Tunnel
public class TransitiveClosureNode extends SingleInputNode implements Clearable, ITcObserver<java.lang.Object>, NetworkStructureChangeSensitiveNode
This class represents a transitive closure node in the Rete net.This node must not be used in recursive
CommunicationGroups.
-
-
Field Summary
-
Fields inherited from class org.eclipse.viatra.query.runtime.rete.single.SingleInputNode
mailbox, parent
-
Fields inherited from class org.eclipse.viatra.query.runtime.rete.network.StandardNode
childMailboxes, children
-
Fields inherited from class org.eclipse.viatra.query.runtime.rete.network.BaseNode
nodeId, reteContainer, tag, traceInfos
-
-
Constructor Summary
Constructors Constructor Description TransitiveClosureNode(ReteContainer reteContainer)Create a new transitive closure rete node.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clear all partial matchings stored in memoryvoidnetworkStructureChanged()At the time of the invocation, the dependency graph has already been updated.voidpullInto(java.util.Collection<Tuple> collector, boolean flush)Pulls the contents of this object in this particular moment into a target collection.voidpullIntoWithTimeline(java.util.Map<Tuple,Timeline<Timestamp>> collector, boolean flush)voidreinitializeWith(java.util.Collection<Tuple> tuples)Initializes the graph data source with the given collection of tuples.voidtupleDeleted(java.lang.Object source, java.lang.Object target)Used to notify when a tuple is deleted from the transitive closure relation.voidtupleInserted(java.lang.Object source, java.lang.Object target)Used to notify when a tuple is inserted into the transitive closure relation.voidupdate(Direction direction, Tuple updateElement, Timestamp timestamp)Updates the receiver with a newly found or lost partial matching.-
Methods inherited from class org.eclipse.viatra.query.runtime.rete.single.SingleInputNode
appendParent, assignTraceInfo, getCommunicationTracker, getMailbox, getParents, instantiateMailbox, propagatePullInto, propagatePullIntoWithTimestamp, removeParent
-
Methods inherited from class org.eclipse.viatra.query.runtime.rete.network.StandardNode
appendChild, constructIndex, getChildMailboxes, getPulledContents, getReceivers, issueError, propagateUpdate, removeChild
-
Methods inherited from class org.eclipse.viatra.query.runtime.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 org.eclipse.viatra.query.runtime.rete.network.Node
acceptPropagatedTraceInfo, assignTraceInfo, getCommunicationTracker, getContainer, getNodeId, getTag, getTraceInfos, setTag
-
Methods inherited from interface org.eclipse.viatra.query.runtime.rete.network.Receiver
batchUpdate
-
Methods inherited from interface org.eclipse.viatra.query.runtime.rete.network.Supplier
appendChild, constructIndex, getPulledContents, getPulledContents, getReceivers, removeChild
-
-
-
-
Constructor Detail
-
TransitiveClosureNode
public TransitiveClosureNode(ReteContainer reteContainer)
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 Detail
-
networkStructureChanged
public void networkStructureChanged()
Description copied from interface:NetworkStructureChangeSensitiveNodeAt the time of the invocation, the dependency graph has already been updated.- Specified by:
networkStructureChangedin interfaceNetworkStructureChangeSensitiveNode- Overrides:
networkStructureChangedin classStandardNode
-
reinitializeWith
public void reinitializeWith(java.util.Collection<Tuple> tuples)
Initializes the graph data source with the given collection of tuples.- Parameters:
tuples- the initial collection of tuples
-
pullInto
public void pullInto(java.util.Collection<Tuple> collector, boolean flush)
Description copied from interface:SupplierPulls the contents of this object in this particular moment into a target collection.
-
pullIntoWithTimeline
public void pullIntoWithTimeline(java.util.Map<Tuple,Timeline<Timestamp>> collector, boolean flush)
- Specified by:
pullIntoWithTimelinein interfaceSupplier
-
update
public void update(Direction direction, Tuple updateElement, Timestamp timestamp)
Description copied from interface:ReceiverUpdates the receiver with a newly found or lost partial matching.
-
clear
public void clear()
Description copied from interface:ClearableClear all partial matchings stored in memory
-
tupleInserted
public void tupleInserted(java.lang.Object source, java.lang.Object target)Description copied from interface:ITcObserverUsed to notify when a tuple is inserted into the transitive closure relation.- Specified by:
tupleInsertedin interfaceITcObserver<java.lang.Object>- Parameters:
source- the source of the tupletarget- the target of the tuple
-
tupleDeleted
public void tupleDeleted(java.lang.Object source, java.lang.Object target)Description copied from interface:ITcObserverUsed to notify when a tuple is deleted from the transitive closure relation.- Specified by:
tupleDeletedin interfaceITcObserver<java.lang.Object>- Parameters:
source- the source of the tupletarget- the target of the tuple
-
-