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

public final Class SortedSetAdapter<T>

extends AbstractCollectionAdapter<T>
implements Serializable, MutableSortedSet<T>
Class Inheritance
All Implemented Interfaces
org.eclipse.collections.api.set.sorted.MutableSortedSet, java.lang.Cloneable, java.util.SortedSet, java.util.SequencedSet, java.util.Set, java.util.Collection, java.lang.Iterable, java.util.SequencedCollection, org.eclipse.collections.api.set.sorted.SortedSetIterable, org.eclipse.collections.api.ordered.ReversibleIterable, org.eclipse.collections.api.ordered.OrderedIterable, org.eclipse.collections.api.RichIterable, org.eclipse.collections.api.InternalIterable, org.eclipse.collections.api.ordered.SortedIterable, java.lang.Comparable, org.eclipse.collections.api.set.SetIterable, org.eclipse.collections.api.set.MutableSetIterable, org.eclipse.collections.api.collection.MutableCollection, java.io.Serializable
Imports
java.io.Serializable, java.util.Collection, .Comparator, .Iterator, .NoSuchElementException, .Set, .SortedSet, java.util.concurrent.ExecutorService, org.eclipse.collections.api.LazyIterable, .RichIterable, 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.block.procedure.primitive.ObjectIntProcedure, org.eclipse.collections.api.factory.Lists, .SortedSets, org.eclipse.collections.api.factory.primitive.BooleanLists, .ByteLists, .CharLists, .DoubleLists, .FloatLists, .IntLists, .LongLists, .ShortLists, org.eclipse.collections.api.list.MutableList, org.eclipse.collections.api.list.primitive.MutableBooleanList, .MutableByteList, .MutableCharList, .MutableDoubleList, .MutableFloatList, .MutableIntList, .MutableLongList, .MutableShortList, org.eclipse.collections.api.ordered.OrderedIterable, org.eclipse.collections.api.partition.set.sorted.PartitionMutableSortedSet, org.eclipse.collections.api.set.SetIterable, org.eclipse.collections.api.set.sorted.ImmutableSortedSet, .MutableSortedSet, .ParallelSortedSetIterable, .SortedSetIterable, org.eclipse.collections.api.tuple.Pair, org.eclipse.collections.impl.block.factory.Comparators, .Functions, org.eclipse.collections.impl.block.procedure.CollectionAddProcedure, .PartitionPredicate2Procedure, .PartitionProcedure, .SelectInstancesOfProcedure, org.eclipse.collections.impl.collection.mutable.AbstractCollectionAdapter, org.eclipse.collections.impl.lazy.parallel.set.sorted.NonParallelSortedSetIterable, org.eclipse.collections.impl.multimap.set.sorted.TreeSortedSetMultimap, org.eclipse.collections.impl.partition.set.sorted.PartitionTreeSortedSet, org.eclipse.collections.impl.utility.ArrayIterate, .Iterate, .ListIterate, .OrderedIterate, org.eclipse.collections.impl.utility.internal.IterableIterate, .SetIterables, .SetIterate, .SortedSetIterables

This class provides a MutableSortedSet wrapper around a JDK Collections SortedSet interface instance. All the MutableSortedSet interface methods are supported in addition to the JDK SortedSet interface methods.

To create a new wrapper around an existing SortedSet instance, use the adapt(SortedSet) factory method.

Field Summary

Modifier and TypeField and Description
private final SortedSet<T>
private static final long

Constructor Summary

AccessConstructor and Description
pack-priv
SortedSetAdapter(SortedSet<T> newDelegate)

Method Summary

Modifier and TypeMethod and Description
public static <T> MutableSortedSet<T>
adapt(SortedSet<T> set)

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

Implements org.eclipse.collections.api.set.SetIterable.asParallel, org.eclipse.collections.api.set.sorted.SortedSetIterable.asParallel.

Returns a parallel iterable of this SortedSetIterable.

public MutableSortedSet<T>
public MutableSortedSet<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 MutableSortedSet<T>
clone()

Overrides java.lang.Object.clone.

Implements org.eclipse.collections.api.set.sorted.MutableSortedSet.clone.

Creates and returns a copy of this object.

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

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

Implements org.eclipse.collections.api.set.sorted.MutableSortedSet.collect, org.eclipse.collections.api.collection.MutableCollection.collect.

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

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

