org.eclipse.incquery.runtime.rete.single

## Class TransitiveClosureNode

- java.lang.Object
- - org.eclipse.incquery.runtime.rete.network.BaseNode
  - - org.eclipse.incquery.runtime.rete.network.StandardNode
    - - org.eclipse.incquery.runtime.rete.single.SingleInputNode
      - - org.eclipse.incquery.runtime.rete.single.TransitiveClosureNode

- All Implemented Interfaces:
    ITcObserver<java.lang.Object>, Node, Receiver, Supplier, Tunnel, Clearable

      public class TransitiveClosureNode
      extends SingleInputNode
      implements Clearable, ITcObserver<java.lang.Object>

  This class represents a transitive closure node in the rete net.
  Author:
    Gabor Bergmann

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TransitiveClosureNode(ReteContainer reteContainer)` Create a new transitive closure rete node.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()` Clear all partial matchings stored in memory
    `void` | `pullInto(java.util.Collection<Tuple> collector)` pulls the contents of this object in this particular moment into a target collection
    `void` | `reinitializeWith(java.util.Collection<Tuple> tuples)` Initializes the graph data source with the given collection of tuples.
    `void` | `tupleDeleted(java.lang.Object source, java.lang.Object target)` Used to notify when a tuple is deleted from the transitive closure relation.
    `void` | `tupleInserted(java.lang.Object source, java.lang.Object target)` Used to notify when a tuple is inserted into the transitive closure relation.
    `void` | `update(Direction direction, Tuple updateElement)` updates the receiver with a newly found or lost partial matching

    - ### Methods inherited from class org.eclipse.incquery.runtime.rete.single.SingleInputNode

      `appendParent, assignTraceInfo, getParents, propagatePullInto, removeParent`

    - ### Methods inherited from class org.eclipse.incquery.runtime.rete.network.StandardNode

      `appendChild, constructIndex, getPulledContents, getReceivers, removeChild`

    - ### Methods inherited from class org.eclipse.incquery.runtime.rete.network.BaseNode

      `acceptPropagatedTraceInfo, getContainer, getNodeId, getTag, getTraceInfos, setTag, toString`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.eclipse.incquery.runtime.rete.network.Supplier

      `appendChild, constructIndex, getPulledContents, getReceivers, removeChild`

    - ### Methods inherited from interface org.eclipse.incquery.runtime.rete.network.Node

      `acceptPropagatedTraceInfo, getContainer, getNodeId, getTag, getTraceInfos, setTag`

- - ### Constructor Detail

    - #### TransitiveClosureNode

          public TransitiveClosureNode(ReteContainer reteContainer)

      Create a new transitive closure rete node. Client may optionally call `reinitializeWith(Collection)` before using the node, instead of inserting the initial set of tuples one by one.
      Parameters:
        `reteContainer` - the rete container of the node

  - ### Method Detail

    - #### reinitializeWith

          public void reinitializeWith(java.util.Collection<Tuple> tuples)

      Initializes the graph data source with the given collection of tuples.
      Parameters:
        `tuples` - the initial collection of tuples

    - #### pullInto

          public void pullInto(java.util.Collection<Tuple> collector)

      Description copied from interface: `Supplier`
      pulls the contents of this object in this particular moment into a target collection
      Specified by:
        `pullInto` in interface `Supplier`

    - #### update

          public void update(Direction direction,
                             Tuple updateElement)

      Description copied from interface: `Receiver`
      updates the receiver with a newly found or lost partial matching
      Specified by:
        `update` in interface `Receiver`

    - #### clear

          public void clear()

      Description copied from interface: `Clearable`
      Clear all partial matchings stored in memory
      Specified by:
        `clear` in interface `Clearable`

    - #### tupleInserted

          public void tupleInserted(java.lang.Object source,
                                    java.lang.Object target)

      Description copied from interface: `ITcObserver`
      Used to notify when a tuple is inserted into the transitive closure relation.
      Specified by:
        `tupleInserted` in interface `ITcObserver<java.lang.Object>`
      Parameters:
        `source` - the source of the tuple
        `target` - the target of the tuple

    - #### tupleDeleted

          public void tupleDeleted(java.lang.Object source,
                                   java.lang.Object target)

      Description copied from interface: `ITcObserver`
      Used to notify when a tuple is deleted from the transitive closure relation.
      Specified by:
        `tupleDeleted` in interface `ITcObserver<java.lang.Object>`
      Parameters:
        `source` - the source of the tuple
        `target` - the target of the tuple