java.lang.Object
de.grogra.xl.impl.base.Graph
de.grogra.xl.impl.base.GraphImpl
de.grogra.xl.impl.simple.Graph
-
Nested Class Summary
Nested classes/interfaces inherited from class de.grogra.xl.impl.base.Graph
Graph.QState, Graph.ThreadData
-
Field Summary
Fields inherited from class de.grogra.xl.impl.base.Graph
EXCLUDE_DELETED_FLAG, INTERPRETIVE_FLAG, MODE_MASK, PARALLEL_MODE, PARALLEL_NON_DETERMINISTIC_MODE, SEQUENTIAL_MODE, SEQUENTIAL_NON_DETERMINISTIC_MODE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addEdgeBits
(Object source, Object target, int bits) Adds a set of edge bits from asource
node to atarget
node.void
Adds a node to this graph extent.protected void
boolean
canEnumerateEdges
(EdgeDirection dir, boolean constEdge, Serializable edge) protected void
createProducer
(QueryState match) Creates an instance ofProducer
.void
enumerateNodes
(Type type, QueryState qs, int index, MatchConsumer consumer, int arg) This methods enumerates all nodes of this graph of the given type to the givenMatchConsumer
via the given query state.getRoot()
Returns the root node of this graph.Returns the root node of the type graph for this graphvoid
removeEdgeBits
(Object source, Object target, int bits) Removes a set of edge bits from asource
node to atarget
node.void
removeNode
(Object node) int
size()
Methods inherited from class de.grogra.xl.impl.base.GraphImpl
createInterpretiveMark, createQueue
Methods inherited from class de.grogra.xl.impl.base.Graph
allowNoninjectiveMatchesByDefault, allowNoninjectiveMatchesForNextQuery, areComparableScales, canEnumerateNodes, createMatcher, createQueryState, createThreadData, derive, enumerateEdges, enumerateSpaces, getDerivationMode, getMinimumEncoarseDepthDiff, getModel, getPredecessor, getQueues, getScaleValue, getThreadData, getTypeNode, getTypeNode, isInTypeGraph, isSameScale, setDerivationMode, sortedTypeGraph
-
Constructor Details
-
Graph
-
-
Method Details
-
size
public int size() -
canEnumerateEdges
-
beginModifications
protected void beginModifications()- Specified by:
beginModifications
in classGraph
-
commitModifications
protected void commitModifications()- Specified by:
commitModifications
in classGraph
-
enumerateNodes
Description copied from interface:Graph
This methods enumerates all nodes of this graph of the given type to the givenMatchConsumer
via the given query state. I.e., for every nodec
of this extent that has typetype
, the following statement is executed:qs.amatch (tp, c, consumer, arg);
- Parameters:
type
- the type of nodesqs
- the query state on which theamatch
-method has to be invokedindex
- the index-parameter for theamatch
-methodconsumer
- the consumer-parameter for theamatch
-methodarg
- the arg-parameter for theamatch
-method
-
getRoot
Description copied from interface:Graph
Returns the root node of this graph.- Returns:
- the root
-
getTypeRoot
Description copied from interface:Graph
Returns the root node of the type graph for this graph- Returns:
- the root of the type graph
-
addNode
Description copied from class:GraphImpl
Adds a node to this graph extent. This method is invoked by the XL runtime system before invocations ofGraphImpl.addEdgeBits(java.lang.Object, java.lang.Object, int)
. Implementations may perform tasks in preparation of the addition of edges, if necessary. -
removeNode
- Overrides:
removeNode
in classGraphImpl
-
addEdgeBits
Description copied from class:GraphImpl
Adds a set of edge bits from asource
node to atarget
node. This method is invoked within the right hand sides of XL productions==>>
,==>
.- Specified by:
addEdgeBits
in classGraphImpl
- Parameters:
source
- the source node of the edgetarget
- the target node of the edgebits
- the edge bits that are to be added
-
removeEdgeBits
Description copied from class:GraphImpl
Removes a set of edge bits from asource
node to atarget
node. This method is invoked within the right hand sides of XL productions==>>
,==>
.- Specified by:
removeEdgeBits
in classGraphImpl
- Parameters:
source
- the source node of the edgetarget
- the target node of the edgebits
- the edge bits that are to be removed
-
createProducer
Description copied from interface:Graph
Creates an instance ofProducer
. This factory method creates an instance of a subclass ofProducer
which will be exclusively used later on in the context of the current match represented byqs
. The instance must be an instance of the class returned byCompiletimeModel.getProducerType()
for the corresponding compile-time model.The usage of producers is specified by the XL programming language.
- Parameters:
match
- query state which holds current match for which the producer shall produce a replacement- Returns:
- a producer for use in the context of
qs
-