Top Description Constructors Methods
org.eclipse.collections.impl.set.mutable

public Class UnmodifiableMutableSet<T>

extends AbstractUnmodifiableMutableCollection<T>
implements MutableSet<T>, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, org.eclipse.collections.api.set.MutableSet, java.lang.Cloneable, org.eclipse.collections.api.set.MutableSetIterable, java.util.Set, java.util.Collection, java.lang.Iterable, org.eclipse.collections.api.collection.MutableCollection, org.eclipse.collections.api.RichIterable, org.eclipse.collections.api.InternalIterable, org.eclipse.collections.api.set.SetIterable, org.eclipse.collections.api.set.UnsortedSetIterable
Imports
java.io.Serializable, java.util.Collection, .Set, java.util.concurrent.ExecutorService, org.eclipse.collections.api.LazyIterable, org.eclipse.collections.api.block.function.Function, .Function2, org.eclipse.collections.api.block.function.primitive.BooleanFunction, .ByteFunction, .CharFunction, .DoubleFunction, .FloatFunction, .IntFunction, .LongFunction, .ShortFunction, 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.multimap.set.MutableSetMultimap, org.eclipse.collections.api.ordered.OrderedIterable, org.eclipse.collections.api.partition.set.PartitionMutableSet, org.eclipse.collections.api.set.ImmutableSet, .MutableSet, .ParallelUnsortedSetIterable, .SetIterable, .UnsortedSetIterable, org.eclipse.collections.api.set.primitive.MutableBooleanSet, .MutableByteSet, .MutableCharSet, .MutableDoubleSet, .MutableFloatSet, .MutableIntSet, .MutableLongSet, .MutableShortSet, org.eclipse.collections.api.tuple.Pair, org.eclipse.collections.impl.collection.mutable.AbstractUnmodifiableMutableCollection, .UnmodifiableCollectionSerializationProxy

An unmodifiable view of a list.
See Also
MutableSet#asUnmodifiable()

Constructor Summary

AccessConstructor and Description
pack-priv
UnmodifiableMutableSet(MutableSet<? extends T> mutableSet)

Method Summary

Modifier and TypeMethod and Description
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 MutableSet<T>
public MutableSet<T>
public <B> LazyIterable<Pair<T, B>>
cartesianProduct(SetIterable<B> set)

Implements org.eclipse.collections.api.set.SetIterable.cartesianProduct.

Returns the set whose members are all possible ordered pairs (a, b) where a is a member of this and b is a member of set.

public UnmodifiableMutableSet<T>
clone()

Overrides java.lang.Object.clone.

Implements org.eclipse.collections.api.set.MutableSet.clone.

Creates and returns a copy of this object.

public <V> MutableSet<V>
collect(Function<? super T, ? extends V> function)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractUnmodifiableMutableCollection.collect.

Implements org.eclipse.collections.api.set.MutableSet.collect, org.eclipse.collections.api.collection.MutableCollection.collect.

Returns a new collection with the results of applying the specified function on each element of the source collection.

public MutableBooleanSet
collectBoolean(BooleanFunction<? super T> booleanFunction)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractUnmodifiableMutableCollection.collectBoolean.

Overrides default org.eclipse.collections.api.set.MutableSet.collectBoolean, org.eclipse.collections.api.collection.MutableCollection.collectBoolean.

Returns a new primitive boolean iterable with the results of applying the specified function on each element of the source collection.

public MutableByteSet
collectByte(ByteFunction<? super T> byteFunction)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractUnmodifiableMutableCollection.collectByte.

Overrides default org.eclipse.collections.api.set.MutableSet.collectByte, org.eclipse.collections.api.collection.MutableCollection.collectByte.

Returns a new primitive byte iterable with the results of applying the specified function on each element of the source collection.

public MutableCharSet
collectChar(CharFunction<? super T> charFunction)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractUnmodifiableMutableCollection.collectChar.

Overrides default org.eclipse.collections.api.set.MutableSet.collectChar, org.eclipse.collections.api.collection.MutableCollection.collectChar.

Returns a new primitive char iterable with the results of applying the specified function on each element of the source collection.

public MutableDoubleSet
collectDouble(DoubleFunction<? super T> doubleFunction)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractUnmodifiableMutableCollection.collectDouble.

Overrides default org.eclipse.collections.api.set.MutableSet.collectDouble, org.eclipse.collections.api.collection.MutableCollection.collectDouble.

Returns a new primitive double iterable with the results of applying the specified function on each element of the source collection.

