Class EclipseCollectionsSetMemory<Value>
- java.lang.Object
-
- org.eclipse.collections.impl.AbstractRichIterable<T>
-
- org.eclipse.collections.impl.collection.mutable.AbstractMutableCollection<T>
-
- org.eclipse.collections.impl.set.AbstractUnifiedSet<T>
-
- org.eclipse.collections.impl.set.mutable.UnifiedSet<Value>
-
- org.eclipse.viatra.query.runtime.matchers.util.EclipseCollectionsSetMemory<Value>
-
- All Implemented Interfaces:
java.io.Externalizable
,java.io.Serializable
,java.lang.Cloneable
,java.lang.Iterable<Value>
,java.util.Collection<Value>
,java.util.Set<Value>
,org.eclipse.collections.api.collection.MutableCollection<Value>
,org.eclipse.collections.api.InternalIterable<Value>
,org.eclipse.collections.api.RichIterable<Value>
,org.eclipse.collections.api.set.MutableSet<Value>
,org.eclipse.collections.api.set.MutableSetIterable<Value>
,org.eclipse.collections.api.set.Pool<Value>
,org.eclipse.collections.api.set.SetIterable<Value>
,org.eclipse.collections.api.set.UnsortedSetIterable<Value>
,org.eclipse.collections.impl.parallel.BatchIterable<Value>
,Clearable
,IMemory<Value>
,IMemoryView<Value>
,ISetMemory<Value>
public class EclipseCollectionsSetMemory<Value> extends org.eclipse.collections.impl.set.mutable.UnifiedSet<Value> implements ISetMemory<Value>
- Since:
- 2.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description EclipseCollectionsSetMemory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addOne(Value value)
Adds one value occurrence to the memory.boolean
addSigned(Value value, int count)
Adds the given number of occurrences to the memory.void
clearAllOf(Value value)
Removes all occurrences of the given value from the memory.boolean
containsNonZero(Value value)
boolean
containsNonZeroUnsafe(java.lang.Object value)
java.util.Set<Value>
distinctValues()
The set of distinct valuesboolean
equals(java.lang.Object obj)
int
getCount(Value 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
removeOne(Value value)
Removes one occurrence of the given value from the memory.boolean
removeOneOrNop(Value value)
Removes one occurrence of the given value from the memory, if possible.Value
theContainedVersionOf(Value value)
Where supported, returns the stored element that is equal to the given value, or null if none.Value
theContainedVersionOfUnsafe(java.lang.Object value)
Where supported, returns the stored element that is equal to the given value (of any type), or null if none.-
Methods inherited from class org.eclipse.collections.impl.set.mutable.UnifiedSet
add, addAllIterable, allocateTable, asParallel, batchForEach, clear, clone, contains, copySet, detect, detectOptional, each, each, forEachWith, forEachWithIndex, get, getFirst, getLast, getTable, groupBy, groupByEach, index, iterator, newEmpty, newEmpty, newSet, newSet, newSet, newSet, newSetWith, partition, partitionWith, put, readExternal, rehash, reject, rejectWith, remove, removeFromPool, retainAllIterable, select, selectAndRejectWith, selectInstancesOf, selectWith, shortCircuit, shortCircuitWith, size, tap, toArray, toArray, toImmutable, trimToSize, with, with, with, with, withAll, without, withoutAll, writeExternal
-
Methods inherited from class org.eclipse.collections.impl.set.AbstractUnifiedSet
allocate, allSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, asSynchronized, asUnmodifiable, cartesianProduct, chunk, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, computeMaxSize, detect, detectOptional, difference, differenceInto, flatCollect, getBatchCount, groupByUniqueKey, init, injectIntoWith, intersect, intersectInto, isProperSubsetOf, isSubsetOf, noneSatisfy, noneSatisfyWith, powerSet, rehash, removeAllIterable, retainAll, shortCircuit, symmetricDifference, symmetricDifferenceInto, union, unionInto, zip, zipWithIndex
-
Methods inherited from class org.eclipse.collections.impl.collection.mutable.AbstractMutableCollection
addAll, countBy, countByEach, countByWith, reduce, removeAll, removeIf, removeIfWith, sumByDouble, sumByFloat, sumByInt, sumByLong
-
Methods inherited from class org.eclipse.collections.impl.AbstractRichIterable
appendString, appendString, asLazy, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, containsAll, containsAllArguments, containsAllIterable, count, countWith, detectWith, detectWithIfNone, detectWithOptional, flatCollect, forEach, groupBy, groupByEach, groupByUniqueKey, injectInto, injectInto, injectInto, injectInto, injectInto, into, isEmpty, max, max, maxBy, min, min, minBy, reject, rejectWith, select, selectWith, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toBag, toBiMap, toList, toMap, toSet, toSortedBag, toSortedBag, toSortedBagBy, toSortedListBy, toSortedMap, toSortedMap, toSortedMapBy, toSortedSet, toSortedSet, toSortedSetBy, toString, zip, zipWithIndex
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.viatra.query.runtime.matchers.util.IMemoryView
asMap, asStream, entriesWithMultiplicities, isEmpty, size
-
Methods inherited from interface org.eclipse.viatra.query.runtime.matchers.util.ISetMemory
forEachEntryWithMultiplicities
-
Methods inherited from interface org.eclipse.collections.api.collection.MutableCollection
aggregateBy, aggregateInPlaceBy, countBy, countByEach, countByWith, flatCollectWith, removeIf, removeIfWith, sumByDouble, sumByFloat, sumByInt, sumByLong
-
Methods inherited from interface org.eclipse.collections.api.set.MutableSet
flatCollectWith, toImmutableSet
-
Methods inherited from interface org.eclipse.collections.api.RichIterable
aggregateBy, appendString, appendString, appendString, asLazy, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, containsAll, containsAllArguments, containsAllIterable, containsBy, count, countBy, countByEach, countByWith, countWith, detectIfNone, detectWith, detectWithIfNone, detectWithOptional, flatCollect, flatCollectBoolean, flatCollectByte, flatCollectChar, flatCollectDouble, flatCollectFloat, flatCollectInt, flatCollectLong, flatCollectShort, flatCollectWith, forEach, getAny, getOnly, groupBy, groupByAndCollect, groupByEach, groupByUniqueKey, injectInto, injectInto, injectInto, injectInto, injectInto, into, isEmpty, makeString, makeString, makeString, max, max, maxBy, maxByOptional, maxOptional, maxOptional, min, min, minBy, minByOptional, minOptional, minOptional, notEmpty, reduce, reduceInPlace, reduceInPlace, reject, rejectWith, select, selectWith, summarizeDouble, summarizeFloat, summarizeInt, summarizeLong, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toBag, toBiMap, toImmutableBag, toImmutableBiMap, toImmutableList, toImmutableMap, toImmutableSortedBag, toImmutableSortedBag, toImmutableSortedBagBy, toImmutableSortedList, toImmutableSortedList, toImmutableSortedListBy, toImmutableSortedSet, toImmutableSortedSet, toImmutableSortedSetBy, toList, toMap, toMap, toSet, toSortedBag, toSortedBag, toSortedBagBy, toSortedList, toSortedList, toSortedListBy, toSortedMap, toSortedMap, toSortedMapBy, toSortedSet, toSortedSet, toSortedSetBy, toString, zip, zipWithIndex
-
-
-
-
Method Detail
-
getCount
public int getCount(Value value)
Description copied from interface:IMemoryView
Returns the number of occurrences of the given value.- Specified by:
getCount
in interfaceIMemoryView<Value>
- 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<Value>
- Returns:
- the number of occurrences
-
containsNonZero
public boolean containsNonZero(Value value)
- Specified by:
containsNonZero
in interfaceIMemoryView<Value>
- 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<Value>
- Returns:
- true if the given value (which may be of any type) is contained with a nonzero multiplicity
-
addOne
public boolean addOne(Value value)
Description copied from interface:IMemory
Adds one value occurrence to the memory.
-
addSigned
public boolean addSigned(Value 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(Value 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.
-
removeOneOrNop
public boolean removeOneOrNop(Value 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<Value>
- 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
-
clearAllOf
public void clearAllOf(Value value)
Description copied from interface:IMemory
Removes all occurrences of the given value from the memory.- Specified by:
clearAllOf
in interfaceIMemory<Value>
-
distinctValues
public java.util.Set<Value> distinctValues()
Description copied from interface:IMemoryView
The set of distinct values- Specified by:
distinctValues
in interfaceIMemoryView<Value>
-
theContainedVersionOf
public Value theContainedVersionOf(Value value)
Description copied from interface:IMemoryView
Where supported, returns the stored element that is equal to the given value, or null if none. Useful for canonicalization in case of non-identity equals().For collections that do not support canonicalization, simply returns the argument if contained, null if none.
- Specified by:
theContainedVersionOf
in interfaceIMemoryView<Value>
- Returns:
- a value equal to the argument if such a value is stored, or null if none
-
theContainedVersionOfUnsafe
public Value theContainedVersionOfUnsafe(java.lang.Object value)
Description copied from interface:IMemoryView
Where supported, returns the stored element that is equal to the given value (of any type), or null if none. Useful for canonicalization in case of non-identity equals().For collections that do not support canonicalization, simply returns the argument if contained, null if none.
- Specified by:
theContainedVersionOfUnsafe
in interfaceIMemoryView<Value>
- Returns:
- a value equal to the argument if such a value is stored, or null if none
-
hashCode
public int hashCode()
-
equals
public boolean equals(java.lang.Object obj)
-
-