java.lang.Object
de.grogra.xl.impl.base.Producer
- Direct Known Subclasses:
DOMProducer
,RGGProducer
,SimpleProducer
This class is an abstract base implementation of
Producer
.
It uses subclasses of GraphQueue
to represent the queues which
store deferred actions of XL.- Author:
- Ole Kniemeyer
-
Field Summary
Fields inherited from interface de.grogra.xl.query.Producer
DOUBLE_ARROW, EXECUTION_ARROW, SIMPLE_ARROW
-
Constructor Summary
ModifierConstructorDescriptionprotected
Producer
(RuntimeModel model) protected
Producer
(QueryState match) -
Method Summary
Modifier and TypeMethodDescriptionprotected final void
addEdgeImpl
(Object first, Object second, int bits, EdgeDirection direction) protected void
addNodeImpl
(Object node, boolean addEdge) protected void
addNodeImplMS
(Object node, boolean addEdge) <N,
P> void Adds an action to the connecting queueq
(GraphQueue.CONNECT_DESCRIPTOR
) which induces the invocationc.connect(s, t, param, q)
on queue application.void
void
copyIncoming
(Object s, Object t, int edges) void
copyOutgoing
(Object s, Object t, int edges) void
cut()
void
getFirstLastScale
(int index) getFirstLastScale
(Object node) Returns an existing FirstLastScale for the scale of the input nodeprotected Object
protected QueryState
Returns the match for which this producer constructs the replacement.<Q extends Queue>
QgetQueue
(QueueDescriptor<Q> descr) void
void
moveIncoming
(Object s, Object t, int edges) void
moveOutgoing
(Object s, Object t, int edges) protected void
protected void
popImpl()
boolean
producer$beginExecution
(int arrow) This method is invoked by the XL run-time system in order to notify the producer about the beginning of a right-hand side (i.e., a match for the left-hand side has been found, and the right-hand side is executed).void
producer$endExecution
(boolean applied) This method is invoked by the XL run-time system in order to notify the producer about the end of the execution of a right-hand side.Returns the graph for which this producer constructs the right-hand side structur.void
producer$visitEdge
(EdgePattern pattern) protected void
pushImpl()
protected void
void
setConnectionEdges
(int edges) void
setInConnectionEdges
(int edges) void
setOutConnectionEdges
(int edges) void
useOperators
(boolean value)
-
Field Details
-
addNodeQueue
-
deleteNodeQueue
-
deleteEdgeQueue
-
-
Constructor Details
-
Producer
-
Producer
-
-
Method Details
-
getQueryState
Returns the match for which this producer constructs the replacement. The returned instance is the same as the one in the factory methodGraph.createProducer(de.grogra.xl.query.QueryState)
which created this producer.- Returns:
- the match for which this producer constructs a replacement
-
producer$getGraph
Description copied from interface:Producer
Returns the graph for which this producer constructs the right-hand side structur.- Specified by:
producer$getGraph
in interfaceProducer
- Returns:
- the graph on which this producer operates
-
producer$beginExecution
public boolean producer$beginExecution(int arrow) Description copied from interface:Producer
This method is invoked by the XL run-time system in order to notify the producer about the beginning of a right-hand side (i.e., a match for the left-hand side has been found, and the right-hand side is executed).- Specified by:
producer$beginExecution
in interfaceProducer
- Parameters:
arrow
- the type of rule arrow, one ofProducer.SIMPLE_ARROW
,Producer.DOUBLE_ARROW
,Producer.EXECUTION_ARROW
- Returns:
true
if the right-hand side shall be executed,false
if its execution shall be skipped
-
producer$endExecution
public void producer$endExecution(boolean applied) Description copied from interface:Producer
This method is invoked by the XL run-time system in order to notify the producer about the end of the execution of a right-hand side.- Specified by:
producer$endExecution
in interfaceProducer
- Parameters:
applied
- return value of invocation ofProducer.producer$beginExecution(int)
-
producer$cliqueBegin
-
producer$cliqueEnd
-
pushImpl
protected void pushImpl() -
popImpl
protected void popImpl() -
separateImpl
protected void separateImpl() -
nodeUsed
-
addNodeImpl
-
addNodeImplMS
-
getPreviousNode
-
addEdgeImpl
-
producer$visitEdge
- Specified by:
producer$visitEdge
in interfaceProducer
-
copyIncoming
-
copyOutgoing
-
moveIncoming
-
moveOutgoing
-
connect
Adds an action to the connecting queueq
(GraphQueue.CONNECT_DESCRIPTOR
) which induces the invocationc.connect(s, t, param, q)
on queue application.- Parameters:
s
- node of the match for the left hand side of the rulet
- replacing node of the right hand side of the ruleparam
- some parameter for the connectorc
- a connector
-
execute
-
setConnectionEdges
public void setConnectionEdges(int edges) -
setInConnectionEdges
public void setInConnectionEdges(int edges) -
setOutConnectionEdges
public void setOutConnectionEdges(int edges) -
cut
public void cut() -
useOperators
public void useOperators(boolean value) -
interpretive
public void interpretive() -
consume
-
getQueues
-
getQueue
-
getFirstLastScale
-
getFirstLastScale
Returns an existing FirstLastScale for the scale of the input node- Parameters:
node
-- Returns:
- FirstLastScale that has scale of input node, null if no FirstLastScale at scale of input node
-