Top Inners Constructors Methods
org.eclipse.collections.impl.set.fixed

pack-priv abstract Class AbstractMemoryEfficientMutableSet<T>

extends AbstractMutableSet<T>
implements FixedSizeSet<T>
Class Inheritance
All Implemented Interfaces
org.eclipse.collections.api.set.FixedSizeSet, org.eclipse.collections.api.collection.FixedSizeCollection, org.eclipse.collections.api.collection.MutableCollection, org.eclipse.collections.api.RichIterable, org.eclipse.collections.api.InternalIterable, java.lang.Iterable, java.util.Collection, org.eclipse.collections.api.set.MutableSet, java.lang.Cloneable, org.eclipse.collections.api.set.MutableSetIterable, java.util.Set, org.eclipse.collections.api.set.SetIterable, org.eclipse.collections.api.set.UnsortedSetIterable
Known Direct Subclasses
org.eclipse.collections.impl.set.fixed.DoubletonSet, org.eclipse.collections.impl.set.fixed.EmptySet, org.eclipse.collections.impl.set.fixed.QuadrupletonSet, org.eclipse.collections.impl.set.fixed.SingletonSet, org.eclipse.collections.impl.set.fixed.TripletonSet
Imports
java.util.Collection, .Iterator, java.util.concurrent.ExecutorService, org.eclipse.collections.api.block.predicate.Predicate, .Predicate2, org.eclipse.collections.api.block.procedure.Procedure, org.eclipse.collections.api.factory.Sets, org.eclipse.collections.api.set.FixedSizeSet, .MutableSet, .ParallelUnsortedSetIterable, org.eclipse.collections.impl.set.mutable.AbstractMutableSet, org.eclipse.collections.impl.utility.Iterate

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected abstract class

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public boolean
addAll(Collection<? extends T> collection)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractMutableCollection.addAll.

Implements java.util.Collection.addAll, java.util.Set.addAll, org.eclipse.collections.api.collection.FixedSizeCollection.addAll.

Adds all of the elements in the specified collection to this set if they're not already present (optional operation).

public boolean
public ParallelUnsortedSetIterable<T>
asParallel(ExecutorService executorService, int batchSize)

Implements org.eclipse.collections.api.set.UnsortedSetIterable.asParallel, org.eclipse.collections.api.set.SetIterable.asParallel.

Returns a parallel iterable of this SetIterable.

public void
clear()

Implements java.util.Collection.clear, java.util.Set.clear, org.eclipse.collections.api.collection.FixedSizeCollection.clear.

Removes all of the elements from this set (optional operation).

protected int
public boolean
public boolean
removeAll(Collection<?> collection)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractMutableCollection.removeAll.

Implements java.util.Collection.removeAll, java.util.Set.removeAll, org.eclipse.collections.api.collection.FixedSizeCollection.removeAll.

Removes from this set all of its elements that are contained in the specified collection (optional operation).

public boolean
public boolean
public <P> boolean
removeIfWith(Predicate2<? super T, ? super P> predicate, P parameter)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractMutableCollection.removeIfWith.

Implements org.eclipse.collections.api.collection.MutableCollection.removeIfWith, org.eclipse.collections.api.collection.FixedSizeCollection.removeIfWith.

Removes all elements in the collection that evaluate to true for the specified predicate2 and parameter.

public boolean
retainAll(Collection<?> collection)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractMutableCollection.retainAll.

Implements java.util.Collection.retainAll, java.util.Set.retainAll, org.eclipse.collections.api.collection.FixedSizeCollection.retainAll.

Retains only the elements in this set that are contained in the specified collection (optional operation).

public boolean
public FixedSizeSet<T>
public MutableSet<T>
withAll(Iterable<? extends T> elements)

Overrides default org.eclipse.collections.api.set.MutableSet.withAll.

Implements org.eclipse.collections.api.set.FixedSizeSet.withAll, org.eclipse.collections.api.collection.MutableCollection.withAll.

This method allows fixed size collections the ability to add multiple elements to their existing elements.

public MutableSet<T>
withoutAll(Iterable<? extends T> elements)

Overrides default org.eclipse.collections.api.set.MutableSet.withoutAll.

Implements org.eclipse.collections.api.set.FixedSizeSet.withoutAll, org.eclipse.collections.api.collection.MutableCollection.withoutAll.

This method allows fixed size collections the ability to remove multiple elements from their existing elements.

Inherited from org.eclipse.collections.impl.set.mutable.AbstractMutableSet:
asSynchronizedasUnmodifiablecartesianProductclonecollectcollectIfcollectWithdifferencedifferenceIntoflatCollectgroupBygroupByEachintersectintersectIntoisProperSubsetOfisSubsetOfnewEmptynewEmptySameSizepartitionpartitionWithpowerSetrejectrejectWithselectselectInstancesOfselectWithsymmetricDifferencesymmetricDifferenceIntotoImmutableunionunionIntozipzipWithIndex

