Module xl.impl

Class Producer

java.lang.Object
de.grogra.xl.impl.base.Producer
All Implemented Interfaces:
Producer, Executor
Direct Known Subclasses:
DOMProducer, RGGProducer, SimpleProducer

public abstract class Producer extends Object implements Producer, Executor
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 Details

    • addNodeQueue

      protected GraphQueue addNodeQueue
    • deleteNodeQueue

      protected GraphQueue deleteNodeQueue
    • deleteEdgeQueue

      protected GraphQueue deleteEdgeQueue
  • Constructor Details

  • Method Details

    • getQueryState

      protected QueryState getQueryState()
      Returns the match for which this producer constructs the replacement. The returned instance is the same as the one in the factory method Graph.createProducer(de.grogra.xl.query.QueryState) which created this producer.
      Returns:
      the match for which this producer constructs a replacement
    • producer$getGraph

      public Graph 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 interface Producer
      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 interface Producer
      Parameters:
      arrow - the type of rule arrow, one of Producer.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 interface Producer
      Parameters:
      applied - return value of invocation of Producer.producer$beginExecution(int)
    • producer$cliqueBegin

      public Object producer$cliqueBegin()
    • producer$cliqueEnd

      public Object producer$cliqueEnd()
    • pushImpl

      protected void pushImpl()
    • popImpl

      protected void popImpl()
    • separateImpl

      protected void separateImpl()
    • nodeUsed

      protected void nodeUsed(Object object)
    • addNodeImpl

      protected void addNodeImpl(Object node, boolean addEdge)
    • addNodeImplMS

      protected void addNodeImplMS(Object node, boolean addEdge)
    • getPreviousNode

      protected Object getPreviousNode()
    • addEdgeImpl

      protected final void addEdgeImpl(Object first, Object second, int bits, EdgeDirection direction)
    • producer$visitEdge

      public void producer$visitEdge(EdgePattern pattern)
      Specified by:
      producer$visitEdge in interface Producer
    • copyIncoming

      public void copyIncoming(Object s, Object t, int edges)
    • copyOutgoing

      public void copyOutgoing(Object s, Object t, int edges)
    • moveIncoming

      public void moveIncoming(Object s, Object t, int edges)
    • moveOutgoing

      public void moveOutgoing(Object s, Object t, int edges)
    • connect

      public <N, P> void connect(N s, N t, P param, Connector<N,P> c)
      Adds an action to the connecting queue q (GraphQueue.CONNECT_DESCRIPTOR) which induces the invocation c.connect(s, t, param, q) on queue application.
      Parameters:
      s - node of the match for the left hand side of the rule
      t - replacing node of the right hand side of the rule
      param - some parameter for the connector
      c - a connector
    • execute

      public void execute(Runnable r)
      Specified by:
      execute in interface Executor
    • 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

      public void consume(Object node)
    • getQueues

      public QueueCollection getQueues()
    • getQueue

      public <Q extends Queue> Q getQueue(QueueDescriptor<Q> descr)
    • getFirstLastScale

      public FirstLastScale getFirstLastScale(int index)
    • getFirstLastScale

      public FirstLastScale getFirstLastScale(Object node)
      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