Top Description Constructors Methods
org.eclipse.collections.impl.set.sorted.immutable

pack-priv abstract Class AbstractImmutableSortedSet<T>

extends AbstractImmutableCollection<T>
implements ImmutableSortedSet<T>, SortedSet<T>
Class Inheritance
All Implemented Interfaces
java.util.SortedSet, java.util.SequencedSet, java.util.Set, java.util.Collection, java.lang.Iterable, java.util.SequencedCollection, org.eclipse.collections.api.set.sorted.ImmutableSortedSet, org.eclipse.collections.api.set.ImmutableSetIterable, org.eclipse.collections.api.collection.ImmutableCollection, org.eclipse.collections.api.RichIterable, org.eclipse.collections.api.InternalIterable, org.eclipse.collections.api.set.SetIterable, org.eclipse.collections.api.set.sorted.SortedSetIterable, org.eclipse.collections.api.ordered.ReversibleIterable, org.eclipse.collections.api.ordered.OrderedIterable, org.eclipse.collections.api.ordered.SortedIterable, java.lang.Comparable
Known Direct Subclasses
org.eclipse.collections.impl.set.sorted.immutable.ImmutableEmptySortedSet, org.eclipse.collections.impl.set.sorted.immutable.ImmutableTreeSet
Imports
java.util.Collection, .Comparator, .Objects, .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.collection.MutableCollection, 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.ImmutableList, .MutableList, org.eclipse.collections.api.list.primitive.ImmutableBooleanList, .ImmutableByteList, .ImmutableCharList, .ImmutableDoubleList, .ImmutableFloatList, .ImmutableIntList, .ImmutableLongList, .ImmutableShortList, .MutableBooleanList, .MutableByteList, .MutableCharList, .MutableDoubleList, .MutableFloatList, .MutableIntList, .MutableLongList, .MutableShortList, org.eclipse.collections.api.multimap.sortedset.ImmutableSortedSetMultimap, org.eclipse.collections.api.ordered.OrderedIterable, org.eclipse.collections.api.partition.set.sorted.PartitionImmutableSortedSet, .PartitionMutableSortedSet, org.eclipse.collections.api.set.SetIterable, org.eclipse.collections.api.set.sorted.ImmutableSortedSet, .MutableSortedSet, .ParallelSortedSetIterable, .SortedSetIterable, org.eclipse.collections.api.stack.MutableStack, org.eclipse.collections.api.tuple.Pair, org.eclipse.collections.impl.block.factory.Comparators, .Functions, .Predicates, org.eclipse.collections.impl.block.procedure.CollectIfProcedure, .CollectProcedure, .FlatCollectProcedure, .PartitionPredicate2Procedure, .PartitionProcedure, .RejectProcedure, .SelectInstancesOfProcedure, .SelectProcedure, org.eclipse.collections.impl.collection.immutable.AbstractImmutableCollection, org.eclipse.collections.impl.lazy.parallel.set.sorted.NonParallelSortedSetIterable, org.eclipse.collections.impl.list.mutable.FastList, org.eclipse.collections.impl.multimap.set.sorted.TreeSortedSetMultimap, org.eclipse.collections.impl.partition.set.sorted.PartitionTreeSortedSet, org.eclipse.collections.impl.set.sorted.mutable.TreeSortedSet, org.eclipse.collections.impl.stack.mutable.ArrayStack, org.eclipse.collections.impl.utility.Iterate, .OrderedIterate, org.eclipse.collections.impl.utility.internal.IterableIterate, .SetIterables, .SortedSetIterables

This class is the parent class for all ImmutableSortedSets. All implementations of ImmutableSortedSet must implement the SortedSet interface so an TreeSet.equals(anImmutableSortedSet) can return true when the contents are the same.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public ParallelSortedSetIterable<T>
asParallel(ExecutorService executorService, int batchSize)

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

