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

## Class GenericProjectionIndexer

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

- All Implemented Interfaces:
    java.lang.Iterable<Tuple>, Indexer, IterableIndexer, ProjectionIndexer, org.eclipse.viatra.query.runtime.rete.network.communication.timely.ResumableNode, IGroupable, NetworkStructureChangeSensitiveNode, Node, Receiver
  Direct Known Subclasses:
    OnetimeIndexer

      public class GenericProjectionIndexer
      extends IndexerWithMemory
      implements ProjectionIndexer

  A generic Indexer capable of indexing along any valid TupleMask. Does not keep track of parents, because will not ever pull parents.

- - ### Nested Class Summary

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

      `IndexerWithMemory.NetworkStructureChangeSensitiveLogic`

  - ### Field Summary

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

      `group, logic, mailbox, memory`

    - ### 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 and Description
    `GenericProjectionIndexer(ReteContainer reteContainer, TupleMask mask)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.util.Collection<Tuple>` | `get(Tuple signature)`
    `Receiver` | `getActiveNode()` This indexer will be updated whenever a Rete update is sent to the active node (or an equivalent time slot allotted to it).
    `int` | `getBucketCount()`
    `java.lang.Iterable<Tuple>` | `getSignatures()` A view consisting of exactly those signatures whose tuple group is not empty
    `java.util.Map<Tuple,Timeline<Timestamp>>` | `getTimeline(Tuple signature)`
    `java.util.Iterator<Tuple>` | `iterator()`
    `protected void` | `update(Direction direction, Tuple updateElement, Tuple signature, boolean change, Timestamp timestamp)` Refined version of update

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

      `appendParent, createLogic, getCurrentGroup, getMailbox, getMemory, getParents, getResumableTimestamp, instantiateMailbox, networkStructureChanged, removeParent, resumeAt, setCurrentGroup, update`

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

      `assignTraceInfo, attachListener, detachListener, getContainer, getListeners, getMask, getParent, propagate, 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

      `attachListener, detachListener, getListeners, getMask, getParent`

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

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

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

      `forEach, spliterator`

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

      `batchUpdate`

- - ### Constructor Detail

    - #### GenericProjectionIndexer

          public GenericProjectionIndexer(ReteContainer reteContainer,
                                          TupleMask mask)

  - ### Method Detail

    - #### update

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

      Description copied from class: `IndexerWithMemory`
      Refined version of update
      Specified by:
        `update` in class `IndexerWithMemory`

    - #### get

          public java.util.Collection<Tuple> get(Tuple signature)

      Specified by:
        `get` in interface `Indexer`
      Returns:
        all stored tuples that conform to the specified signature, null if there are none such. CONTRACT: do not modify!

    - #### getTimeline

          public java.util.Map<Tuple,Timeline<Timestamp>> getTimeline(Tuple signature)

      Specified by:
        `getTimeline` in interface `Indexer`

    - #### iterator

          public java.util.Iterator<Tuple> iterator()

      Specified by:
        `iterator` in interface `java.lang.Iterable<Tuple>`

    - #### getSignatures

          public java.lang.Iterable<Tuple> getSignatures()

      Description copied from interface: `IterableIndexer`
      A view consisting of exactly those signatures whose tuple group is not empty
      Specified by:
        `getSignatures` in interface `IterableIndexer`

    - #### getBucketCount

          public int getBucketCount()

      Specified by:
        `getBucketCount` in interface `IterableIndexer`
      Returns:
        the number of signatures whose tuple group is not empty
      Since:
        2.0

    - #### getActiveNode

          public Receiver 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