org.eclipse.incquery.runtime.rete.tuple

## Class TupleMemory

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

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

      public class TupleMemory
      extends java.lang.Object
      implements Clearable, java.util.Collection<Tuple>

  Multiset for tuples. Can contain duplicate occurrences of the same matching.
  Author:
    Gabor Bergmann.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TupleMemory()`

  - ### 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` | `addAll(java.util.Collection<? extends Tuple> arg0)`
    `void` | `clear()` Clear all partial matchings stored in memory
    `boolean` | `contains(java.lang.Object arg0)`
    `boolean` | `containsAll(java.util.Collection<?> arg0)`
    `boolean` | `isEmpty()`
    `java.util.Iterator<Tuple>` | `iterator()`
    `boolean` | `remove(java.lang.Object arg0)`
    `boolean` | `remove(Tuple ps)` Removes a pattern occurence from the memory
    `boolean` | `removeAll(java.util.Collection<?> arg0)`
    `boolean` | `retainAll(java.util.Collection<?> arg0)`
    `int` | `size()`
    `java.lang.Object[]` | `toArray()`
    `<T> T[]` | `toArray(T[] arg0)`
    `java.lang.String` | `toString()`

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

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

    - ### Methods inherited from interface java.util.Collection

      `equals, hashCode, parallelStream, removeIf, spliterator, stream`

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

      `forEach`

- - ### Constructor Detail

    - #### TupleMemory

          public TupleMemory()

  - ### Method Detail

    - #### add

          public boolean add(Tuple ps)

      Adds a pattern occurence to the memory
      Specified by:
        `add` in interface `java.util.Collection<Tuple>`
      Returns:
        true if a new pattern is entered

    - #### remove

          public boolean remove(Tuple ps)

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

    - #### clear

          public void clear()

      Description copied from interface: `Clearable`
      Clear all partial matchings stored in memory
      Specified by:
        `clear` in interface `java.util.Collection<Tuple>`
      Specified by:
        `clear` in interface `Clearable`

    - #### iterator

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

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

    - #### addAll

          public boolean addAll(java.util.Collection<? extends Tuple> arg0)

      Specified by:
        `addAll` in interface `java.util.Collection<Tuple>`

    - #### contains

          public boolean contains(java.lang.Object arg0)

      Specified by:
        `contains` in interface `java.util.Collection<Tuple>`

    - #### containsAll

          public boolean containsAll(java.util.Collection<?> arg0)

      Specified by:
        `containsAll` in interface `java.util.Collection<Tuple>`

    - #### isEmpty

          public boolean isEmpty()

      Specified by:
        `isEmpty` in interface `java.util.Collection<Tuple>`

    - #### remove

          public boolean remove(java.lang.Object arg0)

      Specified by:
        `remove` in interface `java.util.Collection<Tuple>`

    - #### removeAll

          public boolean removeAll(java.util.Collection<?> arg0)

      Specified by:
        `removeAll` in interface `java.util.Collection<Tuple>`

    - #### retainAll

          public boolean retainAll(java.util.Collection<?> arg0)

      Specified by:
        `retainAll` in interface `java.util.Collection<Tuple>`

    - #### size

          public int size()

      Specified by:
        `size` in interface `java.util.Collection<Tuple>`

    - #### toArray

          public java.lang.Object[] toArray()

      Specified by:
        `toArray` in interface `java.util.Collection<Tuple>`

    - #### toArray

          public <T> T[] toArray(T[] arg0)

      Specified by:
        `toArray` in interface `java.util.Collection<Tuple>`

    - #### toString

          public java.lang.String toString()

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