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
-
- org.eclipse.viatra.query.runtime.matchers.util.EclipseCollectionsLongMultiset
-
- All Implemented Interfaces:
java.io.Externalizable,java.io.Serializable,java.lang.Iterable<java.lang.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<java.lang.Long>,IMemoryView<java.lang.Long>,IMultiset<java.lang.Long>
public class EclipseCollectionsLongMultiset extends org.eclipse.collections.impl.map.mutable.primitive.LongIntHashMap implements IMultiset<java.lang.Long>
- Since:
- 2.0
TODO refactor common methods with
EclipseCollectionsMultisetTODO refactor into LongBagMemory etc.
- See Also:
- Serialized Form
-
-
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 Constructor Description EclipseCollectionsLongMultiset()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddOne(java.lang.Long value)Adds one value occurrence to the memory.booleanaddPositive(java.lang.Long value, int count)Adds the given number of occurrences to the memory.booleanaddSigned(java.lang.Long value, int count)Adds the given number of occurrences to the memory.voidclearAllOf(java.lang.Long value)Removes all occurrences of the given value from the memory.booleancontainsNonZero(java.lang.Long value)booleancontainsNonZeroUnsafe(java.lang.Object value)java.util.Set<java.lang.Long>distinctValues()The set of distinct valuesbooleanequals(java.lang.Object obj)voidforEachEntryWithMultiplicities(java.util.function.BiConsumer<java.lang.Long,java.lang.Integer> entryConsumer)Process contained values with their multiplicitiesintgetCount(java.lang.Long value)Returns the number of occurrences of the given value.intgetCountUnsafe(java.lang.Object value)Returns the number of occurrences of the given value (which may be of any type).inthashCode()java.util.Iterator<java.lang.Long>iterator()booleanremoveOne(java.lang.Long value)Removes one occurrence of the given value from the memory.protected booleanremoveOneInternal(java.lang.Long value, boolean throwIfImpossible)booleanremoveOneOrNop(java.lang.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, 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, writeExternal
-
Methods inherited from class org.eclipse.collections.impl.map.mutable.primitive.AbstractMutableIntValuesMap
addEmptyKeyValue, 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, toArray, toArray
-
Methods inherited from class org.eclipse.collections.impl.primitive.AbstractIntIterable
asLazy, average, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedList
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.viatra.query.runtime.matchers.util.IMemoryView
asMap, asStream, entriesWithMultiplicities, isEmpty, size, theContainedVersionOf, theContainedVersionOfUnsafe
-
Methods 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, max, maxIfEmpty, median, medianIfEmpty, min, minIfEmpty, noneSatisfy, reduce, reduceIfEmpty, reject, select, sum, summaryStatistics, toArray, toArray, toBag, toList, toSet, toSortedArray, toSortedList, toSortedList, toSortedListBy, toSortedListBy
-
Methods inherited from interface org.eclipse.collections.api.map.primitive.IntValuesMap
containsValue, forEachValue, tap
-
Methods inherited from interface org.eclipse.collections.impl.map.primitive.LongKeysMap
isEmpty, notEmpty, size
-
Methods inherited from interface org.eclipse.collections.api.map.primitive.MutableIntValuesMap
collect, reject, select
-
-
-
-
Method Detail
-
addOne
public boolean addOne(java.lang.Long value)
Description copied from interface:IMemoryAdds one value occurrence to the memory.
-
addSigned
public boolean addSigned(java.lang.Long value, int count)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
public boolean removeOne(java.lang.Long value)
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
public boolean removeOneOrNop(java.lang.Long value)
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<java.lang.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
protected boolean removeOneInternal(java.lang.Long value, boolean throwIfImpossible)- Since:
- 2.3
-
clearAllOf
public void clearAllOf(java.lang.Long value)
Description copied from interface:IMemoryRemoves all occurrences of the given value from the memory.- Specified by:
clearAllOfin interfaceIMemory<java.lang.Long>
-
getCount
public int getCount(java.lang.Long value)
Description copied from interface:IMemoryViewReturns the number of occurrences of the given value.- Specified by:
getCountin interfaceIMemoryView<java.lang.Long>- Returns:
- the number of occurrences
-
getCountUnsafe
public int getCountUnsafe(java.lang.Object value)
Description copied from interface:IMemoryViewReturns the number of occurrences of the given value (which may be of any type).- Specified by:
getCountUnsafein interfaceIMemoryView<java.lang.Long>- Returns:
- the number of occurrences
-
containsNonZero
public boolean containsNonZero(java.lang.Long value)
- Specified by:
containsNonZeroin interfaceIMemoryView<java.lang.Long>- Returns:
- true if the given value is contained with a nonzero multiplicity
-
containsNonZeroUnsafe
public boolean containsNonZeroUnsafe(java.lang.Object value)
- Specified by:
containsNonZeroUnsafein interfaceIMemoryView<java.lang.Long>- Returns:
- true if the given value (which may be of any type) is contained with a nonzero multiplicity
-
iterator
public java.util.Iterator<java.lang.Long> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<java.lang.Long>
-
addPositive
public boolean addPositive(java.lang.Long value, int count)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<java.lang.Long>count- the number of occurrences- Returns:
- true if the tuple was not present before in the memory
-
distinctValues
public java.util.Set<java.lang.Long> distinctValues()
Description copied from interface:IMemoryViewThe set of distinct values- Specified by:
distinctValuesin interfaceIMemoryView<java.lang.Long>
-
forEachEntryWithMultiplicities
public void forEachEntryWithMultiplicities(java.util.function.BiConsumer<java.lang.Long,java.lang.Integer> entryConsumer)
Description copied from interface:IMemoryViewProcess contained values with their multiplicities- Specified by:
forEachEntryWithMultiplicitiesin interfaceIMemoryView<java.lang.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
public boolean equals(java.lang.Object obj)
- Specified by:
equalsin interfaceorg.eclipse.collections.api.map.primitive.LongIntMap- Overrides:
equalsin classorg.eclipse.collections.impl.map.mutable.primitive.LongIntHashMap
-
-