public class EclipseCollectionsLongMultiset extends org.eclipse.collections.impl.map.mutable.primitive.LongIntHashMap implements IMultiset<java.lang.Long>
TODO refactor common methods with EclipseCollectionsMultiset
TODO refactor into LongBagMemory etc.
org.eclipse.collections.impl.map.mutable.primitive.AbstractMutableIntValuesMap.AbstractIntValuesCollection, org.eclipse.collections.impl.map.mutable.primitive.AbstractMutableIntValuesMap.SentinelValues| Constructor and Description |
|---|
EclipseCollectionsLongMultiset() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addOne(java.lang.Long value)
Adds one value occurrence to the memory.
|
boolean |
addPositive(java.lang.Long value,
int count)
Adds the given number of occurrences to the memory.
|
boolean |
addSigned(java.lang.Long value,
int count)
Adds the given number of occurrences to the memory.
|
void |
clearAllOf(java.lang.Long value)
Removes all occurrences of the given value from the memory.
|
boolean |
containsNonZero(java.lang.Long value) |
boolean |
containsNonZeroUnsafe(java.lang.Object value) |
java.util.Set<java.lang.Long> |
distinctValues()
The set of distinct values
|
boolean |
equals(java.lang.Object obj) |
void |
forEachEntryWithMultiplicities(java.util.function.BiConsumer<java.lang.Long,java.lang.Integer> entryConsumer)
Process contained values with their multiplicities
|
int |
getCount(java.lang.Long 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<java.lang.Long> |
iterator() |
boolean |
removeOne(java.lang.Long value)
Removes one occurrence of the given value from the memory.
|
protected boolean |
removeOneInternal(java.lang.Long value,
boolean throwIfImpossible) |
boolean |
removeOneOrNop(java.lang.Long value)
Removes one occurrence of the given value from the memory, if possible.
|
addToValue, allocateTable, asSynchronized, asUnmodifiable, clear, compact, containsKey, flipUniqueValues, forEachKey, forEachKeyValue, get, getEmptyValue, getIfAbsent, getIfAbsentPut, getIfAbsentPut, getIfAbsentPutWith, getIfAbsentPutWithKey, getOccupiedWithData, getOrThrow, getSentinelValues, getTableSize, getValueAtIndex, injectInto, intIterator, isNonSentinelAtIndex, keySet, keysView, keyValuesView, newWithKeysValues, newWithKeysValues, newWithKeysValues, newWithKeysValues, put, putAll, readExternal, reject, remove, removeKey, removeKeyIfAbsent, select, setSentinelValuesNull, toImmutable, toString, updateValue, updateValues, values, withKeysValues, withKeysValues, withKeysValues, withKeyValue, withoutAllKeys, withoutKey, writeExternaladdEmptyKeyValue, addRemovedKeyValue, allSatisfy, anySatisfy, appendString, chunk, collect, contains, containsAll, containsValue, count, detectIfNone, each, forEach, forEachValue, isEmpty, max, min, noneSatisfy, notEmpty, reject, removeEmptyKey, removeRemovedKey, select, size, sum, toArrayasLazy, average, containsAll, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedListclone, finalize, getClass, notify, notifyAll, wait, wait, waitasMap, asStream, entriesWithMultiplicities, equals, fromMap, hashCode, isEmpty, size, theContainedVersionOf, theContainedVersionOfUnsafeputPair, withAllKeyValuescollect, reject, selectcontainsValue, forEachValue, tapallSatisfy, anySatisfy, asLazy, average, averageIfEmpty, chunk, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, contains, containsAll, containsAll, count, detectIfNone, each, flatCollect, forEach, max, maxIfEmpty, median, medianIfEmpty, min, minIfEmpty, noneSatisfy, reduce, reduceIfEmpty, reject, select, sum, summaryStatistics, toArray, toBag, toList, toSet, toSortedArray, toSortedListpublic boolean addOne(java.lang.Long value)
IMemorypublic boolean addSigned(java.lang.Long value,
int count)
IMemory Precondition if IMultiset: at least the given amount of occurrences exist, if count is negative.
Precondition if ISetMemory: count is +1 or -1, the latter is only allowed if the set contains the value.
public boolean removeOne(java.lang.Long value)
IMemory Precondition if IMultiset or ISetMemory: the value must have a positive amount of occurrences in the memory.
public boolean removeOneOrNop(java.lang.Long value)
IMemory Memory is unchanged and false is returned if
IMultiset or ISetMemory and value had no occurrences in the memory
removeOneOrNop in interface IMemory<java.lang.Long>IDeltaBag) is the first negative occurrence of the valueprotected boolean removeOneInternal(java.lang.Long value,
boolean throwIfImpossible)
public void clearAllOf(java.lang.Long value)
IMemoryclearAllOf in interface IMemory<java.lang.Long>public int getCount(java.lang.Long value)
IMemoryViewgetCount in interface IMemoryView<java.lang.Long>public int getCountUnsafe(java.lang.Object value)
IMemoryViewgetCountUnsafe in interface IMemoryView<java.lang.Long>public boolean containsNonZero(java.lang.Long value)
containsNonZero in interface IMemoryView<java.lang.Long>public boolean containsNonZeroUnsafe(java.lang.Object value)
containsNonZeroUnsafe in interface IMemoryView<java.lang.Long>public java.util.Iterator<java.lang.Long> iterator()
iterator in interface java.lang.Iterable<java.lang.Long>public boolean addPositive(java.lang.Long value,
int count)
IMultisetaddPositive in interface IMultiset<java.lang.Long>count - the number of occurrencespublic java.util.Set<java.lang.Long> distinctValues()
IMemoryViewdistinctValues in interface IMemoryView<java.lang.Long>public void forEachEntryWithMultiplicities(java.util.function.BiConsumer<java.lang.Long,java.lang.Integer> entryConsumer)
IMemoryViewforEachEntryWithMultiplicities in interface IMemoryView<java.lang.Long>public int hashCode()
hashCode in interface org.eclipse.collections.api.map.primitive.LongIntMaphashCode in class org.eclipse.collections.impl.map.mutable.primitive.LongIntHashMappublic boolean equals(java.lang.Object obj)
equals in interface org.eclipse.collections.api.map.primitive.LongIntMapequals in class org.eclipse.collections.impl.map.mutable.primitive.LongIntHashMap