Returns a parallel iterable of this SortedSetIterable.

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 SortedSet<T>
public <V> ImmutableList<V>
collect(Function<? super T, ? extends V> function)

Implements org.eclipse.collections.api.set.sorted.ImmutableSortedSet.collect, org.eclipse.collections.api.collection.ImmutableCollection.collect, org.eclipse.collections.api.RichIterable.collect.

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

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

Implements org.eclipse.collections.api.set.sorted.ImmutableSortedSet.collectBoolean, org.eclipse.collections.api.collection.ImmutableCollection.collectBoolean, org.eclipse.collections.api.RichIterable.collectBoolean.

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

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

Implements org.eclipse.collections.api.set.sorted.ImmutableSortedSet.collectByte, org.eclipse.collections.api.collection.ImmutableCollection.collectByte, org.eclipse.collections.api.RichIterable.collectByte.

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

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

Implements org.eclipse.collections.api.set.sorted.ImmutableSortedSet.collectChar, org.eclipse.collections.api.collection.ImmutableCollection.collectChar, org.eclipse.collections.api.RichIterable.collectChar.

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

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

Implements org.eclipse.collections.api.set.sorted.ImmutableSortedSet.collectDouble, org.eclipse.collections.api.collection.ImmutableCollection.collectDouble, org.eclipse.collections.api.RichIterable.collectDouble.

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

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

Implements org.eclipse.collections.api.set.sorted.ImmutableSortedSet.collectFloat, org.eclipse.collections.api.collection.ImmutableCollection.collectFloat, org.eclipse.collections.api.RichIterable.collectFloat.

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

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

Implements org.eclipse.collections.api.set.sorted.ImmutableSortedSet.collectIf, org.eclipse.collections.api.collection.ImmutableCollection.collectIf, org.eclipse.collections.api.RichIterable.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 ImmutableIntList
collectInt(IntFunction<? super T> intFunction)

Implements org.eclipse.collections.api.set.sorted.ImmutableSortedSet.collectInt, org.eclipse.collections.api.collection.ImmutableCollection.collectInt, org.eclipse.collections.api.RichIterable.collectInt.

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

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

Implements org.eclipse.collections.api.set.sorted.ImmutableSortedSet.collectLong, org.eclipse.collections.api.collection.ImmutableCollection.collectLong, org.eclipse.collections.api.RichIterable.collectLong.

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

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

Implements org.eclipse.collections.api.set.sorted.ImmutableSortedSet.collectShort, org.eclipse.collections.api.collection.ImmutableCollection.collectShort, org.eclipse.collections.api.RichIterable.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> ImmutableList<V>
collectWith(Function2<? super T, ? super P, ? extends V> function, P parameter)

Implements org.eclipse.collections.api.set.sorted.ImmutableSortedSet.collectWith, org.eclipse.collections.api.collection.ImmutableCollection.collectWith, org.eclipse.collections.api.RichIterable.collectWith.

Same as collect(Function) with a Function2 and specified parameter which is passed to the block.

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 ImmutableSortedSet<T>
difference(SetIterable<? extends T> subtrahendSet)

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

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

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

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

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

Returns the final elements that do not satisfy the Predicate.

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

Implements org.eclipse.collections.api.set.sorted.ImmutableSortedSet.groupBy, org.eclipse.collections.api.collection.ImmutableCollection.groupBy, org.eclipse.collections.api.RichIterable.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> ImmutableSortedSetMultimap<V, T>
groupByEach(Function<? super T, ? extends Iterable<V>> function)

Implements org.eclipse.collections.api.set.sorted.ImmutableSortedSet.groupByEach, org.eclipse.collections.api.collection.ImmutableCollection.groupByEach, org.eclipse.collections.api.RichIterable.groupByEach.

Similar to groupBy(Function), except the result of evaluating function will return a collection of keys for each value.

public SortedSet<T>
headSet(T toElement)

Implements java.util.SortedSet.headSet.

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

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

