Module rgg

Class RGGGraph

java.lang.Object
de.grogra.xl.impl.base.Graph
de.grogra.rgg.model.RGGGraph
All Implemented Interfaces:
Graph, Cloneable

@HasModel(Compiletime.class) public class RGGGraph extends Graph
  • Method Details

    • createThreadData

      protected Graph.ThreadData createThreadData()
      Overrides:
      createThreadData in class Graph
    • getNewGRSVertices

      public ObjectList<GRSVertex> getNewGRSVertices()
    • 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
    • setProductionCallback

      public void setProductionCallback(Runnable c)
    • getGraphManager

      public GraphManager getGraphManager()
    • 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 nodes
      qs - the query state on which the amatch-method has to be invoked
      index - the index-parameter for the amatch-method
      consumer - the consumer-parameter for the amatch-method
      arg - the arg-parameter for the amatch-method
    • 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
    • getRoot

      public Object getRoot()
      Description copied from interface: Graph
      Returns the root node of this graph.
      Returns:
      the root
    • getTypeRoot

      public Object getTypeRoot()
      Description copied from interface: Graph
      Returns the root node of the type graph for this graph
      Returns:
      the root of the type graph
    • canEnumerateEdges

      public boolean canEnumerateEdges(EdgeDirection dir, boolean constEdge, Serializable edge)
    • enumerateEdges

      public void enumerateEdges(Object node, EdgeDirection dir, Type edgeType, QueryState qs, int toIndex, int patternIndex, Serializable pattern, int matchIndex, MatchConsumer consumer, int arg)
      Specified by:
      enumerateEdges in interface Graph
      Overrides:
      enumerateEdges in class Graph
    • createQueue

      public GraphQueue createQueue(QueueCollection qc, QueueDescriptor descr)
      Specified by:
      createQueue in class Graph
    • beginModifications

      protected void beginModifications()
      Specified by:
      beginModifications in class Graph
    • commitModifications

      protected void commitModifications()
      Specified by:
      commitModifications in class Graph
    • getPredecessor

      protected Object getPredecessor(Object node)
      Overrides:
      getPredecessor in class Graph
    • removeInterpretiveNodes

      public void removeInterpretiveNodes()
    • removeInterpretiveNodesOnDerivation

      public void removeInterpretiveNodesOnDerivation()
    • setVisibleExtents

      public void setVisibleExtents(int indices)
    • derive

      public long derive()
      Overrides:
      derive in class Graph
    • writeQueues

      public static void writeQueues(ObjectList<? extends Queue> list, DataOutput out) throws IOException
      Throws:
      IOException
    • readQueues

      public static ObjectList<Queue> readQueues(QueueCollection qc, DataInput in, ClassLoader loader) throws IOException
      Throws:
      IOException
    • addQueues

      public static void addQueues(QueueCollection qc, ObjectList<? extends Queue> queues)
    • getTypeGraphNode

      public Object getTypeGraphNode(Node node)
      Search the type graph for the representative type graph node of the input node.
      Parameters:
      node -
      Returns:
      node in type graph representing the type of the given node.