public interface IMemory<T> extends java.lang.Iterable<T>, Clearable
Refined by:
Modifier and Type | Method and Description |
---|---|
boolean |
addOne(T value)
Adds one value occurrence to the memory.
|
boolean |
addSigned(T value,
int count)
Adds the given number of occurrences to the memory.
|
void |
clear()
Empties out the memory.
|
void |
clearAllOf(T value)
Removes all occurrences of the given value from the memory.
|
boolean |
containsNonZero(T value) |
int |
getCount(T value)
Returns the number of occurrences of the given value.
|
boolean |
isEmpty() |
java.util.Set<T> |
keySet()
The set of distinct values
|
boolean |
removeOne(T value)
Removes one occurrence of the given value from the memory.
|
int |
size() |
int getCount(T value)
boolean containsNonZero(T value)
boolean addOne(T value)
IDeltaBag
) is no longer present in the memoryboolean addSigned(T value, int count)
Precondition if IMultiset
: at least the given amount of occurrences exist, if count is negative.
count
- the number of occurrencesjava.lang.IllegalStateException
- if IMultiset
and the number of occurrences in the memory would underflow to negativeboolean removeOne(T value)
Precondition if IMultiset
: the value must have a positive amount of occurrences in the memory.
void clearAllOf(T value)
int size()
boolean isEmpty()
java.util.Set<T> keySet()