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

## Class AbstractUniquenessEnforcerNode

- 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.AbstractUniquenessEnforcerNode

- All Implemented Interfaces:
    NetworkStructureChangeSensitiveNode, Node, Receiver, Supplier, Tunnel
  Direct Known Subclasses:
    TimelyUniquenessEnforcerNode, UniquenessEnforcerNode

      public abstract class AbstractUniquenessEnforcerNode
      extends StandardNode
      implements Tunnel

  Ensures that no identical copies get to the output. Only one replica of each pattern substitution may traverse this node. There are both timeless and timely implementations.
  Since:
    2.2
  No Extend:
    This class is not intended to be subclassed by clients.
  No Instantiate:
    This class is not intended to be instantiated by clients.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected TupleMask` | `identityMask`
    `protected Mailbox` | `mailbox`
    `protected ProjectionIndexer` | `memoryIdentityIndexer`
    `protected ProjectionIndexer` | `memoryNullIndexer`
    `protected TupleMask` | `nullMask`
    `protected java.util.Collection<Supplier>` | `parents`
    `protected java.util.List<SpecializedProjectionIndexer.ListenerSubscription>` | `specializedListeners`
    `protected int` | `tupleWidth`

    - ### 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
    `AbstractUniquenessEnforcerNode(ReteContainer reteContainer, int tupleWidth)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `appendParent(Supplier supplier)` appends a parent that will continuously send insert and revoke updates to this supplier
    `void` | `assignTraceInfo(TraceInfo traceInfo)` assigns new traceability info to this node
    `ProjectionIndexer` | `constructIndex(TupleMask mask, TraceInfo... traces)` Instantiates (or reuses, depending on implementation) an index according to the given mask.
    `abstract ProjectionIndexer` | `getIdentityIndexer()`
    `Mailbox` | `getMailbox()` Returns the `Mailbox` of this receiver.
    `abstract ProjectionIndexer` | `getNullIndexer()`
    `java.util.Collection<Supplier>` | `getParents()` access active parent
    `abstract java.util.Set<Tuple>` | `getTuples()`
    `protected abstract Mailbox` | `instantiateMailbox()`
    `protected void` | `propagate(Direction direction, Tuple update, Timestamp timestamp)`
    `void` | `removeParent(Supplier supplier)` removes a parent

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

      `appendChild, getChildMailboxes, getPulledContents, getReceivers, issueError, networkStructureChanged, propagateUpdate, removeChild`

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

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

    - ### 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.Supplier

      `appendChild, getPulledContents, getPulledContents, getReceivers, pullInto, pullIntoWithTimeline, removeChild`

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

      `batchUpdate, update`

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

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

- - ### Field Detail

    - #### parents

          protected final java.util.Collection<Supplier> parents

    - #### memoryNullIndexer

          protected ProjectionIndexer memoryNullIndexer

    - #### memoryIdentityIndexer

          protected ProjectionIndexer memoryIdentityIndexer

    - #### tupleWidth

          protected final int tupleWidth

    - #### mailbox

          protected Mailbox mailbox

    - #### nullMask

          protected final TupleMask nullMask

    - #### identityMask

          protected final TupleMask identityMask

    - #### specializedListeners

          protected final java.util.List<SpecializedProjectionIndexer.ListenerSubscription> specializedListeners

  - ### Constructor Detail

    - #### AbstractUniquenessEnforcerNode

          public AbstractUniquenessEnforcerNode(ReteContainer reteContainer,
                                                int tupleWidth)

  - ### Method Detail

    - #### instantiateMailbox

          protected abstract Mailbox instantiateMailbox()

    - #### getMailbox

          public Mailbox getMailbox()

      Description copied from interface: `Receiver`
      Returns the `Mailbox` of this receiver.
      Specified by:
        `getMailbox` in interface `Receiver`
      Returns:
        the mailbox

    - #### getTuples

          public abstract java.util.Set<Tuple> getTuples()

      Since:
        2.8

    - #### propagate

          protected void propagate(Direction direction,
                                   Tuple update,
                                   Timestamp timestamp)

      Since:
        2.4

    - #### constructIndex

          public ProjectionIndexer constructIndex(TupleMask mask,
                                                  TraceInfo... traces)

      Description copied from interface: `Supplier`
      Instantiates (or reuses, depending on implementation) an index according to the given mask. Intended for internal use; clients should invoke through Library instead to enable reusing.
      Specified by:
        `constructIndex` in interface `Supplier`
      Overrides:
        `constructIndex` in class `StandardNode`

    - #### getNullIndexer

          public abstract ProjectionIndexer getNullIndexer()

    - #### getIdentityIndexer

          public abstract ProjectionIndexer getIdentityIndexer()

    - #### appendParent

          public void appendParent(Supplier supplier)

      Description copied from interface: `Receiver`
      appends a parent that will continuously send insert and revoke updates to this supplier
      Specified by:
        `appendParent` in interface `Receiver`

    - #### removeParent

          public void removeParent(Supplier supplier)

      Description copied from interface: `Receiver`
      removes a parent
      Specified by:
        `removeParent` in interface `Receiver`

    - #### getParents

          public java.util.Collection<Supplier> getParents()

      Description copied from interface: `Receiver`
      access active parent
      Specified by:
        `getParents` in interface `Receiver`

    - #### assignTraceInfo

          public void assignTraceInfo(TraceInfo traceInfo)

      Description copied from interface: `Node`
      assigns new traceability info to this node
      Specified by:
        `assignTraceInfo` in interface `Node`
      Overrides:
        `assignTraceInfo` in class `BaseNode`