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

## Class IndexerWithMemory

- 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

- All Implemented Interfaces:
    Indexer, org.eclipse.viatra.query.runtime.rete.network.communication.timely.ResumableNode, IGroupable, NetworkStructureChangeSensitiveNode, Node, Receiver
  Direct Known Subclasses:
    GenericProjectionIndexer

      public abstract class IndexerWithMemory
      extends StandardIndexer
      implements Receiver, NetworkStructureChangeSensitiveNode, org.eclipse.viatra.query.runtime.rete.network.communication.timely.ResumableNode

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected static class` | `IndexerWithMemory.NetworkStructureChangeSensitiveLogic`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected CommunicationGroup` | `group`
    `protected IndexerWithMemory.NetworkStructureChangeSensitiveLogic` | `logic`
    `protected Mailbox` | `mailbox`
    `protected MaskedTupleMemory<Timestamp>` | `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
    `IndexerWithMemory(ReteContainer reteContainer, TupleMask mask)`

  - ### 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
    `protected IndexerWithMemory.NetworkStructureChangeSensitiveLogic` | `createLogic()`
    `CommunicationGroup` | `getCurrentGroup()`
    `Mailbox` | `getMailbox()` Returns the `Mailbox` of this receiver.
    `MaskedTupleMemory<Timestamp>` | `getMemory()`
    `java.util.Collection<Supplier>` | `getParents()` access active parent
    `Timestamp` | `getResumableTimestamp()` Returns the smallest timestamp where lazy folding shall be resumed, or null if there is no more folding to do in this resumable.
    `protected Mailbox` | `instantiateMailbox()` Instantiates the `Mailbox` of this receiver.
    `void` | `networkStructureChanged()` At the time of the invocation, the dependency graph has already been updated.
    `void` | `removeParent(Supplier supplier)` removes a parent
    `void` | `resumeAt(Timestamp timestamp)` When called, the folding of the state shall be resumed at the given timestamp.
    `void` | `setCurrentGroup(CommunicationGroup group)` Sets the current group of the mailbox
    `void` | `update(Direction direction, Tuple updateElement, Timestamp timestamp)` updates the receiver with a newly found or lost partial matching
    `protected abstract 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.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.network.Node

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

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

      `get, getActiveNode, getTimeline`

- - ### Field Detail

    - #### memory

          protected MaskedTupleMemory<Timestamp> memory

    - #### logic

          protected IndexerWithMemory.NetworkStructureChangeSensitiveLogic logic

      Since:
        2.3

    - #### mailbox

          protected final Mailbox mailbox

      Since:
        1.6

    - #### group

          protected CommunicationGroup group

      Since:
        2.4

  - ### Constructor Detail

    - #### IndexerWithMemory

          public IndexerWithMemory(ReteContainer reteContainer,
                                   TupleMask mask)

  - ### Method Detail

    - #### getCurrentGroup

          public CommunicationGroup getCurrentGroup()

      Specified by:
        `getCurrentGroup` in interface `IGroupable`
      Returns:
        the current group of the mailbox

    - #### setCurrentGroup

          public void setCurrentGroup(CommunicationGroup group)

      Description copied from interface: `IGroupable`
      Sets the current group of the mailbox
      Specified by:
        `setCurrentGroup` in interface `IGroupable`

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

    - #### instantiateMailbox

          protected Mailbox instantiateMailbox()

      Instantiates the `Mailbox` of this receiver. Subclasses may override this method to provide their own mailbox implementation.
      Returns:
        the mailbox
      Since:
        2.0

    - #### getMailbox

          public Mailbox getMailbox()

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

    - #### getMemory

          public MaskedTupleMemory<Timestamp> getMemory()

      Since:
        2.0

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

    - #### update

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

      Refined version of update
      Since:
        2.4

    - #### 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`
      Since:
        2.4

    - #### resumeAt

          public void resumeAt(Timestamp timestamp)

      Description copied from interface: `org.eclipse.viatra.query.runtime.rete.network.communication.timely.ResumableNode`
      When called, the folding of the state shall be resumed at the given timestamp. The resumable is expected to do a folding step at the given timestamp only. Afterwards, folding shall be interrupted, even if there is more folding to do towards higher timestamps.
      Specified by:
        `resumeAt` in interface `org.eclipse.viatra.query.runtime.rete.network.communication.timely.ResumableNode`
      Since:
        2.4

    - #### getResumableTimestamp

          public Timestamp getResumableTimestamp()

      Description copied from interface: `org.eclipse.viatra.query.runtime.rete.network.communication.timely.ResumableNode`
      Returns the smallest timestamp where lazy folding shall be resumed, or null if there is no more folding to do in this resumable.
      Specified by:
        `getResumableTimestamp` in interface `org.eclipse.viatra.query.runtime.rete.network.communication.timely.ResumableNode`
      Since:
        2.4

    - #### createLogic

          protected IndexerWithMemory.NetworkStructureChangeSensitiveLogic createLogic()

      Since:
        2.3