Class EclipseCollectionsLongMultiset
java.lang.Object
org.eclipse.collections.impl.primitive.AbstractIntIterable
org.eclipse.collections.impl.map.mutable.primitive.AbstractMutableIntValuesMap
org.eclipse.collections.impl.map.mutable.primitive.LongIntHashMap
tools.refinery.interpreter.matchers.util.EclipseCollectionsLongMultiset
- All Implemented Interfaces:
Externalizable,Serializable,Iterable<Long>,org.eclipse.collections.api.IntIterable,org.eclipse.collections.api.map.primitive.IntValuesMap,org.eclipse.collections.api.map.primitive.LongIntMap,org.eclipse.collections.api.map.primitive.MutableIntValuesMap,org.eclipse.collections.api.map.primitive.MutableLongIntMap,org.eclipse.collections.api.PrimitiveIterable,org.eclipse.collections.impl.map.mutable.primitive.MutableLongKeysMap,org.eclipse.collections.impl.map.primitive.LongKeysMap,Clearable,IMemory<Long>,IMemoryView<Long>,IMultiset<Long>
public class EclipseCollectionsLongMultiset
extends org.eclipse.collections.impl.map.mutable.primitive.LongIntHashMap
implements IMultiset<Long>
- Since:
- 2.0
TODO refactor common methods with
EclipseCollectionsMultisetTODO refactor into LongBagMemory etc.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.collections.impl.map.mutable.primitive.AbstractMutableIntValuesMap
org.eclipse.collections.impl.map.mutable.primitive.AbstractMutableIntValuesMap.AbstractIntValuesCollection, org.eclipse.collections.impl.map.mutable.primitive.AbstractMutableIntValuesMap.SentinelValues -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds one value occurrence to the memory.booleanaddPositive(Long value, int count) Adds the given number of occurrences to the memory.booleanAdds the given number of occurrences to the memory.voidclearAllOf(Long value) Removes all occurrences of the given value from the memory.booleancontainsNonZero(Long value) booleancontainsNonZeroUnsafe(Object value) The set of distinct valuesbooleanvoidforEachEntryWithMultiplicities(BiConsumer<Long, Integer> entryConsumer) Process contained values with their multiplicitiesintReturns the number of occurrences of the given value.intgetCountUnsafe(Object value) Returns the number of occurrences of the given value (which may be of any type).inthashCode()iterator()booleanRemoves one occurrence of the given value from the memory.protected booleanremoveOneInternal(Long value, boolean throwIfImpossible) booleanremoveOneOrNop(Long value) Removes one occurrence of the given value from the memory, if possible.Methods inherited from class org.eclipse.collections.impl.map.mutable.primitive.LongIntHashMap
addToValue, allocateTable, allSatisfyKeyValue, asSynchronized, asUnmodifiable, clear, compact, containsKey, flipUniqueValues, forEachKey, forEachKeyValue, get, getAndPut, 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, trimToSize, updateValue, updateValues, values, withKeysValues, withKeysValues, withKeysValues, withKeyValue, withoutAllKeys, withoutKey, writeExternalMethods inherited from class org.eclipse.collections.impl.map.mutable.primitive.AbstractMutableIntValuesMap
addEmptyKeyValue, addRemovedKeyValue, allSatisfy, anySatisfy, appendString, chunk, collect, contains, containsAll, containsValue, count, detectIfNone, each, forEachValue, isEmpty, max, min, notEmpty, reject, removeEmptyKey, removeRemovedKey, select, size, sum, toArray, toArrayMethods inherited from class org.eclipse.collections.impl.primitive.AbstractIntIterable
asLazy, average, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedListMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface tools.refinery.interpreter.matchers.util.IMemoryView
asMap, asStream, entriesWithMultiplicities, isEmpty, size, theContainedVersionOf, theContainedVersionOfUnsafeMethods inherited from interface org.eclipse.collections.api.IntIterable
allSatisfy, anySatisfy, asLazy, average, averageIfEmpty, chunk, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, contains, containsAll, containsAll, containsAny, containsAny, containsNone, containsNone, count, detectIfNone, each, flatCollect, forEach, injectIntoBoolean, injectIntoByte, injectIntoChar, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, injectIntoShort, max, maxIfEmpty, median, medianIfEmpty, min, minIfEmpty, noneSatisfy, reduce, reduceIfEmpty, reject, select, sum, summaryStatistics, toArray, toArray, toBag, toList, toSet, toSortedArray, toSortedList, toSortedList, toSortedListBy, toSortedListByMethods inherited from interface org.eclipse.collections.api.map.primitive.IntValuesMap
containsValue, forEachValue, tapMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.eclipse.collections.api.map.primitive.LongIntMap
injectIntoKeyValueMethods inherited from interface org.eclipse.collections.impl.map.primitive.LongKeysMap
isEmpty, notEmpty, sizeMethods inherited from interface org.eclipse.collections.api.map.primitive.MutableIntValuesMap
collect, reject, selectMethods inherited from interface org.eclipse.collections.api.map.primitive.MutableLongIntMap
putPair, withAllKeyValuesMethods inherited from interface org.eclipse.collections.api.PrimitiveIterable
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size
-
Constructor Details
-
EclipseCollectionsLongMultiset
public EclipseCollectionsLongMultiset()
-
-
Method Details
-
addOne
Description copied from interface:IMemoryAdds one value occurrence to the memory. -
addSigned
Description copied from interface:IMemoryAdds the given number of occurrences to the memory. The count value may or may not be negative.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. -
removeOne
Description copied from interface:IMemoryRemoves one occurrence of the given value from the memory.Precondition if
IMultisetorISetMemory: the value must have a positive amount of occurrences in the memory. -
removeOneOrNop
Description copied from interface:IMemoryRemoves one occurrence of the given value from the memory, if possible.Memory is unchanged and false is returned if
IMultisetorISetMemoryand value had no occurrences in the memory- Specified by:
removeOneOrNopin interfaceIMemory<Long>- Returns:
- true if this was the the last occurrence of the value, or
(in case of
IDeltaBag) is the first negative occurrence of the value - Since:
- 2.3
-
removeOneInternal
- Since:
- 2.3
-
clearAllOf
Description copied from interface:IMemoryRemoves all occurrences of the given value from the memory.- Specified by:
clearAllOfin interfaceIMemory<Long>
-
getCount
Description copied from interface:IMemoryViewReturns the number of occurrences of the given value.- Specified by:
getCountin interfaceIMemoryView<Long>- Returns:
- the number of occurrences
-
getCountUnsafe
Description copied from interface:IMemoryViewReturns the number of occurrences of the given value (which may be of any type).- Specified by:
getCountUnsafein interfaceIMemoryView<Long>- Returns:
- the number of occurrences
-
containsNonZero
- Specified by:
containsNonZeroin interfaceIMemoryView<Long>- Returns:
- true if the given value is contained with a nonzero multiplicity
-
containsNonZeroUnsafe
- Specified by:
containsNonZeroUnsafein interfaceIMemoryView<Long>- Returns:
- true if the given value (which may be of any type) is contained with a nonzero multiplicity
-
iterator
-
addPositive
Description copied from interface:IMultisetAdds the given number of occurrences to the memory. The count value must be a positive number.- Specified by:
addPositivein interfaceIMultiset<Long>- Parameters:
count- the number of occurrences- Returns:
- true if the tuple was not present before in the memory
-
distinctValues
Description copied from interface:IMemoryViewThe set of distinct values- Specified by:
distinctValuesin interfaceIMemoryView<Long>
-
forEachEntryWithMultiplicities
Description copied from interface:IMemoryViewProcess contained values with their multiplicities- Specified by:
forEachEntryWithMultiplicitiesin interfaceIMemoryView<Long>
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceorg.eclipse.collections.api.map.primitive.LongIntMap- Overrides:
hashCodein classorg.eclipse.collections.impl.map.mutable.primitive.LongIntHashMap
-
equals
- Specified by:
equalsin interfaceorg.eclipse.collections.api.map.primitive.LongIntMap- Overrides:
equalsin classorg.eclipse.collections.impl.map.mutable.primitive.LongIntHashMap
-