public abstract class EclipseCollectionsBagMemory<T> extends org.eclipse.collections.impl.map.mutable.primitive.ObjectIntHashMap<T> implements IMemory<T>
Inherits Eclipse Collections' Object-to-Int primitive hashmap and counts the number of occurrences of each value. Element is deleted if # of occurences drops to 0.
| Constructor and Description |
|---|
EclipseCollectionsBagMemory() |
| Modifier and Type | Method and Description |
|---|---|
void |
clearAllOf(T value)
Removes all occurrences of the given value from the memory.
|
boolean |
containsNonZero(T value) |
boolean |
containsNonZeroUnsafe(java.lang.Object value) |
java.util.Set<T> |
distinctValues()
The set of distinct values
|
boolean |
equals(java.lang.Object obj) |
void |
forEachEntryWithMultiplicities(java.util.function.BiConsumer<T,java.lang.Integer> entryConsumer)
Process contained values with their multiplicities
|
int |
getCount(T value)
Returns the number of occurrences of the given value.
|
int |
getCountUnsafe(java.lang.Object value)
Returns the number of occurrences of the given value (which may be of any type).
|
int |
hashCode() |
java.util.Iterator<T> |
iterator() |
java.lang.String |
toString() |
addToValue, allocateTable, allSatisfy, anySatisfy, appendString, appendString, appendString, asLazy, asSynchronized, asUnmodifiable, average, chunk, clear, collect, compact, contains, containsAll, containsAll, containsKey, containsValue, count, detectIfNone, each, flipUniqueValues, forEach, forEachKey, forEachKeyValue, forEachValue, get, getIfAbsent, getIfAbsentPut, getIfAbsentPut, getIfAbsentPutWith, getIfAbsentPutWithKey, getOrThrow, injectInto, intIterator, isEmpty, keySet, keysView, keyValuesView, makeString, makeString, makeString, max, maxIfEmpty, median, min, minIfEmpty, newMap, newWithKeysValues, newWithKeysValues, newWithKeysValues, newWithKeysValues, noneSatisfy, notEmpty, put, putAll, readExternal, reject, reject, remove, removeKey, removeKeyIfAbsent, select, select, size, sum, toArray, toBag, toImmutable, toList, toSet, toSortedArray, toSortedList, updateValue, updateValues, values, withKeysValues, withKeysValues, withKeysValues, withKeyValue, withoutAllKeys, withoutKey, writeExternalclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddOne, addSigned, clear, removeOne, removeOneOrNopasMap, asStream, entriesWithMultiplicities, equals, fromMap, hashCode, isEmpty, size, theContainedVersionOf, theContainedVersionOfUnsafepublic int getCount(T value)
IMemoryViewgetCount in interface IMemoryView<T>public int getCountUnsafe(java.lang.Object value)
IMemoryViewgetCountUnsafe in interface IMemoryView<T>public boolean containsNonZero(T value)
containsNonZero in interface IMemoryView<T>public boolean containsNonZeroUnsafe(java.lang.Object value)
containsNonZeroUnsafe in interface IMemoryView<T>public void clearAllOf(T value)
IMemoryclearAllOf in interface IMemory<T>public java.util.Iterator<T> iterator()
iterator in interface java.lang.Iterable<T>public java.lang.String toString()
public java.util.Set<T> distinctValues()
IMemoryViewdistinctValues in interface IMemoryView<T>public void forEachEntryWithMultiplicities(java.util.function.BiConsumer<T,java.lang.Integer> entryConsumer)
IMemoryViewforEachEntryWithMultiplicities in interface IMemoryView<T>public int hashCode()
hashCode in class org.eclipse.collections.impl.map.mutable.primitive.ObjectIntHashMap<T>public boolean equals(java.lang.Object obj)
equals in class org.eclipse.collections.impl.map.mutable.primitive.ObjectIntHashMap<T>