de.grogra.rgg.model
Class RGGGraph
java.lang.Object
de.grogra.xl.impl.base.Graph
de.grogra.rgg.model.RGGGraph
- All Implemented Interfaces:
- Graph, java.lang.Cloneable
@HasModel(value=Compiletime.class)
public class RGGGraph
- extends Graph
Method Summary |
static void |
addQueues(QueueCollection qc,
ObjectList<? extends Queue> queues)
|
protected void |
beginModifications()
|
boolean |
canEnumerateEdges(EdgeDirection dir,
boolean constEdge,
java.io.Serializable edge)
|
boolean |
canEnumerateNodes(Type type)
Can nodes of the specified type be enumerated? |
protected void |
commitModifications()
|
Producer |
createProducer(QueryState match)
Creates an instance of Producer . |
GraphQueue |
createQueue(QueueCollection qc,
QueueDescriptor descr)
|
protected Graph.ThreadData |
createThreadData()
|
long |
derive()
|
void |
enumerateEdges(java.lang.Object node,
EdgeDirection dir,
Type edgeType,
QueryState qs,
int toIndex,
int patternIndex,
java.io.Serializable pattern,
int matchIndex,
MatchConsumer consumer,
int arg)
|
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 given MatchConsumer via the given query state. |
GraphManager |
getGraphManager()
|
ObjectList<GRSVertex> |
getNewGRSVertices()
|
protected java.lang.Object |
getPredecessor(java.lang.Object node)
|
java.lang.Object |
getRoot()
Returns the root node of this graph. |
static ObjectList<Queue> |
readQueues(QueueCollection qc,
java.io.DataInput in,
java.lang.ClassLoader loader)
|
void |
removeInterpretiveNodes()
|
void |
removeInterpretiveNodesOnDerivation()
|
void |
setProductionCallback(java.lang.Runnable c)
|
void |
setVisibleExtents(int indices)
|
static void |
writeQueues(ObjectList<? extends Queue> list,
java.io.DataOutput out)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
addQueues
public static void addQueues(QueueCollection qc,
ObjectList<? extends Queue> queues)
beginModifications
protected void beginModifications()
- Specified by:
beginModifications
in class Graph
canEnumerateEdges
public boolean canEnumerateEdges(EdgeDirection dir,
boolean constEdge,
java.io.Serializable edge)
canEnumerateNodes
public boolean canEnumerateNodes(Type type)
- Description copied from interface:
Graph
- Can nodes of the specified
type
be enumerated? This
method returns true
iff this graph can enumerate
nodes of the given type
using the method
Graph.enumerateNodes(de.grogra.reflect.Type, de.grogra.xl.query.QueryState, int, de.grogra.xl.query.MatchConsumer, int)
.
- Specified by:
canEnumerateNodes
in interface Graph
- Overrides:
canEnumerateNodes
in class Graph
- Parameters:
type
- the type of nodes
- Returns:
true
iff nodes of type
can be enumerated
commitModifications
protected void commitModifications()
- Specified by:
commitModifications
in class Graph
createProducer
public Producer createProducer(QueryState match)
- Description copied from interface:
Graph
- Creates an instance of
Producer
. This factory
method creates an instance of a subclass of
Producer
which will be exclusively used later on
in the context of the current match represented by
qs
. The instance must be an
instance of the class returned by
CompiletimeModel.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
createQueue
public GraphQueue createQueue(QueueCollection qc,
QueueDescriptor descr)
- Specified by:
createQueue
in class Graph
createThreadData
protected Graph.ThreadData createThreadData()
- Overrides:
createThreadData
in class Graph
derive
public long derive()
- Overrides:
derive
in class Graph
enumerateEdges
public void enumerateEdges(java.lang.Object node,
EdgeDirection dir,
Type edgeType,
QueryState qs,
int toIndex,
int patternIndex,
java.io.Serializable pattern,
int matchIndex,
MatchConsumer consumer,
int arg)
- Specified by:
enumerateEdges
in interface Graph
- Overrides:
enumerateEdges
in class Graph
enumerateNodes
public void enumerateNodes(Type type,
QueryState qs,
int index,
MatchConsumer consumer,
int arg)
- Description copied from interface:
Graph
- This methods enumerates all nodes of this graph of the given
type to the given
MatchConsumer
via the given query state.
I.e., for every
node c
of this extent that has type type
,
the following statement is executed:
qs.amatch (tp, c, consumer, arg);
- Parameters:
type
- the type of nodesqs
- the query state on which the amatch
-method has to be invokedindex
- the index-parameter for the amatch
-methodconsumer
- the consumer-parameter for the amatch
-methodarg
- the arg-parameter for the amatch
-method
getGraphManager
public GraphManager getGraphManager()
getNewGRSVertices
public ObjectList<GRSVertex> getNewGRSVertices()
getPredecessor
protected java.lang.Object getPredecessor(java.lang.Object node)
- Overrides:
getPredecessor
in class Graph
getRoot
public java.lang.Object getRoot()
- Description copied from interface:
Graph
- Returns the root node of this graph.
- Returns:
- the root
readQueues
public static ObjectList<Queue> readQueues(QueueCollection qc,
java.io.DataInput in,
java.lang.ClassLoader loader)
throws java.io.IOException
- Throws:
java.io.IOException
removeInterpretiveNodes
public void removeInterpretiveNodes()
removeInterpretiveNodesOnDerivation
public void removeInterpretiveNodesOnDerivation()
setProductionCallback
public void setProductionCallback(java.lang.Runnable c)
setVisibleExtents
public void setVisibleExtents(int indices)
writeQueues
public static void writeQueues(ObjectList<? extends Queue> list,
java.io.DataOutput out)
throws java.io.IOException
- Throws:
java.io.IOException