Constructor Detail

AbstractMemoryEfficientMutableSetback to summary
pack-priv AbstractMemoryEfficientMutableSet()

Method Detail

addAllback to summary
public boolean addAll(Collection<? extends T> collection)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractMutableCollection.addAll.

Implements java.util.Collection.addAll, java.util.Set.addAll, org.eclipse.collections.api.collection.FixedSizeCollection.addAll.

Doc from java.util.Set.addAll.

Adds all of the elements in the specified collection to this set if they're not already present (optional operation). If the specified collection is also a set, the addAll operation effectively modifies this set so that its value is the union of the two sets. The behavior of this operation is undefined if the specified collection is modified while the operation is in progress.

Annotations
@Override
addAllIterableback to summary
public boolean addAllIterable(Iterable<? extends T> iterable)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractMutableCollection.addAllIterable.

Implements org.eclipse.collections.api.collection.MutableCollection.addAllIterable, org.eclipse.collections.api.collection.FixedSizeCollection.addAllIterable.

Annotations
@Override
asParallelback to summary
public ParallelUnsortedSetIterable<T> asParallel(ExecutorService executorService, int batchSize)

Implements org.eclipse.collections.api.set.UnsortedSetIterable.asParallel, org.eclipse.collections.api.set.SetIterable.asParallel.

Doc from org.eclipse.collections.api.set.SetIterable.asParallel.

Returns a parallel iterable of this SetIterable.

Annotations
@Override
clearback to summary
public void clear()

Implements java.util.Collection.clear, java.util.Set.clear, org.eclipse.collections.api.collection.FixedSizeCollection.clear.

Doc from java.util.Set.clear.

Removes all of the elements from this set (optional operation). The set will be empty after this call returns.

Annotations
@Override
nullSafeHashCodeback to summary
protected int nullSafeHashCode(Object element)
removeback to summary
public boolean remove(Object o)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractMutableCollection.remove.

Implements java.util.Collection.remove, java.util.Set.remove, org.eclipse.collections.api.collection.FixedSizeCollection.remove.

Doc from java.util.Set.remove.

Removes the specified element from this set if it is present (optional operation). More formally, removes an element e such that Objects.equals(o, e), if this set contains such an element. Returns true if this set contained the element (or equivalently, if this set changed as a result of the call). (This set will not contain the element once the call returns.)

Annotations
@Override
removeAllback to summary
public boolean removeAll(Collection<?> collection)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractMutableCollection.removeAll.

Implements java.util.Collection.removeAll, java.util.Set.removeAll, org.eclipse.collections.api.collection.FixedSizeCollection.removeAll.

Doc from java.util.Set.removeAll.

Removes from this set all of its elements that are contained in the specified collection (optional operation). If the specified collection is also a set, this operation effectively modifies this set so that its value is the asymmetric set difference of the two sets.

Annotations
@Override
removeAllIterableback to summary
public boolean removeAllIterable(Iterable<?> iterable)

Overrides org.eclipse.collections.impl.set.mutable.AbstractMutableSet.removeAllIterable.

Implements org.eclipse.collections.api.collection.MutableCollection.removeAllIterable, org.eclipse.collections.api.collection.FixedSizeCollection.removeAllIterable.

Annotations
@Override
removeIfback to summary
public boolean removeIf(Predicate<? super T> predicate)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractMutableCollection.removeIf.

Implements org.eclipse.collections.api.collection.MutableCollection.removeIf, org.eclipse.collections.api.collection.FixedSizeCollection.removeIf.

Doc from org.eclipse.collections.api.collection.MutableCollection.removeIf.

Removes all elements in the collection that evaluate to true for the specified predicate.

e.g.
return lastNames.removeIf(Predicates.isNull());
Annotations
@Override
removeIfWithback to summary
public <P> boolean removeIfWith(Predicate2<? super T, ? super P> predicate, P parameter)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractMutableCollection.removeIfWith.

Implements org.eclipse.collections.api.collection.MutableCollection.removeIfWith, org.eclipse.collections.api.collection.FixedSizeCollection.removeIfWith.

Doc from org.eclipse.collections.api.collection.MutableCollection.removeIfWith.

Removes all elements in the collection that evaluate to true for the specified predicate2 and parameter.

return lastNames.removeIfWith(Predicates2.isNull(), null);
Annotations
@Override
retainAllback to summary
public boolean retainAll(Collection<?> collection)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractMutableCollection.retainAll.

Implements java.util.Collection.retainAll, java.util.Set.retainAll, org.eclipse.collections.api.collection.FixedSizeCollection.retainAll.

Doc from java.util.Set.retainAll.

Retains only the elements in this set that are contained in the specified collection (optional operation). In other words, removes from this set all of its elements that are not contained in the specified collection. If the specified collection is also a set, this operation effectively modifies this set so that its value is the intersection of the two sets.

