Class AbstractMemoryEfficientMutableSet<T>
java.lang.Object
org.eclipse.collections.impl.AbstractRichIterable<T>
org.eclipse.collections.impl.collection.mutable.AbstractMutableCollection<T>
org.eclipse.collections.impl.set.mutable.AbstractMutableSet<T>
org.eclipse.collections.impl.set.fixed.AbstractMemoryEfficientMutableSet<T>
- All Implemented Interfaces:
Cloneable, Iterable<T>, Collection<T>, Set<T>, FixedSizeCollection<T>, MutableCollection<T>, InternalIterable<T>, RichIterable<T>, FixedSizeSet<T>, MutableSet<T>, MutableSetIterable<T>, SetIterable<T>, UnsortedSetIterable<T>
- Direct Known Subclasses:
DoubletonSet, EmptySet, QuadrupletonSet, SingletonSet, TripletonSet
abstract class AbstractMemoryEfficientMutableSet<T>
extends AbstractMutableSet<T>
implements FixedSizeSet<T>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddAll(Collection<? extends T> collection) booleanaddAllIterable(Iterable<? extends T> iterable) asParallel(ExecutorService executorService, int batchSize) Returns a parallel iterable of this SetIterable.voidclear()protected intnullSafeHashCode(Object element) booleanbooleanremoveAll(Collection<?> collection) booleanremoveAllIterable(Iterable<?> iterable) booleanRemoves all elements in the collection that evaluate to true for the specified predicate.<P> booleanremoveIfWith(Predicate2<? super T, ? super P> predicate, P parameter) Removes all elements in the collection that evaluate to true for the specified predicate2 and parameter.booleanretainAll(Collection<?> collection) booleanretainAllIterable(Iterable<?> iterable) Executes the Procedure for each element in the iterable and returnsthis.This method allows mutable and fixed size collections the ability to add multiple elements to their existing elements.withoutAll(Iterable<? extends T> elements) This method allows mutable and fixed size collections the ability to remove multiple elements from their existing elements.Methods inherited from class AbstractMutableSet
asSynchronized, asUnmodifiable, cartesianProduct, clone, collect, collectIf, collectWith, difference, differenceInto, flatCollect, groupBy, groupByEach, intersect, intersectInto, isProperSubsetOf, isSubsetOf, newEmpty, newEmptySameSize, partition, partitionWith, powerSet, reject, rejectWith, select, selectInstancesOf, selectWith, symmetricDifference, symmetricDifferenceInto, toImmutable, union, unionInto, zip, zipWithIndexMethods inherited from class AbstractMutableCollection
add, chunk, countBy, countByEach, countByWith, groupByUniqueKey, injectIntoWith, reduce, selectAndRejectWith, sumByDouble, sumByFloat, sumByInt, sumByLongMethods inherited from class AbstractRichIterable
allSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, asLazy, collect, collectIf, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, count, countWith, detect, detectOptional, detectWith, detectWithIfNone, detectWithOptional, flatCollect, forEach, forEachWith, forEachWithIndex, groupBy, groupByEach, groupByUniqueKey, injectInto, injectInto, injectInto, injectInto, injectInto, into, isEmpty, max, max, maxBy, min, min, minBy, noneSatisfy, noneSatisfyWith, 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, zipWithIndexMethods inherited from class Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface FixedSizeCollection
addMethods inherited from interface FixedSizeSet
with, withoutMethods inherited from interface InternalIterable
forEach, forEachWith, forEachWithIndexMethods inherited from interface MutableCollection
aggregateBy, aggregateInPlaceBy, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, countBy, countByEach, countByWith, flatCollect, flatCollectWith, groupByUniqueKey, injectIntoWith, partition, partitionWith, reject, rejectWith, select, selectAndRejectWith, selectInstancesOf, selectWith, sumByDouble, sumByFloat, sumByInt, sumByLong, toArray, toArray, toImmutable, zipWithIndexMethods inherited from interface MutableSet
asSynchronized, asUnmodifiable, clone, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, difference, flatCollect, flatCollectWith, groupBy, groupByEach, intersect, newEmpty, partition, partitionWith, powerSet, reject, rejectWith, select, selectInstancesOf, selectWith, symmetricDifference, toImmutable, toImmutableSet, union, zip, zipWithIndexMethods inherited from interface MutableSetIterable
toArray, toArrayMethods inherited from interface RichIterable
aggregateBy, allSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, appendString, asLazy, chunk, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, containsAny, containsAnyIterable, containsBy, containsNone, containsNoneIterable, count, countBy, countByEach, countByWith, countWith, detect, detectIfNone, detectOptional, detectWith, detectWithIfNone, detectWithOptional, each, flatCollect, flatCollectBoolean, flatCollectByte, flatCollectChar, flatCollectDouble, flatCollectFloat, flatCollectInt, flatCollectLong, flatCollectShort, flatCollectWith, forEach, getAny, getFirst, getLast, 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, noneSatisfy, noneSatisfyWith, notEmpty, reduce, reduceBy, reduceBy, reduceInPlace, reduceInPlace, reject, rejectWith, select, selectWith, size, 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, zipWithIndexMethods inherited from interface Set
add, contains, containsAll, equals, hashCode, isEmpty, iterator, size, spliteratorMethods inherited from interface SetIterable
cartesianProduct, differenceInto, equals, hashCode, intersectInto, isProperSubsetOf, isSubsetOf, symmetricDifferenceInto, unionInto
-
Constructor Details
-
AbstractMemoryEfficientMutableSet
AbstractMemoryEfficientMutableSet()
-
-
Method Details
-
nullSafeHashCode
-
addAll
- Specified by:
addAllin interfaceCollection<T>- Specified by:
addAllin interfaceFixedSizeCollection<T>- Specified by:
addAllin interfaceSet<T>- Overrides:
addAllin classAbstractMutableCollection<T>
-
addAllIterable
- Specified by:
addAllIterablein interfaceFixedSizeCollection<T>- Specified by:
addAllIterablein interfaceMutableCollection<T>- Overrides:
addAllIterablein classAbstractMutableCollection<T>- See Also:
-
retainAll
- Specified by:
retainAllin interfaceCollection<T>- Specified by:
retainAllin interfaceFixedSizeCollection<T>- Specified by:
retainAllin interfaceSet<T>- Overrides:
retainAllin classAbstractMutableCollection<T>
-
retainAllIterable
- Specified by:
retainAllIterablein interfaceFixedSizeCollection<T>- Specified by:
retainAllIterablein interfaceMutableCollection<T>- Overrides:
retainAllIterablein classAbstractMutableCollection<T>- See Also:
-
remove
- Specified by:
removein interfaceCollection<T>- Specified by:
removein interfaceFixedSizeCollection<T>- Specified by:
removein interfaceSet<T>- Overrides:
removein classAbstractMutableCollection<T>
-
removeAll
- Specified by:
removeAllin interfaceCollection<T>- Specified by:
removeAllin interfaceFixedSizeCollection<T>- Specified by:
removeAllin interfaceSet<T>- Overrides:
removeAllin classAbstractMutableCollection<T>
-
removeAllIterable
- Specified by:
removeAllIterablein interfaceFixedSizeCollection<T>- Specified by:
removeAllIterablein interfaceMutableCollection<T>- Overrides:
removeAllIterablein classAbstractMutableSet<T>- See Also:
-
removeIf
Description copied from interface:MutableCollectionRemoves all elements in the collection that evaluate to true for the specified predicate.e.g. return lastNames.removeIf(Predicates.isNull());
- Specified by:
removeIfin interfaceFixedSizeCollection<T>- Specified by:
removeIfin interfaceMutableCollection<T>- Overrides:
removeIfin classAbstractMutableCollection<T>
-
removeIfWith
Description copied from interface:MutableCollectionRemoves all elements in the collection that evaluate to true for the specified predicate2 and parameter.return lastNames.removeIfWith(Predicates2.isNull(), null);
- Specified by:
removeIfWithin interfaceFixedSizeCollection<T>- Specified by:
removeIfWithin interfaceMutableCollection<T>- Overrides:
removeIfWithin classAbstractMutableCollection<T>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<T>- Specified by:
clearin interfaceFixedSizeCollection<T>- Specified by:
clearin interfaceSet<T>
-
withAll
Description copied from interface:MutableCollectionThis method allows mutable and fixed size collections the ability to add multiple elements to their existing elements. In order to support fixed size a new instance of a collection would have to be returned taking the elements of the original collection and appending the new elements to form the new collection. In the case of mutable collections, the original collection is modified, and is returned. In order to use this method properly with mutable and fixed size collections the following approach must be taken:MutableCollection<String> list = list.withAll(FastList.newListWith("1", "2"));In the case ofFixedSizeCollectiona new instance of MutableCollection will be returned by withAll, and any variables that previously referenced the original collection will need to be redirected to reference the new instance. For other MutableCollection types you will replace the reference to collection with the same collection, since the instance will return "this" after calling addAll on itself.- Specified by:
withAllin interfaceFixedSizeCollection<T>- Specified by:
withAllin interfaceFixedSizeSet<T>- Specified by:
withAllin interfaceMutableCollection<T>- Specified by:
withAllin interfaceMutableSet<T>- Specified by:
withAllin interfaceMutableSetIterable<T>- See Also:
-
withoutAll
Description copied from interface:MutableCollectionThis method allows mutable and fixed size collections the ability to remove multiple elements from their existing elements. In order to support fixed size a new instance of a collection would have to be returned containing the elements that would be left from the original collection after calling removeAll. In the case of mutable collections, the original collection is modified, and is returned. In order to use this method properly with mutable and fixed size collections the following approach must be taken:MutableCollection<String> list = list.withoutAll(FastList.newListWith("1", "2"));In the case ofFixedSizeCollectiona new instance of MutableCollection will be returned by withoutAll, and any variables that previously referenced the original collection will need to be redirected to reference the new instance. For other MutableCollection types you will replace the reference to collection with the same collection, since the instance will return "this" after calling removeAll on itself.- Specified by:
withoutAllin interfaceFixedSizeCollection<T>- Specified by:
withoutAllin interfaceFixedSizeSet<T>- Specified by:
withoutAllin interfaceMutableCollection<T>- Specified by:
withoutAllin interfaceMutableSet<T>- Specified by:
withoutAllin interfaceMutableSetIterable<T>- See Also:
-
tap
Description copied from interface:RichIterableExecutes the Procedure for each element in the iterable and returnsthis.Example using a Java 8 lambda expression:
RichIterable<Person> tapped = people.tap(person -> LOGGER.info(person.getName()));- Specified by:
tapin interfaceFixedSizeCollection<T>- Specified by:
tapin interfaceFixedSizeSet<T>- Specified by:
tapin interfaceMutableCollection<T>- Specified by:
tapin interfaceMutableSet<T>- Specified by:
tapin interfaceMutableSetIterable<T>- Specified by:
tapin interfaceRichIterable<T>- Specified by:
tapin interfaceSetIterable<T>- Specified by:
tapin interfaceUnsortedSetIterable<T>- Overrides:
tapin classAbstractMutableSet<T>- See Also:
-
asParallel
Description copied from interface:SetIterableReturns a parallel iterable of this SetIterable.- Specified by:
asParallelin interfaceSetIterable<T>- Specified by:
asParallelin interfaceUnsortedSetIterable<T>
-