Overrides default org.eclipse.collections.api.collection.MutableCollection.collectBoolean.

Implements org.eclipse.collections.api.set.sorted.MutableSortedSet.collectBoolean.

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

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

Overrides default org.eclipse.collections.api.collection.MutableCollection.collectByte.

Implements org.eclipse.collections.api.set.sorted.MutableSortedSet.collectByte.

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

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

Overrides default org.eclipse.collections.api.collection.MutableCollection.collectChar.

Implements org.eclipse.collections.api.set.sorted.MutableSortedSet.collectChar.

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

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

Overrides default org.eclipse.collections.api.collection.MutableCollection.collectDouble.

Implements org.eclipse.collections.api.set.sorted.MutableSortedSet.collectDouble.

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

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

Overrides default org.eclipse.collections.api.collection.MutableCollection.collectFloat.

Implements org.eclipse.collections.api.set.sorted.MutableSortedSet.collectFloat.

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

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

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

Implements org.eclipse.collections.api.set.sorted.MutableSortedSet.collectIf, org.eclipse.collections.api.collection.MutableCollection.collectIf.

Returns a new MutableCollection with the results of applying the specified function to each element of the source collection, but only for elements that evaluate to true for the specified predicate.

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

Overrides default org.eclipse.collections.api.collection.MutableCollection.collectInt.

Implements org.eclipse.collections.api.set.sorted.MutableSortedSet.collectInt.

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

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

Overrides default org.eclipse.collections.api.collection.MutableCollection.collectLong.

Implements org.eclipse.collections.api.set.sorted.MutableSortedSet.collectLong.

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

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

Overrides default org.eclipse.collections.api.collection.MutableCollection.collectShort.

Implements org.eclipse.collections.api.set.sorted.MutableSortedSet.collectShort.

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

public <P, V> MutableList<V>
public Comparator<? super T>
comparator()

Implements org.eclipse.collections.api.set.sorted.SortedSetIterable.comparator, java.util.SortedSet.comparator.

Returns the comparator used to order the elements in this set, or null if this set uses the natural ordering of its elements.

public int
compareTo(SortedSetIterable<T> o)

Implements java.lang.Comparable.compareTo.

Compares this object with the specified object for order.

public boolean
public boolean
public <S> boolean
corresponds(OrderedIterable<S> other, Predicate2<? super T, ? super S> predicate)

Implements org.eclipse.collections.api.ordered.OrderedIterable.corresponds.

Returns true if both OrderedIterables have the same length and predicate returns true for all corresponding elements e1 of this OrderedIterable and e2 of other.

public int
detectIndex(Predicate<? super T> predicate)

Implements org.eclipse.collections.api.ordered.OrderedIterable.detectIndex.

Returns the index of the first element of the OrderedIterable for which the predicate evaluates to true.

public int
detectLastIndex(Predicate<? super T> predicate)

Implements org.eclipse.collections.api.ordered.ReversibleIterable.detectLastIndex.

Returns the index of the last element of the ReversibleIterable for which the predicate evaluates to true.

public MutableSortedSet<T>
difference(SetIterable<? extends T> subtrahendSet)

Implements org.eclipse.collections.api.set.sorted.MutableSortedSet.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 MutableSortedSet<T>
distinct()

Implements org.eclipse.collections.api.set.sorted.MutableSortedSet.distinct.

Returns a new SortedIterable containing the distinct elements in this iterable.

public MutableSortedSet<T>
drop(int count)

Implements org.eclipse.collections.api.set.sorted.MutableSortedSet.drop.

Returns an iterable after skipping the first count elements or an empty iterable if the count is greater than the length of the iterable.

public MutableSortedSet<T>
dropWhile(Predicate<? super T> predicate)

Implements org.eclipse.collections.api.set.sorted.MutableSortedSet.dropWhile.

Returns the final elements that do not satisfy the Predicate.

public boolean
public T
first()

Implements java.util.SortedSet.first.

Returns the first (lowest) element currently in this set.

public <V> MutableList<V>
public void
forEach(int fromIndex, int toIndex, Procedure<? super T> procedure)

Implements org.eclipse.collections.api.ordered.OrderedIterable.forEach.

Iterates over the section of the iterable covered by the specified inclusive indexes.

public void
forEachWithIndex(int fromIndex, int toIndex, ObjectIntProcedure<? super T> objectIntProcedure)