Implements org.eclipse.collections.api.set.sorted.ImmutableSortedSet.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.

protected MutableCollection<T>
public ImmutableSortedSet<T>
newWith(T element)

Implements org.eclipse.collections.api.set.sorted.ImmutableSortedSet.newWith, org.eclipse.collections.api.collection.ImmutableCollection.newWith.

This method is similar to the with method in MutableCollection with the difference that a new copy of this collection with the element appended will be returned.

public ImmutableSortedSet<T>
newWithAll(Iterable<? extends T> elements)

Implements org.eclipse.collections.api.set.sorted.ImmutableSortedSet.newWithAll, org.eclipse.collections.api.collection.ImmutableCollection.newWithAll.

This method is similar to the withAll method in MutableCollection with the difference that a new copy of this collection with the elements appended will be returned.

public ImmutableSortedSet<T>
newWithout(T element)

Implements org.eclipse.collections.api.set.sorted.ImmutableSortedSet.newWithout, org.eclipse.collections.api.collection.ImmutableCollection.newWithout.

This method is similar to the without method in MutableCollection with the difference that a new copy of this collection with the element removed will be returned.

public ImmutableSortedSet<T>
newWithoutAll(Iterable<? extends T> elements)

Implements org.eclipse.collections.api.set.sorted.ImmutableSortedSet.newWithoutAll, org.eclipse.collections.api.collection.ImmutableCollection.newWithoutAll.

This method is similar to the withoutAll method in MutableCollection with the difference that a new copy of this collection with the elements removed will be returned.

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

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

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

public <P> PartitionImmutableSortedSet<T>
partitionWith(Predicate2<? super T, ? super P> predicate, P parameter)

Implements org.eclipse.collections.api.set.sorted.ImmutableSortedSet.partitionWith, org.eclipse.collections.api.collection.ImmutableCollection.partitionWith, org.eclipse.collections.api.RichIterable.partitionWith.

Filters a collection into a PartitionIterable based on the evaluation of the predicate.

public ImmutableSortedSet<SortedSetIterable<T>>
powerSet()

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

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

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

Implements org.eclipse.collections.api.set.sorted.ImmutableSortedSet.reject, org.eclipse.collections.api.collection.ImmutableCollection.reject, org.eclipse.collections.api.RichIterable.reject.

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

public <P> ImmutableSortedSet<T>
public ImmutableSortedSet<T>
select(Predicate<? super T> predicate)

Implements org.eclipse.collections.api.set.sorted.ImmutableSortedSet.select, org.eclipse.collections.api.collection.ImmutableCollection.select, org.eclipse.collections.api.RichIterable.select.

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

public <S> ImmutableSortedSet<S>
public <P> ImmutableSortedSet<T>
public SortedSet<T>
subSet(T fromElement, T toElement)

Implements java.util.SortedSet.subSet.

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

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

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

Implements java.util.SortedSet.tailSet.

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

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

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

Returns the initial elements that satisfy the Predicate.

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

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

Returns a new ReversibleIterable in reverse order.

public MutableStack<T>
toStack()

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

Converts the OrderedIterable to a mutable MutableStack implementation.

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

Implements org.eclipse.collections.api.set.sorted.ImmutableSortedSet.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 <S> ImmutableList<Pair<T, S>>
zip(Iterable<S> that)

Implements org.eclipse.collections.api.set.sorted.ImmutableSortedSet.zip, org.eclipse.collections.api.collection.ImmutableCollection.zip, org.eclipse.collections.api.RichIterable.zip.

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

public ImmutableSortedSet<Pair<T, Integer>>
Inherited from org.eclipse.collections.impl.collection.immutable.AbstractImmutableCollection:
addaddAllcastToCollectionchunkclearcountBycountByEachcountByWithgroupByUniqueKeyparallelStreamreduceremoveremoveAllremoveAllFromretainAllspliteratorstreamsumByDoublesumByFloatsumByIntsumByLongtoArraytoArray