Class EclipseCollectionsLongSetMemory
- java.lang.Object
-
- org.eclipse.collections.impl.primitive.AbstractLongIterable
-
- org.eclipse.collections.impl.set.primitive.AbstractLongSet
-
- org.eclipse.collections.impl.set.mutable.primitive.LongHashSet
-
- org.eclipse.viatra.query.runtime.matchers.util.EclipseCollectionsLongSetMemory
-
- All Implemented Interfaces:
java.io.Externalizable
,java.io.Serializable
,java.lang.Iterable<java.lang.Long>
,org.eclipse.collections.api.collection.primitive.MutableLongCollection
,org.eclipse.collections.api.LongIterable
,org.eclipse.collections.api.PrimitiveIterable
,org.eclipse.collections.api.set.primitive.LongSet
,org.eclipse.collections.api.set.primitive.MutableLongSet
,Clearable
,IMemory<java.lang.Long>
,IMemoryView<java.lang.Long>
,ISetMemory<java.lang.Long>
public class EclipseCollectionsLongSetMemory extends org.eclipse.collections.impl.set.mutable.primitive.LongHashSet implements ISetMemory<java.lang.Long>
- Since:
- 2.0
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EclipseCollectionsLongSetMemory.SetWrapper
Helper that presents a primitive collection as a Set view
-
Constructor Summary
Constructors Constructor Description EclipseCollectionsLongSetMemory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addOne(java.lang.Long value)
Adds one value occurrence 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 valuesboolean
equals(java.lang.Object obj)
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()
boolean
isEmpty()
java.util.Iterator<java.lang.Long>
iterator()
static java.util.Iterator<java.lang.Long>
iteratorOf(org.eclipse.collections.api.LongIterable wrapped)
Helper for iterating a LongIterableboolean
removeOne(java.lang.Long value)
Removes one occurrence of the given value from the memory.boolean
removeOneOrNop(java.lang.Long value)
Removes one occurrence of the given value from the memory, if possible.-
Methods inherited from class org.eclipse.collections.impl.set.mutable.primitive.LongHashSet
add, addAll, addAll, allocateTable, allSatisfy, anySatisfy, appendString, asSynchronized, asUnmodifiable, chunk, clear, collect, collect, compact, contains, count, detectIfNone, each, forEach, freeze, injectInto, longIterator, max, min, newEmpty, newSet, newSetWith, noneSatisfy, readExternal, reject, reject, remove, removeAll, removeAll, retainAll, retainAll, select, select, size, sum, toArray, toArray, toImmutable, with, withAll, without, withoutAll, writeExternal
-
Methods inherited from class org.eclipse.collections.impl.set.primitive.AbstractLongSet
cartesianProduct
-
Methods inherited from class org.eclipse.collections.impl.primitive.AbstractLongIterable
asLazy, average, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedList, toString
-
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, size, theContainedVersionOf, theContainedVersionOfUnsafe
-
Methods inherited from interface org.eclipse.viatra.query.runtime.matchers.util.ISetMemory
forEachEntryWithMultiplicities
-
Methods inherited from interface org.eclipse.collections.api.LongIterable
asLazy, average, averageIfEmpty, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, containsAll, containsAll, containsAny, containsAny, containsNone, containsNone, flatCollect, maxIfEmpty, median, medianIfEmpty, minIfEmpty, reduce, reduceIfEmpty, summaryStatistics, toBag, toList, toSet, toSortedArray, toSortedList, toSortedList, toSortedListBy, toSortedListBy
-
Methods inherited from interface org.eclipse.collections.api.set.primitive.LongSet
cartesianProduct, isProperSubsetOf, isSubsetOf, tap
-
Methods inherited from interface org.eclipse.collections.api.collection.primitive.MutableLongCollection
removeIf
-
-
-
-
Method Detail
-
addOne
public boolean addOne(java.lang.Long value)
Description copied from interface:IMemory
Adds one value occurrence to the memory.
-
addSigned
public boolean addSigned(java.lang.Long value, int count)
Description copied from interface:IMemory
Adds 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:IMemory
Removes one occurrence of the given value from the memory.Precondition if
IMultiset
orISetMemory
: the value must have a positive amount of occurrences in the memory.- Specified by:
removeOne
in interfaceIMemory<java.lang.Long>
- Specified by:
removeOne
in interfaceISetMemory<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
-
removeOneOrNop
public boolean removeOneOrNop(java.lang.Long value)
Description copied from interface:IMemory
Removes one occurrence of the given value from the memory, if possible.Memory is unchanged and false is returned if
IMultiset
orISetMemory
and value had no occurrences in the memory- Specified by:
removeOneOrNop
in 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
-
clearAllOf
public void clearAllOf(java.lang.Long value)
Description copied from interface:IMemory
Removes all occurrences of the given value from the memory.- Specified by:
clearAllOf
in interfaceIMemory<java.lang.Long>
-
getCount
public int getCount(java.lang.Long value)
Description copied from interface:IMemoryView
Returns the number of occurrences of the given value.- Specified by:
getCount
in interfaceIMemoryView<java.lang.Long>
- Returns:
- the number of occurrences
-
getCountUnsafe
public int getCountUnsafe(java.lang.Object value)
Description copied from interface:IMemoryView
Returns the number of occurrences of the given value (which may be of any type).- Specified by:
getCountUnsafe
in interfaceIMemoryView<java.lang.Long>
- Returns:
- the number of occurrences
-
containsNonZero
public boolean containsNonZero(java.lang.Long value)
- Specified by:
containsNonZero
in 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:
containsNonZeroUnsafe
in 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:
iterator
in interfacejava.lang.Iterable<java.lang.Long>
-
distinctValues
public java.util.Set<java.lang.Long> distinctValues()
Description copied from interface:IMemoryView
The set of distinct values- Specified by:
distinctValues
in interfaceIMemoryView<java.lang.Long>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceIMemoryView<java.lang.Long>
- Specified by:
isEmpty
in interfaceorg.eclipse.collections.api.PrimitiveIterable
- Returns:
- iff contains at least one value with non-zero occurrences
-
iteratorOf
public static java.util.Iterator<java.lang.Long> iteratorOf(org.eclipse.collections.api.LongIterable wrapped)
Helper for iterating a LongIterable
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfaceorg.eclipse.collections.api.set.primitive.LongSet
- Overrides:
hashCode
in classorg.eclipse.collections.impl.set.mutable.primitive.LongHashSet
-
equals
public boolean equals(java.lang.Object obj)
- Specified by:
equals
in interfaceorg.eclipse.collections.api.set.primitive.LongSet
- Overrides:
equals
in classorg.eclipse.collections.impl.set.primitive.AbstractLongSet
-
-