Implements org.eclipse.collections.api.ordered.OrderedIterable.forEachWithIndex.

Iterates over the section of the iterable covered by the specified inclusive indexes.

protected SortedSet<T>
public T
getFirst()

Overrides org.eclipse.collections.impl.collection.mutable.AbstractCollectionAdapter.getFirst.

Overrides default org.eclipse.collections.api.set.sorted.MutableSortedSet.getFirst.

Implements org.eclipse.collections.api.RichIterable.getFirst.

This default override exists because java.util.SortedSet added a default getFirst() method in Java 21.

public T
getLast()

Overrides org.eclipse.collections.impl.collection.mutable.AbstractCollectionAdapter.getLast.

Overrides default org.eclipse.collections.api.set.sorted.MutableSortedSet.getLast.

Implements org.eclipse.collections.api.RichIterable.getLast.

This default override exists because java.util.SortedSet added a default getLast() method in Java 21.

public <V> TreeSortedSetMultimap<V, T>
groupBy(Function<? super T, ? extends V> function)

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

Implements org.eclipse.collections.api.set.sorted.MutableSortedSet.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> TreeSortedSetMultimap<V, T>
public int
public MutableSortedSet<T>
headSet(T toElement)

Implements org.eclipse.collections.api.set.sorted.MutableSortedSet.headSet.

Returns a view of the portion of this set whose elements are strictly less than toElement.

public int
indexOf(Object object)

Overrides default org.eclipse.collections.api.ordered.OrderedIterable.indexOf.

Returns the index of the first occurrence of the specified item in this iterable, or -1 if this iterable does not contain the item.

public MutableSortedSet<T>
intersect(SetIterable<? extends T> set)

Implements org.eclipse.collections.api.set.sorted.MutableSortedSet.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 T
last()

Implements java.util.SortedSet.last.

Returns the last (highest) element currently in this set.

public MutableSortedSet<T>
newEmpty()

Implements org.eclipse.collections.api.set.sorted.MutableSortedSet.newEmpty, org.eclipse.collections.api.collection.MutableCollection.newEmpty.

Deprecated use TreeSortedSet#newSet() instead (inlineable)

Creates a new empty mutable version of the same collection type.

public PartitionMutableSortedSet<T>
public PartitionMutableSortedSet<T>
partitionWhile(Predicate<? super T> predicate)

Implements org.eclipse.collections.api.set.sorted.MutableSortedSet.partitionWhile.

Returns a Partition of the initial elements that satisfy the Predicate and the remaining elements.

public <P> PartitionMutableSortedSet<T>
public MutableSortedSet<SortedSetIterable<T>>
powerSet()

Implements org.eclipse.collections.api.set.sorted.MutableSortedSet.powerSet.

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

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

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

Implements org.eclipse.collections.api.set.sorted.MutableSortedSet.reject, org.eclipse.collections.api.collection.MutableCollection.reject.

Returns a MutableCollection with all elements that evaluate to false for the specified predicate.

public <P> MutableSortedSet<T>
rejectWith(Predicate2<? super T, ? super P> predicate, P parameter)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractCollectionAdapter.rejectWith.

Implements org.eclipse.collections.api.set.sorted.MutableSortedSet.rejectWith, org.eclipse.collections.api.collection.MutableCollection.rejectWith.

Returns a MutableCollection with all elements that evaluate to false for the specified predicate2 and parameter.

public boolean
public void
reverseForEach(Procedure<? super T> procedure)

Overrides default org.eclipse.collections.api.ordered.ReversibleIterable.reverseForEach.

Evaluates the procedure for each element of the list iterating in reverse order.

public void
reverseForEachWithIndex(ObjectIntProcedure<? super T> procedure)

Overrides default org.eclipse.collections.api.ordered.ReversibleIterable.reverseForEachWithIndex.

Evaluates the procedure for each element and it's index in reverse order.

public MutableSortedSet<T>
select(Predicate<? super T> predicate)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractCollectionAdapter.select.

Implements org.eclipse.collections.api.set.sorted.MutableSortedSet.select, org.eclipse.collections.api.collection.MutableCollection.select.

Returns a MutableCollection with all elements that evaluate to true for the specified predicate.

public <S> MutableSortedSet<S>
public <P> MutableSortedSet<T>
selectWith(Predicate2<? super T, ? super P> predicate, P parameter)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractCollectionAdapter.selectWith.

