org.eclipse.incquery.runtime.rete.tuple

## Class MaskedTupleMemory

- java.lang.Object
- - org.eclipse.incquery.runtime.rete.tuple.MaskedTupleMemory

- All Implemented Interfaces:
    java.lang.Iterable<Tuple>, Clearable

      public class MaskedTupleMemory
      extends java.lang.Object
      implements Clearable, java.lang.Iterable<Tuple>

  Author:
    Gabor Bergmann Indexes a collection of Tuples according to their masks.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MaskedTupleMemory(TupleMask mask)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `add(Tuple ps)` Adds a pattern occurence to the memory
    `boolean` | `add(Tuple ps, Tuple signature)` Adds a pattern occurence to the memory, with given signature
    `void` | `clear()` Clear all partial matchings stored in memory
    `java.util.Collection<Tuple>` | `get(Tuple signature)` Retrieves entries that have the specified signature
    `int` | `getKeysetSize()`
    `java.util.Collection<Tuple>` | `getSignatures()` Retrieves a read-only collection of exactly those signatures for which at least one tuple is stored
    `int` | `getTotalSize()`
    `java.util.Iterator<Tuple>` | `iterator()`
    `boolean` | `remove(Tuple ps)` Removes a pattern occurence from the memory
    `boolean` | `remove(Tuple ps, Tuple signature)` Removes a pattern occurence from the memory, with given signature
    `java.lang.String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

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

      `forEach, spliterator`

- - ### Constructor Detail

    - #### MaskedTupleMemory

          public MaskedTupleMemory(TupleMask mask)

      Parameters:
        `mask` - The mask used to index the matchings

  - ### Method Detail

    - #### add

          public boolean add(Tuple ps)

      Adds a pattern occurence to the memory
      Parameters:
        `ps` -
      Returns:
        true if new signature encountered

    - #### add

          public boolean add(Tuple ps,
                             Tuple signature)

      Adds a pattern occurence to the memory, with given signature
      Parameters:
        `ps` -
        `signature` -
      Returns:
        true if new signature encountered

    - #### remove

          public boolean remove(Tuple ps)

      Removes a pattern occurence from the memory
      Returns:
        true if this was the the last occurence of the signature

    - #### remove

          public boolean remove(Tuple ps,
                                Tuple signature)

      Removes a pattern occurence from the memory, with given signature
      Returns:
        true if this was the the last occurence of the signature

    - #### get

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

      Retrieves entries that have the specified signature
      Returns:
        collection of matchings found

    - #### clear

          public void clear()

      Description copied from interface: `Clearable`
      Clear all partial matchings stored in memory
      Specified by:
        `clear` in interface `Clearable`

    - #### getSignatures

          public java.util.Collection<Tuple> getSignatures()

      Retrieves a read-only collection of exactly those signatures for which at least one tuple is stored
      Returns:
        collection of significant signatures

    - #### iterator

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

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

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### getTotalSize

          public int getTotalSize()

    - #### getKeysetSize

          public int getKeysetSize()