Interface IMultiset<T>
- All Superinterfaces:
Clearable
,IMemory<T>
,IMemoryView<T>
,Iterable<T>
- All Known Implementing Classes:
EclipseCollectionsLongMultiset
,EclipseCollectionsMultiset
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
Modifier and TypeMethodDescriptionboolean
addPositive
(T value, int count) Adds the given number of occurrences to the memory.Methods inherited from interface tools.refinery.interpreter.matchers.util.IMemory
addOne, addSigned, clear, clearAllOf, removeOne, removeOneOrNop
Methods inherited from interface tools.refinery.interpreter.matchers.util.IMemoryView
asMap, asStream, containsNonZero, containsNonZeroUnsafe, distinctValues, entriesWithMultiplicities, forEachEntryWithMultiplicities, getCount, getCountUnsafe, isEmpty, size, theContainedVersionOf, theContainedVersionOfUnsafe
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
addPositive
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
-