Implements org.eclipse.collections.api.set.sorted.MutableSortedSet.selectWith, org.eclipse.collections.api.collection.MutableCollection.selectWith.

Returns a MutableCollection with all elements that evaluate to true for the specified predicate2 and parameter.

public MutableSortedSet<T>
subSet(T fromElement, T toElement)

Implements org.eclipse.collections.api.set.sorted.MutableSortedSet.subSet.

Returns a view of the portion of this set whose elements range from fromElement, inclusive, to toElement, exclusive.

public MutableSortedSet<T>
symmetricDifference(SetIterable<? extends T> setB)

Implements org.eclipse.collections.api.set.sorted.MutableSortedSet.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 MutableSortedSet<T>
tailSet(T fromElement)

Implements org.eclipse.collections.api.set.sorted.MutableSortedSet.tailSet.

Returns a view of the portion of this set whose elements are greater than or equal to fromElement.

public MutableSortedSet<T>
take(int count)

Implements org.eclipse.collections.api.set.sorted.MutableSortedSet.take.

Returns the first count elements of the iterable or all the elements in the iterable if count is greater than the length of the iterable.

public MutableSortedSet<T>
takeWhile(Predicate<? super T> predicate)

Implements org.eclipse.collections.api.set.sorted.MutableSortedSet.takeWhile.

Returns the initial elements that satisfy the Predicate.

public MutableSortedSet<T>
public ImmutableSortedSet<T>
public MutableSortedSet<T>
toReversed()

Implements org.eclipse.collections.api.set.sorted.MutableSortedSet.toReversed.

Returns a new ReversibleIterable in reverse order.

public MutableSortedSet<T>
union(SetIterable<? extends T> set)

Implements org.eclipse.collections.api.set.sorted.MutableSortedSet.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 SortedSetAdapter<T>
with(T element)

Overrides default org.eclipse.collections.api.set.sorted.MutableSortedSet.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 SortedSetAdapter<T>
with(T element1, T element2)

public SortedSetAdapter<T>
with(T element1, T element2, T element3)

public SortedSetAdapter<T>
with(T... elements)

Overrides default org.eclipse.collections.api.set.sorted.MutableSortedSet.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 SortedSetAdapter<T>
withAll(Iterable<? extends T> elements)

Overrides default org.eclipse.collections.api.set.sorted.MutableSortedSet.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 SortedSetAdapter<T>
without(T element)

Overrides default org.eclipse.collections.api.set.sorted.MutableSortedSet.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 SortedSetAdapter<T>
withoutAll(Iterable<? extends T> elements)

Overrides default org.eclipse.collections.api.set.sorted.MutableSortedSet.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.

public <S> MutableList<Pair<T, S>>
zip(Iterable<S> that)

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

Implements org.eclipse.collections.api.set.sorted.MutableSortedSet.zip, org.eclipse.collections.api.collection.MutableCollection.zip.

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

public MutableSortedSet<Pair<T, Integer>>
Inherited from org.eclipse.collections.impl.collection.mutable.AbstractCollectionAdapter:
addaddAlladdAllIterableallSatisfyallSatisfyWithanySatisfyanySatisfyWithappendStringasLazychunkclearcollectcollectBooleancollectBytecollectCharcollectDoublecollectFloatcollectIfcollectIntcollectLongcollectShortcollectWithcontainsAllArgumentscontainsAllIterablecountcountWithdetectdetectIfNonedetectOptionaldetectWithdetectWithIfNonedetectWithOptionaleachflatCollectforEachWithforEachWithIndexgetOnlygroupBygroupByEachgroupByUniqueKeygroupByUniqueKeyinjectIntoinjectIntoinjectIntoinjectIntoinjectIntoinjectIntoWithintoisEmptyiteratormaxmaxmaxByminminminBynoneSatisfynoneSatisfyWithnotEmptyrejectrejectWithremoveremoveAllremoveIfremoveIfWithretainAllretainAllIterableselectselectAndRejectWithselectWithsizesumByDoublesumByFloatsumByIntsumByLongsumOfDoublesumOfFloatsumOfIntsumOfLongtoArraytoArraytoBagtoBiMaptoListtoMaptoMaptoSettoSortedBagtoSortedBagtoSortedListtoSortedMaptoSortedMaptoSortedSettoSortedSettoStringwrapzipzipWithIndex