Interface ReteMemory<M>

Type Parameters:
M - the type of elements stored inside the memory
All Superinterfaces:
DeltaInsertMemory
All Known Subinterfaces:
GroupingReteMemory<V>
All Known Implementing Classes:
GroupingReteMemoryWrapper

public interface ReteMemory<M> extends DeltaInsertMemory
Describes a general session-level memory interface related to the Rete algorithm. This implementation distinguishes three general Rete stages:
  1. Computing delta objects, i.e., changes in working memory structures caused by various actions like memory inserts.
  2. Acting on these changes, for example computing condition memories or executing a rule's RHS.
  3. Committing the changes, like saving the changes into permanent storage.
  • Method Summary

    Modifier and Type
    Method
    Description
    Provides an iterator over permanent or temporary (uncommitted) storage depending on the specified scope.
    default Stream<M>
    Provides a default implementation for streaming over stored elements based on the provided scope.

    Methods inherited from interface org.evrete.api.spi.DeltaInsertMemory

    clear, commit, commit
  • Method Details

    • iterator

      Iterator<M> iterator(MemoryScope scope)
      Provides an iterator over permanent or temporary (uncommitted) storage depending on the specified scope.
      Parameters:
      scope - the memory scope indicating whether to iterate over main or delta storage
      Returns:
      an iterator over storage elements of type M depending on the specified scope
    • stream

      default Stream<M> stream(MemoryScope scope)
      Provides a default implementation for streaming over stored elements based on the provided scope. Implementations are encouraged to override this method to create parallel streams, if possible.
      Parameters:
      scope - the memory scope indicating whether to stream over main or delta storage
      Returns:
      a stream over elements in the storage of the provided scope