Class EclipseCollectionsSetMemory<Value>
java.lang.Object
org.eclipse.collections.impl.AbstractRichIterable<Value>
org.eclipse.collections.impl.collection.mutable.AbstractMutableCollection<Value>
org.eclipse.collections.impl.set.AbstractUnifiedSet<Value>
org.eclipse.collections.impl.set.mutable.UnifiedSet<Value>
tools.refinery.interpreter.matchers.util.EclipseCollectionsSetMemory<Value>
- All Implemented Interfaces:
Externalizable
,Serializable
,Cloneable
,Iterable<Value>
,Collection<Value>
,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:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.collections.impl.set.mutable.UnifiedSet
org.eclipse.collections.impl.set.mutable.UnifiedSet.PositionalIterator
-
Field Summary
Fields inherited from class org.eclipse.collections.impl.set.mutable.UnifiedSet
NULL_KEY, occupied, table
Fields inherited from class org.eclipse.collections.impl.set.AbstractUnifiedSet
DEFAULT_INITIAL_CAPACITY, DEFAULT_LOAD_FACTOR, loadFactor, maxSize
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Adds one value occurrence to the memory.boolean
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
(Object value) The set of distinct valuesboolean
int
Returns the number of occurrences of the given value.int
getCountUnsafe
(Object value) Returns the number of occurrences of the given value (which may be of any type).int
hashCode()
boolean
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.theContainedVersionOf
(Value value) Where supported, returns the stored element that is equal to the given value, or null if none.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, collectIf, 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, collectIf, 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.collections.impl.parallel.BatchIterable
forEach
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface tools.refinery.interpreter.matchers.util.IMemoryView
asMap, asStream, entriesWithMultiplicities, isEmpty, size
Methods inherited from interface org.eclipse.collections.api.InternalIterable
forEach
Methods inherited from interface tools.refinery.interpreter.matchers.util.ISetMemory
forEachEntryWithMultiplicities
Methods inherited from interface org.eclipse.collections.api.collection.MutableCollection
aggregateBy, aggregateInPlaceBy, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, countBy, countByEach, countByWith, flatCollectWith, removeIf, removeIfWith, sumByDouble, sumByFloat, sumByInt, sumByLong
Methods inherited from interface org.eclipse.collections.api.set.MutableSet
collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, 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, containsAny, containsAnyIterable, containsBy, containsNone, containsNoneIterable, 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, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, into, isEmpty, makeString, 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
Methods inherited from interface java.util.Set
addAll, containsAll, isEmpty, removeAll, spliterator
-
Constructor Details
-
EclipseCollectionsSetMemory
public EclipseCollectionsSetMemory()
-
-
Method Details
-
getCount
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
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
- Specified by:
containsNonZero
in interfaceIMemoryView<Value>
- Returns:
- true if the given value is contained with a nonzero multiplicity
-
containsNonZeroUnsafe
- 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
Description copied from interface:IMemory
Adds one value occurrence to the memory. -
addSigned
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
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
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
Description copied from interface:IMemory
Removes all occurrences of the given value from the memory.- Specified by:
clearAllOf
in interfaceIMemory<Value>
-
distinctValues
Description copied from interface:IMemoryView
The set of distinct values- Specified by:
distinctValues
in interfaceIMemoryView<Value>
-
theContainedVersionOf
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
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
-