Class GroupingReteMemoryWrapper<V>

java.lang.Object
org.evrete.util.GroupingReteMemoryWrapper<V>
All Implemented Interfaces:
ReteMemory<Long>, DeltaInsertMemory, GroupingReteMemory<V>

public class GroupingReteMemoryWrapper<V> extends Object implements GroupingReteMemory<V>
  • Constructor Details

  • Method Details

    • insert

      public void insert(long key, V value)
      Description copied from interface: GroupingReteMemory
      Buffers a new key/value combination into the delta memory.
      Specified by:
      insert in interface GroupingReteMemory<V>
      Parameters:
      key - the key to be inserted
      value - the value associated with the key
    • delete

      public void delete(long key, V value)
      Description copied from interface: GroupingReteMemory
      Deletes the given key and value from both delta and main memories. If the value is the last one stored under this key, the key must be deleted as well.
      Specified by:
      delete in interface GroupingReteMemory<V>
      Parameters:
      key - the key to be deleted
      value - the value associated with the key
    • valueIterator

      public Iterator<V> valueIterator(MemoryScope scope, long key)
      Description copied from interface: GroupingReteMemory
      Returns an iterator over values.
      Specified by:
      valueIterator in interface GroupingReteMemory<V>
      Parameters:
      scope - the scope of the values (not the keys)
      key - the key identifying the values to iterate over
      Returns:
      an iterator over the values associated with the given key in the specified scope
    • iterator

      public Iterator<Long> iterator(MemoryScope scope)
      Description copied from interface: ReteMemory
      Provides an iterator over permanent or temporary (uncommitted) storage depending on the specified scope.
      Specified by:
      iterator in interface ReteMemory<V>
      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
    • commit

      public void commit()
      Description copied from interface: DeltaInsertMemory
      Converts the accumulated delta changes into main (permanent) storage.
      Specified by:
      commit in interface DeltaInsertMemory
    • clear

      public void clear()
      Description copied from interface: DeltaInsertMemory
      Clears all elements from both delta and main storage.
      Specified by:
      clear in interface DeltaInsertMemory
    • toString

      public String toString()
      Overrides:
      toString in class Object