Class ExternalInputEnumeratorNode
- 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.boundary.ExternalInputEnumeratorNode
-
- All Implemented Interfaces:
IQueryRuntimeContextListener
,Disconnectable
,NetworkStructureChangeSensitiveNode
,Node
,Receiver
,Supplier
public class ExternalInputEnumeratorNode extends StandardNode implements Disconnectable, Receiver, IQueryRuntimeContextListener
An input node representing an enumerable extensional input relation and receiving external updates.Contains those tuples that are in the extensional relation identified by the input key, and also conform to the global seed (if any).
-
-
Field Summary
Fields Modifier and Type Field Description protected Mailbox
mailbox
-
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 ExternalInputEnumeratorNode(ReteContainer reteContainer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
appendParent(Supplier supplier)
appends a parent that will continuously send insert and revoke updates to this suppliervoid
connectThroughContext(ReteEngine engine, IInputKey inputKey, Tuple globalSeed)
void
disconnect()
Disconnects this rete engine component from the underlying model.Tuple
getGlobalSeed()
IInputKey
getInputKey()
Mailbox
getMailbox()
Returns theMailbox
of this receiver.java.util.Collection<Supplier>
getParents()
access active parentprotected java.lang.Iterable<Tuple>
getTuplesInternal()
protected Mailbox
instantiateMailbox()
Instantiates theMailbox
of this receiver.void
pullInto(java.util.Collection<Tuple> collector, boolean flush)
Pulls the contents of this object in this particular moment into a target collection.void
pullIntoWithTimeline(java.util.Map<Tuple,Timeline<Timestamp>> collector, boolean flush)
void
removeParent(Supplier supplier)
removes a parentvoid
update(IInputKey key, Tuple update, boolean isInsertion)
The given tuple was inserted into or removed from the input relation indicated by the given key.void
update(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.network.StandardNode
appendChild, constructIndex, getChildMailboxes, getPulledContents, getReceivers, issueError, networkStructureChanged, propagateUpdate, removeChild
-
Methods inherited from class org.eclipse.viatra.query.runtime.rete.network.BaseNode
acceptPropagatedTraceInfo, assignTraceInfo, 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
getPulledContents
-
-
-
-
Field Detail
-
mailbox
protected final Mailbox mailbox
- Since:
- 1.6
-
-
Constructor Detail
-
ExternalInputEnumeratorNode
public ExternalInputEnumeratorNode(ReteContainer reteContainer)
-
-
Method Detail
-
instantiateMailbox
protected Mailbox instantiateMailbox()
Instantiates theMailbox
of this receiver. Subclasses may override this method to provide their own mailbox implementation.- Returns:
- the mailbox
- Since:
- 2.0
-
getMailbox
public Mailbox getMailbox()
Description copied from interface:Receiver
Returns theMailbox
of this receiver.- Specified by:
getMailbox
in interfaceReceiver
- Returns:
- the mailbox
-
connectThroughContext
public void connectThroughContext(ReteEngine engine, IInputKey inputKey, Tuple globalSeed)
-
disconnect
public void disconnect()
Description copied from interface:Disconnectable
Disconnects this rete engine component from the underlying model. Disconnecting enables the garbage collection mechanisms to dispose of the rete network.- Specified by:
disconnect
in interfaceDisconnectable
-
getTuplesInternal
protected java.lang.Iterable<Tuple> getTuplesInternal()
- Since:
- 2.2
-
pullInto
public void pullInto(java.util.Collection<Tuple> collector, boolean flush)
Description copied from interface:Supplier
Pulls 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:
pullIntoWithTimeline
in interfaceSupplier
-
update
public void update(IInputKey key, Tuple update, boolean isInsertion)
Description copied from interface:IQueryRuntimeContextListener
The given tuple was inserted into or removed from the input relation indicated by the given key.- Specified by:
update
in interfaceIQueryRuntimeContextListener
- Parameters:
key
- the key identifying the input relation that was updatedupdate
- the tuple that was inserted or removedisInsertion
- true if it was an insertion, false otherwise.
-
update
public void update(Direction direction, Tuple updateElement, Timestamp timestamp)
Description copied from interface:Receiver
Updates the receiver with a newly found or lost partial matching.
-
appendParent
public void appendParent(Supplier supplier)
Description copied from interface:Receiver
appends a parent that will continuously send insert and revoke updates to this supplier- Specified by:
appendParent
in interfaceReceiver
-
removeParent
public void removeParent(Supplier supplier)
Description copied from interface:Receiver
removes a parent- Specified by:
removeParent
in interfaceReceiver
-
getParents
public java.util.Collection<Supplier> getParents()
Description copied from interface:Receiver
access active parent- Specified by:
getParents
in interfaceReceiver
-
getInputKey
public IInputKey getInputKey()
-
getGlobalSeed
public Tuple getGlobalSeed()
-
-