Annotations
@Override
retainAllIterableback to summary
public boolean retainAllIterable(Iterable<?> iterable)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractMutableCollection.retainAllIterable.

Implements org.eclipse.collections.api.collection.MutableCollection.retainAllIterable, org.eclipse.collections.api.collection.FixedSizeCollection.retainAllIterable.

Annotations
@Override
tapback to summary
public FixedSizeSet<T> tap(Procedure<? super T> procedure)

Overrides org.eclipse.collections.impl.set.mutable.AbstractMutableSet.tap.

Implements org.eclipse.collections.api.set.FixedSizeSet.tap, org.eclipse.collections.api.set.MutableSet.tap, org.eclipse.collections.api.collection.MutableCollection.tap, org.eclipse.collections.api.RichIterable.tap.

Doc from org.eclipse.collections.api.RichIterable.tap.

Executes the Procedure for each element in the iterable and returns this.

Example using a Java 8 lambda expression:

RichIterable<Person> tapped =
    people.tap(person -> LOGGER.info(person.getName()));
Annotations
@Override
withAllback to summary
public MutableSet<T> withAll(Iterable<? extends T> elements)

Overrides default org.eclipse.collections.api.set.MutableSet.withAll.

Implements org.eclipse.collections.api.set.FixedSizeSet.withAll, org.eclipse.collections.api.collection.MutableCollection.withAll.

Doc from org.eclipse.collections.api.collection.FixedSizeCollection.withAll.

This method allows fixed size collections the ability to add multiple elements to their existing elements. A new instance of MutableCollection is returned containing the elements of the original collection with all the new elements addAll(Collection) added. Implementations will return a new FixedSizeCollection where possible. In order to use this method properly with mutable and fixed size collections the following approach must be taken:

MutableCollection<String> list;
list = list.withAll(FastList.newListWith("1", "2"));
return list;
Annotations
@Override
withoutAllback to summary
public MutableSet<T> withoutAll(Iterable<? extends T> elements)

Overrides default org.eclipse.collections.api.set.MutableSet.withoutAll.

Implements org.eclipse.collections.api.set.FixedSizeSet.withoutAll, org.eclipse.collections.api.collection.MutableCollection.withoutAll.

Doc from org.eclipse.collections.api.collection.FixedSizeCollection.withoutAll.

This method allows fixed size collections the ability to remove multiple elements from their existing elements. A new instance of MutableCollection is returned containing the elements of the original collection with the given elements removed. Implementations will return a new FixedSizeCollection where possible. In order to use this method properly with mutable and fixed size collections the following approach must be taken:

MutableCollection<String> list;
list = list.withoutAll(FastList.newListWith("1", "2"));
return list;
Annotations
@Override
org.eclipse.collections.impl.set.fixed back to summary

protected abstract Class AbstractMemoryEfficientMutableSet.MemoryEfficientSetIterator

extends Object
implements Iterator<T>
Class Inheritance
  • java.lang.Object
  • org.eclipse.collections.impl.set.fixed.AbstractMemoryEfficientMutableSet.MemoryEfficientSetIterator
All Implemented Interfaces
java.util.Iterator
Known Direct Subclasses
org.eclipse.collections.impl.set.fixed.DoubletonSet.DoubletonSetIterator, org.eclipse.collections.impl.set.fixed.QuadrupletonSet.QuadrupletonSetIterator, org.eclipse.collections.impl.set.fixed.SingletonSet.SingletonSetIterator, org.eclipse.collections.impl.set.fixed.TripletonSet.TripletonSetIterator

Field Summary

Modifier and TypeField and Description
private int

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
protected abstract T
getElement(int i)

public boolean
hasNext()

Implements java.util.Iterator.hasNext.

Returns true if the iteration has more elements.

public T
next()

Implements java.util.Iterator.next.

Returns the next element in the iteration.

public void
remove()

Overrides default java.util.Iterator.remove.

Removes from the underlying collection the last element returned by this iterator (optional operation).

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

nextback to summary
private int next

Constructor Detail

MemoryEfficientSetIteratorback to summary
protected MemoryEfficientSetIterator()

Method Detail

getElementback to summary
protected abstract T getElement(int i)
hasNextback to summary
public boolean hasNext()

Implements java.util.Iterator.hasNext.

Doc from java.util.Iterator.hasNext.

Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)

Annotations
@Override
nextback to summary
public T next()

Implements java.util.Iterator.next.

Doc from java.util.Iterator.next.

Returns the next element in the iteration.

Annotations
@Override
removeback to summary
public void remove()

Overrides default java.util.Iterator.remove.

Doc from java.util.Iterator.remove.

Removes from the underlying collection the last element returned by this iterator (optional operation). This method can be called only once per call to next.

The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method, unless an overriding class has specified a concurrent modification policy.

The behavior of an iterator is unspecified if this method is called after a call to the forEachRemaining method.

Annotations
@Override