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

## Class SpecializedProjectionIndexer

- java.lang.Object
- - org.eclipse.viatra.query.runtime.rete.network.BaseNode
  - - org.eclipse.viatra.query.runtime.rete.index.StandardIndexer
    - - org.eclipse.viatra.query.runtime.rete.index.SpecializedProjectionIndexer

- All Implemented Interfaces:
    `java.lang.Iterable<Tuple>`, `Indexer`, `IterableIndexer`, `ProjectionIndexer`, `NetworkStructureChangeSensitiveNode`, `Node`
  Direct Known Subclasses:
    `IdentityIndexer`, `NullIndexer`

      public abstract class SpecializedProjectionIndexer
      extends StandardIndexer
      implements ProjectionIndexer

  A specialized projection indexer that can be memory-less (relying on an external source of information).

  All specialized projection indexers of a single node will share the same listener list, so that notification order is maintained (see Bug 518434).

  No Implement:
    Rely on the provided implementations
  No Reference:
    Use only via standard Node and Indexer interfaces
  No Instantiate:
    This class is not intended to be instantiated by clients.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static class` | `SpecializedProjectionIndexer.ListenerSubscription` | Infrastructure to share subscriptions between specialized indexers of the same parent node.

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected Node` | `activeNode` |
    `protected java.util.List<SpecializedProjectionIndexer.ListenerSubscription>` | `subscriptions` |

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

      `mask, parent`

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

      `nodeId, reteContainer, tag, traceInfos`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `SpecializedProjectionIndexer​(ReteContainer reteContainer, TupleMask mask, Supplier parent, Node activeNode, java.util.List<SpecializedProjectionIndexer.ListenerSubscription> subscriptions)` |

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `attachListener​(IndexerListener listener)` |
    `void` | `detachListener​(IndexerListener listener)` |
    `Node` | `getActiveNode()` | This indexer will be updated whenever a Rete update is sent to the active node (or an equivalent time slot allotted to it).
    `java.util.List<SpecializedProjectionIndexer.ListenerSubscription>` | `getSubscriptions()` |
    `void` | `networkStructureChanged()` | At the time of the invocation, the dependency graph has already been updated.
    `protected void` | `propagate​(Direction direction, Tuple updateElement, Tuple signature, boolean change, Timestamp timestamp)` |
    `abstract void` | `propagateToListener​(IndexerListener listener, Direction direction, Tuple updateElement, Timestamp timestamp)` |

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

      `assignTraceInfo, getContainer, getListeners, getMask, getParent, toStringCore`

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

      `acceptPropagatedTraceInfo, 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.index.Indexer

      `get, getListeners, getMask, getParent, getTimeline`

    - ### Methods inherited from interface java.lang.Iterable

      `forEach, iterator, spliterator`

    - ### Methods inherited from interface org.eclipse.viatra.query.runtime.rete.index.IterableIndexer

      `getBucketCount, getSignatures`

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

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

- - ### Field Detail

    - #### activeNode

          protected Node activeNode

    - #### subscriptions

          protected java.util.List<SpecializedProjectionIndexer.ListenerSubscription> subscriptions

  - ### Constructor Detail

    - #### SpecializedProjectionIndexer

          public SpecializedProjectionIndexer​(ReteContainer reteContainer,
                                              TupleMask mask,
                                              Supplier parent,
                                              Node activeNode,
                                              java.util.List<SpecializedProjectionIndexer.ListenerSubscription> subscriptions)

      Since:
        1.7

  - ### Method Detail

    - #### getSubscriptions

          public java.util.List<SpecializedProjectionIndexer.ListenerSubscription> getSubscriptions()

    - #### getActiveNode

          public Node getActiveNode()

      Description copied from interface: `Indexer`
      This indexer will be updated whenever a Rete update is sent to the active node (or an equivalent time slot allotted to it). The active node is typically the indexer itself, but it can be a different node such as its parent.
      Specified by:
        `getActiveNode` in interface `Indexer`
      Returns:
        the active node that operates this indexer

    - #### propagate

          protected void propagate​(Direction direction,
                                   Tuple updateElement,
                                   Tuple signature,
                                   boolean change,
                                   Timestamp timestamp)

      Overrides:
        `propagate` in class `StandardIndexer`

    - #### attachListener

          public void attachListener​(IndexerListener listener)

      Specified by:
        `attachListener` in interface `Indexer`
      Overrides:
        `attachListener` in class `StandardIndexer`

    - #### detachListener

          public void detachListener​(IndexerListener listener)

      Specified by:
        `detachListener` in interface `Indexer`
      Overrides:
        `detachListener` in class `StandardIndexer`

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

    - #### propagateToListener

          public abstract void propagateToListener​(IndexerListener listener,
                                                   Direction direction,
                                                   Tuple updateElement,
                                                   Timestamp timestamp)

      Since:
        2.4