org.eclipse.viatra.query.runtime.matchers.util

## Interface IMultiset<T>

- All Superinterfaces:
    Clearable, IMemory<T>, IMemoryView<T>, java.lang.Iterable<T>
  All Known Implementing Classes:
    EclipseCollectionsLongMultiset, EclipseCollectionsMultiset

      public interface IMultiset<T>
      extends IMemory<T>

  An `IMemory` that always contains values with a nonnegative multiplicity.

  In case a write operation caused underflow, an `IllegalStateException` is thrown.

  Since:
    1.7

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `addPositive(T value, int count)` Adds the given number of occurrences to the memory.

    - ### Methods inherited from interface org.eclipse.viatra.query.runtime.matchers.util.IMemory

      `addOne, addSigned, clear, clearAllOf, removeOne, removeOneOrNop`

    - ### Methods inherited from interface org.eclipse.viatra.query.runtime.matchers.util.IMemoryView

      `asMap, asStream, containsNonZero, containsNonZeroUnsafe, distinctValues, entriesWithMultiplicities, equals, forEachEntryWithMultiplicities, fromMap, getCount, getCountUnsafe, hashCode, isEmpty, size, theContainedVersionOf, theContainedVersionOfUnsafe`

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

      `forEach, iterator, spliterator`

- - ### Method Detail

    - #### addPositive

          boolean addPositive(T value,
                              int count)

      Adds the given number of occurrences to the memory. The count value must be a positive number.
      Parameters:
        `count` - the number of occurrences
      Returns:
        true if the tuple was not present before in the memory