org.eclipse.viatra.query.runtime.rete.single

## Class DiscriminatorDispatcherNode

- java.lang.Object
- - org.eclipse.viatra.query.runtime.rete.network.BaseNode
  - - org.eclipse.viatra.query.runtime.rete.network.StandardNode
    - - org.eclipse.viatra.query.runtime.rete.single.SingleInputNode
      - - org.eclipse.viatra.query.runtime.rete.single.DiscriminatorDispatcherNode

- All Implemented Interfaces:
    NetworkStructureChangeSensitiveNode, Node, Receiver, Supplier, Tunnel

      public class DiscriminatorDispatcherNode
      extends SingleInputNode
      implements NetworkStructureChangeSensitiveNode

  Node that sends tuples off to different buckets (attached as children of type `DiscriminatorBucketNode`), based on the value of a given column.

  Tuple contents and bucket keys have already been wrapped using `IQueryRuntimeContext.wrapElement(Object)`

  Since:
    1.5

- - ### Field Summary

    - ### Fields inherited from class org.eclipse.viatra.query.runtime.rete.single.SingleInputNode

      `mailbox, parent`

    - ### Fields inherited from class org.eclipse.viatra.query.runtime.rete.network.StandardNode

      `childMailboxes, children`

    - ### Fields inherited from class org.eclipse.viatra.query.runtime.rete.network.BaseNode

      `nodeId, reteContainer, tag, traceInfos`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DiscriminatorDispatcherNode(ReteContainer reteContainer, int discriminationColumnIndex)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `appendChild(Receiver receiver)` appends a receiver that will continously receive insert and revoke updates from this supplier
    `java.util.Map<java.lang.Object,Mailbox>` | `getBucketMailboxes()`
    `int` | `getDiscriminationColumnIndex()`
    `void` | `networkStructureChanged()` At the time of the invocation, the dependency graph has already been updated.
    `void` | `pullInto(java.util.Collection<Tuple> collector, boolean flush)` Pulls the contents of this object in this particular moment into a target collection.
    `void` | `pullIntoFiltered(java.util.Collection<Tuple> collector, java.lang.Object bucketKey, boolean flush)`
    `void` | `pullIntoWithTimeline(java.util.Map<Tuple,Timeline<Timestamp>> collector, boolean flush)`
    `void` | `pullIntoWithTimestampFiltered(java.util.Map<Tuple,Timeline<Timestamp>> collector, java.lang.Object bucketKey, boolean flush)`
    `void` | `removeChild(Receiver receiver)` removes a receiver
    `protected java.lang.String` | `toStringCore()` clients should override this to append before the tag / trace indicators
    `void` | `update(Direction direction, Tuple updateElement, Timestamp timestamp)` Updates the receiver with a newly found or lost partial matching.

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

      `appendParent, assignTraceInfo, getCommunicationTracker, getMailbox, getParents, instantiateMailbox, propagatePullInto, propagatePullIntoWithTimestamp, removeParent`

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

      `constructIndex, getChildMailboxes, getPulledContents, getReceivers, issueError, propagateUpdate`

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

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

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

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

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

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

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

      `constructIndex, getPulledContents, getPulledContents, getReceivers`

    - ### Methods inherited from interface org.eclipse.viatra.query.runtime.rete.network.Receiver

      `batchUpdate`

- - ### Constructor Detail

    - #### DiscriminatorDispatcherNode

          public DiscriminatorDispatcherNode(ReteContainer reteContainer,
                                             int discriminationColumnIndex)

      Parameters:
        `reteContainer` -

  - ### Method Detail

    - #### 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`

    - #### getDiscriminationColumnIndex

          public int getDiscriminationColumnIndex()

    - #### pullInto

          public void pullInto(java.util.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`
        `flush` - if true, flushing of messages is allowed during the pull, otherwise flushing is not allowed

    - #### pullIntoWithTimeline

          public void pullIntoWithTimeline(java.util.Map<Tuple,Timeline<Timestamp>> collector,
                                           boolean flush)

      Specified by:
        `pullIntoWithTimeline` in interface `Supplier`

    - #### pullIntoFiltered

          public void pullIntoFiltered(java.util.Collection<Tuple> collector,
                                       java.lang.Object bucketKey,
                                       boolean flush)

      Since:
        2.3

    - #### pullIntoWithTimestampFiltered

          public void pullIntoWithTimestampFiltered(java.util.Map<Tuple,Timeline<Timestamp>> collector,
                                                    java.lang.Object bucketKey,
                                                    boolean flush)

      Since:
        2.3

    - #### appendChild

          public void appendChild(Receiver receiver)

      Description copied from interface: `Supplier`
      appends a receiver that will continously receive insert and revoke updates from this supplier
      Specified by:
        `appendChild` in interface `Supplier`
      Overrides:
        `appendChild` in class `StandardNode`

    - #### getBucketMailboxes

          public java.util.Map<java.lang.Object,Mailbox> getBucketMailboxes()

      Since:
        2.2

    - #### 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`

    - #### removeChild

          public void removeChild(Receiver receiver)

      Description copied from interface: `Supplier`
      removes a receiver
      Specified by:
        `removeChild` in interface `Supplier`
      Overrides:
        `removeChild` in class `StandardNode`

    - #### toStringCore

          protected java.lang.String toStringCore()

      Description copied from class: `BaseNode`
      clients should override this to append before the tag / trace indicators
      Overrides:
        `toStringCore` in class `BaseNode`