public MutableFloatSet
collectFloat(FloatFunction<? super T> floatFunction)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractUnmodifiableMutableCollection.collectFloat.

Overrides default org.eclipse.collections.api.set.MutableSet.collectFloat, org.eclipse.collections.api.collection.MutableCollection.collectFloat.

Returns a new primitive float iterable with the results of applying the specified function on each element of the source collection.

public <V> MutableSet<V>
collectIf(Predicate<? super T> predicate, Function<? super T, ? extends V> function)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractUnmodifiableMutableCollection.collectIf.

Implements org.eclipse.collections.api.set.MutableSet.collectIf, org.eclipse.collections.api.collection.MutableCollection.collectIf.

Returns a new collection with the results of applying the specified function on each element of the source collection, but only for those elements which return true upon evaluation of the predicate.

public MutableIntSet
collectInt(IntFunction<? super T> intFunction)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractUnmodifiableMutableCollection.collectInt.

Overrides default org.eclipse.collections.api.set.MutableSet.collectInt, org.eclipse.collections.api.collection.MutableCollection.collectInt.

Returns a new primitive int iterable with the results of applying the specified function on each element of the source collection.

public MutableLongSet
collectLong(LongFunction<? super T> longFunction)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractUnmodifiableMutableCollection.collectLong.

Overrides default org.eclipse.collections.api.set.MutableSet.collectLong, org.eclipse.collections.api.collection.MutableCollection.collectLong.

Returns a new primitive long iterable with the results of applying the specified function on each element of the source collection.

public MutableShortSet
collectShort(ShortFunction<? super T> shortFunction)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractUnmodifiableMutableCollection.collectShort.

Overrides default org.eclipse.collections.api.set.MutableSet.collectShort, org.eclipse.collections.api.collection.MutableCollection.collectShort.

Returns a new primitive short iterable with the results of applying the specified function on each element of the source collection.

public <P, A> MutableSet<A>
public MutableSet<T>
difference(SetIterable<? extends T> subtrahendSet)

Implements org.eclipse.collections.api.set.MutableSet.difference.

Returns the set of all members of this that are not members of subtrahendSet.

public <R extends Set<T>> R
differenceInto(SetIterable<? extends T> subtrahendSet, R targetSet)

Implements org.eclipse.collections.api.set.SetIterable.differenceInto.

Same as difference(SetIterable) but adds all the objects to targetSet and returns it.

public boolean
public <V> MutableSet<V>
protected MutableSet<T>
public <V> MutableSetMultimap<V, T>
groupBy(Function<? super T, ? extends V> function)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractUnmodifiableMutableCollection.groupBy.

Implements org.eclipse.collections.api.set.MutableSet.groupBy, org.eclipse.collections.api.collection.MutableCollection.groupBy.

For each element of the iterable, the function is evaluated and the results of these evaluations are collected into a new multimap, where the transformed value is the key and the original values are added to the same (or similar) species of collection as the source iterable.

public <V> MutableSetMultimap<V, T>
public int
public MutableSet<T>
intersect(SetIterable<? extends T> set)

Implements org.eclipse.collections.api.set.MutableSet.intersect.

Returns the set of all objects that are members of both this and set.

public <R extends Set<T>> R
intersectInto(SetIterable<? extends T> set, R targetSet)

Implements org.eclipse.collections.api.set.SetIterable.intersectInto.

Same as intersect(SetIterable) but adds all the objects to targetSet and returns it.

public boolean
isProperSubsetOf(SetIterable<? extends T> candidateSuperset)

Implements org.eclipse.collections.api.set.SetIterable.isProperSubsetOf.

Returns true if all the members of this are also members of candidateSuperset and the two sets are not equal.

public boolean
isSubsetOf(SetIterable<? extends T> candidateSuperset)

Implements org.eclipse.collections.api.set.SetIterable.isSubsetOf.

Returns true if all the members of this are also members of candidateSuperset.

public MutableSet<T>
public static <E, S extends Set<E>> UnmodifiableMutableSet<E>
of(S set)

Hides java.util.Set.of.

This method will take a MutableSet and wrap it directly in a UnmodifiableMutableSet.

public PartitionMutableSet<T>
public <P> PartitionMutableSet<T>
public MutableSet<UnsortedSetIterable<T>>
powerSet()

Implements org.eclipse.collections.api.set.MutableSet.powerSet.

Returns the set whose members are all possible subsets of this.

public MutableSet<T>
reject(Predicate<? super T> predicate)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractUnmodifiableMutableCollection.reject.

Implements org.eclipse.collections.api.set.MutableSet.reject, org.eclipse.collections.api.collection.MutableCollection.reject.

Returns all elements of the source collection that return false when evaluating of the predicate.

public <P> MutableSet<T>
public MutableSet<T>
public <S> MutableSet<S>
public <P> MutableSet<T>
public MutableSet<T>
symmetricDifference(SetIterable<? extends T> setB)

Implements org.eclipse.collections.api.set.MutableSet.symmetricDifference.

Returns the set of all objects that are a member of exactly one of this and setB (elements which are in one of the sets, but not in both).

public <R extends Set<T>> R
symmetricDifferenceInto(SetIterable<? extends T> set, R targetSet)

Implements org.eclipse.collections.api.set.SetIterable.symmetricDifferenceInto.

Same as symmetricDifference(SetIterable) but adds all the objects to targetSet and returns it.

public MutableSet<T>
public ImmutableSet<T>
public MutableSet<T>
union(SetIterable<? extends T> set)

Implements org.eclipse.collections.api.set.MutableSet.union.

Returns the set of all objects that are a member of this or set or both.

public <R extends Set<T>> R
unionInto(SetIterable<? extends T> set, R targetSet)

Implements org.eclipse.collections.api.set.SetIterable.unionInto.

Same as union(SetIterable) but adds all the objects to targetSet and returns it.

public MutableSet<T>
with(T element)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractUnmodifiableMutableCollection.with.

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

Implements org.eclipse.collections.api.collection.MutableCollection.with.

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

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

Overrides org.eclipse.collections.impl.collection.mutable.AbstractUnmodifiableMutableCollection.withAll.

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

Implements org.eclipse.collections.api.collection.MutableCollection.withAll.

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

public MutableSet<T>
without(T element)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractUnmodifiableMutableCollection.without.

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

Implements org.eclipse.collections.api.collection.MutableCollection.without.

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

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

Overrides org.eclipse.collections.impl.collection.mutable.AbstractUnmodifiableMutableCollection.withoutAll.

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

Implements org.eclipse.collections.api.collection.MutableCollection.withoutAll.

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

protected Object
public <S> MutableSet<Pair<T, S>>
zip(Iterable<S> that)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractUnmodifiableMutableCollection.zip.

Implements org.eclipse.collections.api.set.MutableSet.zip, org.eclipse.collections.api.collection.MutableCollection.zip.

Deprecated in 6.0. Use OrderedIterable#zip(Iterable) instead.

Returns a RichIterable formed from this RichIterable and another RichIterable by combining corresponding elements in pairs.

public <S, R extends Collection<Pair<T, S>>> R
public MutableSet<Pair<T, Integer>>
public <R extends Collection<Pair<T, Integer>>> R
Inherited from org.eclipse.collections.impl.collection.mutable.AbstractUnmodifiableMutableCollection:
addaddAlladdAllIterableallSatisfyallSatisfyWithanySatisfyanySatisfyWithappendStringappendStringappendStringasLazychunkclearcollectcollectBooleancollectBytecollectCharcollectDoublecollectFloatcollectIfcollectIntcollectLongcollectShortcollectWithcontainscontainsAllcontainsAllArgumentscontainsAllIterablecontainsAnycontainsAnyIterablecontainsNonecontainsNoneIterablecountcountWithdetectdetectIfNonedetectOptionaldetectWithdetectWithIfNonedetectWithOptionaleachflatCollectflatCollectBooleanflatCollectByteflatCollectCharflatCollectDoubleflatCollectFloatflatCollectIntflatCollectLongflatCollectShortforEachWithforEachWithIndexgetFirstgetLastgetMutableCollectiongetOnlygroupBygroupByEachgroupByUniqueKeygroupByUniqueKeyinjectIntoinjectIntoinjectIntoinjectIntoinjectIntoinjectIntoWithintoisEmptyiteratormakeStringmakeStringmakeStringmaxmaxmaxByminminminBynoneSatisfynoneSatisfyWithnotEmptyrejectrejectWithremoveremoveAllremoveAllIterableremoveIfremoveIfWithretainAllretainAllIterableselectselectAndRejectWithselectWithsizesumByDoublesumByFloatsumByIntsumByLongsumOfDoublesumOfFloatsumOfIntsumOfLongtoArraytoArraytoBagtoBiMaptoListtoMaptoMaptoSettoSortedBagtoSortedBagtoSortedListtoSortedListtoSortedMaptoSortedMaptoSortedMapBytoSortedSettoSortedSettoString