org.eclipse.viatra.query.runtime.rete.index

## Class ExistenceNode

- 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.index.DualInputNode
      - - org.eclipse.viatra.query.runtime.rete.index.ExistenceNode

- All Implemented Interfaces:
    Node, Supplier

      public class ExistenceNode
      extends DualInputNode

  Propagates all substitutions arriving at the PRIMARY slot if and only if (a matching substitution on the SECONDARY is present) xor (NEGATIVE). The negative parameter specifies whether this node checks for existence or non-existence.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.eclipse.viatra.query.runtime.rete.index.DualInputNode

      `DualInputNode.Side`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected boolean` | `negative`

    - ### Fields inherited from class org.eclipse.viatra.query.runtime.rete.index.DualInputNode

      `coincidence, complementerSecondaryMask, primarySlot, secondarySlot`

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

      `children`

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

      `nodeId, reteContainer, tag, traceInfos`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ExistenceNode(ReteContainer reteContainer, boolean negative)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Tuple` | `calibrate(Tuple primary, Tuple secondary)` Simulates the behaviour of the node for calibration purposes only.
    `void` | `notifyUpdate(DualInputNode.Side side, Direction direction, Tuple updateElement, Tuple signature, boolean change)` Abstract handler for update event.
    `void` | `pullInto(java.util.Collection<Tuple> collector)` pulls the contents of this object in this particular moment into a target collection

    - ### Methods inherited from class org.eclipse.viatra.query.runtime.rete.index.DualInputNode

      `assignTraceInfo, connectToIndexers, getPrimarySlot, getSecondarySlot, getSlot, retrieveOpposites, setComplementerSecondaryMask, unify, unify`

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

      `appendChild, constructIndex, getPulledContents, getReceivers, issueError, 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.Node

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

- - ### Field Detail

    - #### negative

          protected boolean negative

  - ### Constructor Detail

    - #### ExistenceNode

          public ExistenceNode(ReteContainer reteContainer,
                               boolean negative)

      Parameters:
        `reteContainer` -
        `negative` - if false, act as axistence checker, otherwise a nonexistence-checker

  - ### Method Detail

    - #### calibrate

          public Tuple calibrate(Tuple primary,
                                 Tuple secondary)

      Description copied from class: `DualInputNode`
      Simulates the behaviour of the node for calibration purposes only.
      Specified by:
        `calibrate` in class `DualInputNode`

    - #### notifyUpdate

          public void notifyUpdate(DualInputNode.Side side,
                                   Direction direction,
                                   Tuple updateElement,
                                   Tuple signature,
                                   boolean change)

      Description copied from class: `DualInputNode`
      Abstract handler for update event.
      Specified by:
        `notifyUpdate` in class `DualInputNode`
      Parameters:
        `side` - The side on which the event occured.
        `direction` - The direction of the update.
        `updateElement` - The partial matching that is inserted.
        `signature` - Masked signature of updateElement.
        `change` - Indicates whether this is/was the first/last instance of this signature in this slot.

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