Class TransitiveClosureNode

All Implemented Interfaces:
Clearable, ITcObserver<Object>, NetworkStructureChangeSensitiveNode, Node, Receiver, ReinitializedNode, Supplier, Tunnel

public class TransitiveClosureNode extends SingleInputNode implements Clearable, ITcObserver<Object>, NetworkStructureChangeSensitiveNode, ReinitializedNode
This class represents a transitive closure node in the Rete net.

This node must not be used in recursive CommunicationGroups.

  • Constructor Details

    • 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 Details

    • networkStructureChanged

      public void networkStructureChanged()
      Description copied from interface: NetworkStructureChangeSensitiveNode
      At the time of the invocation, the dependency graph has already been updated.
      Specified by:
      networkStructureChanged in interface NetworkStructureChangeSensitiveNode
      Overrides:
      networkStructureChanged in class StandardNode
    • reinitializeWith

      public void reinitializeWith(Collection<Tuple> tuples)
      Initializes the graph data source with the given collection of tuples.
      Specified by:
      reinitializeWith in interface ReinitializedNode
      Parameters:
      tuples - the initial collection of tuples
    • pullInto

      public void pullInto(Collection<Tuple> collector, boolean flush)
      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
      Parameters:
      flush - if true, flushing of messages is allowed during the pull, otherwise flushing is not allowed
    • pullIntoWithTimeline

      public void pullIntoWithTimeline(Map<Tuple,Timeline<Timestamp>> collector, boolean flush)
      Specified by:
      pullIntoWithTimeline in interface Supplier
    • update

      public void update(Direction direction, Tuple updateElement, Timestamp timestamp)
      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()
      Specified by:
      clear in interface Clearable
    • tupleInserted

      public void tupleInserted(Object source, 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<Object>
      Parameters:
      source - the source of the tuple
      target - the target of the tuple
    • tupleDeleted

      public void tupleDeleted(Object source, 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<Object>
      Parameters:
      source - the source of the tuple
      target - the target of the tuple