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

pack-priv final Class ImmutableEmptySortedSet<T>

extends AbstractImmutableSortedSet<T>
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.io.Serializable, java.util.Collection, .Comparator, .Iterator, .NoSuchElementException, .Set, org.eclipse.collections.api.block.function.Function, org.eclipse.collections.api.block.function.primitive.ObjectIntToObjectFunction, org.eclipse.collections.api.block.predicate.Predicate, .Predicate2, org.eclipse.collections.api.block.procedure.Procedure, .Procedure2, org.eclipse.collections.api.block.procedure.primitive.ObjectIntProcedure, org.eclipse.collections.api.factory.Lists, .SortedSets, org.eclipse.collections.api.list.ImmutableList, org.eclipse.collections.api.set.sorted.ImmutableSortedSet, .SortedSetIterable, org.eclipse.collections.api.stack.MutableStack, org.eclipse.collections.api.tuple.Pair, org.eclipse.collections.impl.EmptyIterator, org.eclipse.collections.impl.stack.mutable.ArrayStack, org.eclipse.collections.impl.utility.ListIterate

This is a zero element ImmutableSortedSet which is created by calling the SortedSets.immutable.empty() method.

Field Summary

Modifier and TypeField and Description
private final Comparator<? super T>
pack-priv static final ImmutableSortedSet<?>
private static final long

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv
ImmutableEmptySortedSet(Comparator<? super T> comparator)

Method Summary

Modifier and TypeMethod and Description
public <V> ImmutableList<V>
collectWithIndex(ObjectIntToObjectFunction<? super T, ? extends V> function)

Overrides default org.eclipse.collections.api.set.sorted.ImmutableSortedSet.collectWithIndex.

Returns a new OrderedIterable using results obtained by applying the specified function to each element and its corresponding index.

public <V, R extends Collection<V>> R
collectWithIndex(ObjectIntToObjectFunction<? super T, ? extends V> function, R target)

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

Adds elements to the target Collection using results obtained by applying the specified function to each element and its corresponding index.

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
contains(Object object)

Overrides org.eclipse.collections.impl.AbstractRichIterable.contains.

Implements org.eclipse.collections.api.RichIterable.contains, java.util.Set.contains, java.util.Collection.contains.

Returns true if the iterable has an element which responds true to element.equals(object).

public ImmutableSortedSet<T>
drop(int count)

Implements org.eclipse.collections.api.set.sorted.ImmutableSortedSet.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 void
each(Procedure<? super T> procedure)

Implements org.eclipse.collections.api.RichIterable.each.

The procedure is executed for each element in the iterable.

public boolean
public T
first()

Implements java.util.SortedSet.first.

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

public void
forEach(int startIndex, int endIndex, 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 <P> void
forEachWith(Procedure2<? super T, ? super P> procedure, P parameter)

Overrides org.eclipse.collections.impl.AbstractRichIterable.forEachWith.

Implements org.eclipse.collections.api.InternalIterable.forEachWith.

The procedure2 is evaluated for each element in the iterable with the specified parameter provided as the second argument.

public void
forEachWithIndex(ObjectIntProcedure<? super T> objectIntProcedure)

Overrides org.eclipse.collections.impl.AbstractRichIterable.forEachWithIndex.

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

Iterates over the iterable passing each element and the current relative int index to the specified instance of ObjectIntProcedure.

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.

public T
getOnly()

Overrides default org.eclipse.collections.api.RichIterable.getOnly.

Returns the element if the iterable has exactly one element.

public int
public Iterator<T>
iterator()

Implements java.lang.Iterable.iterator, java.util.Set.iterator, java.util.Collection.iterator.

Returns an iterator over elements of type T.

public T
last()

Implements java.util.SortedSet.last.

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

public T
max(Comparator<? super T> comparator)

Overrides org.eclipse.collections.impl.AbstractRichIterable.max.

Implements org.eclipse.collections.api.RichIterable.max.

Returns the maximum element out of this container based on the comparator.

public T
max()

Overrides org.eclipse.collections.impl.AbstractRichIterable.max.

Implements org.eclipse.collections.api.RichIterable.max, org.eclipse.collections.api.ordered.SortedIterable.max, org.eclipse.collections.api.ordered.OrderedIterable.max.

Returns the maximum element out of this container based on the natural order, not the order of this container.

public <V extends Comparable<? super V>> T
maxBy(Function<? super T, ? extends V> function)

Overrides org.eclipse.collections.impl.AbstractRichIterable.maxBy.

Implements org.eclipse.collections.api.RichIterable.maxBy.

Returns the maximum elements out of this container based on the natural order of the attribute returned by Function.

public T
min(Comparator<? super T> comparator)

Overrides org.eclipse.collections.impl.AbstractRichIterable.min.

Implements org.eclipse.collections.api.RichIterable.min.

Returns the minimum element out of this container based on the comparator.

public T
min()

Overrides org.eclipse.collections.impl.AbstractRichIterable.min.

Implements org.eclipse.collections.api.RichIterable.min, org.eclipse.collections.api.ordered.SortedIterable.min, org.eclipse.collections.api.ordered.OrderedIterable.min.

Returns the minimum element out of this container based on the natural order, not the order of this container.

public <V extends Comparable<? super V>> T
minBy(Function<? super T, ? extends V> function)

Overrides org.eclipse.collections.impl.AbstractRichIterable.minBy.

Implements org.eclipse.collections.api.RichIterable.minBy.

Returns the minimum elements out of this container based on the natural order of the attribute returned by Function.

public ImmutableSortedSet<T>
newWith(T element)

Overrides org.eclipse.collections.impl.set.sorted.immutable.AbstractImmutableSortedSet.newWith.

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)

Overrides org.eclipse.collections.impl.set.sorted.immutable.AbstractImmutableSortedSet.newWithAll.

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)

Overrides org.eclipse.collections.impl.set.sorted.immutable.AbstractImmutableSortedSet.newWithout.

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)

Overrides org.eclipse.collections.impl.set.sorted.immutable.AbstractImmutableSortedSet.newWithoutAll.

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 ImmutableSortedSet<T>
public <P> ImmutableSortedSet<T>
public ImmutableSortedSet<T>
public <S> ImmutableSortedSet<S>
public <P> ImmutableSortedSet<T>
public int
size()

Implements org.eclipse.collections.api.RichIterable.size, java.util.Set.size, java.util.Collection.size.

Returns the number of items in this iterable.

public ImmutableSortedSet<T>
take(int count)

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

Overrides org.eclipse.collections.impl.set.sorted.immutable.AbstractImmutableSortedSet.toStack.

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

Converts the OrderedIterable to a mutable MutableStack implementation.

private Object
public <S, R extends Collection<Pair<T, S>>> R
public <R extends Collection<Pair<T, Integer>>> R
Inherited from org.eclipse.collections.impl.set.sorted.immutable.AbstractImmutableSortedSet:
asParallelcartesianProductcastToSortedSetcollectcollectBooleancollectBytecollectCharcollectDoublecollectFloatcollectIfcollectIntcollectLongcollectShortcollectWithcorrespondsdetectIndexdetectLastIndexdifferencedifferenceIntodistinctdropWhileflatCollectgetFirstgetLastgroupBygroupByEachheadSetintersectintersectIntoisProperSubsetOfisSubsetOfnewMutablepartitionpartitionWhilepartitionWithpowerSetsubSetsymmetricDifferencesymmetricDifferenceIntotailSettakeWhiletoImmutabletoReversedunionunionIntozipzipWithIndex

Field Detail

comparatorback to summary
private final Comparator<? super T> comparator
INSTANCEback to summary
pack-priv static final ImmutableSortedSet<?> INSTANCE
serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

ImmutableEmptySortedSetback to summary
pack-priv ImmutableEmptySortedSet()
ImmutableEmptySortedSetback to summary
pack-priv ImmutableEmptySortedSet(Comparator<? super T> comparator)

Method Detail

collectWithIndexback to summary
public <V> ImmutableList<V> collectWithIndex(ObjectIntToObjectFunction<? super T, ? extends V> function)

Overrides default org.eclipse.collections.api.set.sorted.ImmutableSortedSet.collectWithIndex.

Doc from org.eclipse.collections.api.ordered.OrderedIterable.collectWithIndex.

Returns a new OrderedIterable using results obtained by applying the specified function to each element and its corresponding index.

Annotations
@Override
Since
9.1.
collectWithIndexback to summary
public <V, R extends Collection<V>> R collectWithIndex(ObjectIntToObjectFunction<? super T, ? extends V> function, R target)

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

Doc from org.eclipse.collections.api.ordered.OrderedIterable.collectWithIndex.

Adds elements to the target Collection using results obtained by applying the specified function to each element and its corresponding index.

Annotations
@Override
Since
9.1.
comparatorback to summary
public Comparator<? super T> comparator()

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

Doc from 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.

Annotations
@Override
compareToback to summary
public int compareTo(SortedSetIterable<T> o)

Implements java.lang.Comparable.compareTo.

Doc from java.lang.Comparable.compareTo.

Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

The implementor must ensure signum(x.compareTo(y)) == -signum(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception if and only if y.compareTo(x) throws an exception.)

The implementor must also ensure that the relation is transitive: (x.compareTo(y) > 0 && y.compareTo(z) > 0) implies x.compareTo(z) > 0.

Finally, the implementor must ensure that x.compareTo(y)==0 implies that signum(x.compareTo(z)) == signum(y.compareTo(z)), for all z.

Annotations
@Override
containsback to summary
public boolean contains(Object object)

Overrides org.eclipse.collections.impl.AbstractRichIterable.contains.

Implements org.eclipse.collections.api.RichIterable.contains, java.util.Set.contains, java.util.Collection.contains.

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

Returns true if the iterable has an element which responds true to element.equals(object).

Annotations
@Override
dropback to summary
public ImmutableSortedSet<T> drop(int count)

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

Doc from org.eclipse.collections.api.ordered.ReversibleIterable.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.

Annotations
@Override
eachback to summary
public void each(Procedure<? super T> procedure)

Implements org.eclipse.collections.api.RichIterable.each.

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

The procedure is executed for each element in the iterable.

Example using a Java 8 lambda expression:

people.each(person -> LOGGER.info(person.getName()));
This method is a variant of InternalIterable#forEach(Procedure) that has a signature conflict with Iterable#forEach(java.util.function.Consumer).
Annotations
@Override
equalsback to summary
public boolean equals(Object other)

Overrides java.lang.Object.equals.

Implements org.eclipse.collections.api.set.SetIterable.equals, java.util.Set.equals, java.util.Collection.equals.

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

Follows the same general contract as Set#equals(Object).

Annotations
@Override
firstback to summary
public T first()

Implements java.util.SortedSet.first.

Doc from java.util.SortedSet.first.

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

Annotations
@Override
forEachback to summary
public void forEach(int startIndex, int endIndex, Procedure<? super T> procedure)

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

Doc from org.eclipse.collections.api.ordered.OrderedIterable.forEach.

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

e.g.
OrderedIterable<Person> people = FastList.newListWith(ted, mary, bob, sally)
people.forEach(0, 1, person -> LOGGER.info(person.getName()));

This code would output ted and mary's names.

Annotations
@Override
forEachWithback to summary
public <P> void forEachWith(Procedure2<? super T, ? super P> procedure, P parameter)

Overrides org.eclipse.collections.impl.AbstractRichIterable.forEachWith.

Implements org.eclipse.collections.api.InternalIterable.forEachWith.

Doc from org.eclipse.collections.api.InternalIterable.forEachWith.

The procedure2 is evaluated for each element in the iterable with the specified parameter provided as the second argument.

Example using a Java 8 lambda:

people.forEachWith((Person person, Person other) ->
    {
        if (person.isRelatedTo(other))
        {
             LOGGER.info(person.getName());
        }
    }, fred);

Example using an anonymous inner class:

people.forEachWith(new Procedure2<Person, Person>()
{
    public void value(Person person, Person other)
    {
        if (person.isRelatedTo(other))
        {
             LOGGER.info(person.getName());
        }
    }
}, fred);
Annotations
@Override
forEachWithIndexback to summary
public void forEachWithIndex(ObjectIntProcedure<? super T> objectIntProcedure)

Overrides org.eclipse.collections.impl.AbstractRichIterable.forEachWithIndex.

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

Doc from org.eclipse.collections.api.InternalIterable.forEachWithIndex.

Iterates over the iterable passing each element and the current relative int index to the specified instance of ObjectIntProcedure.

Example using a Java 8 lambda:

people.forEachWithIndex((Person person, int index) -> LOGGER.info("Index: " + index + " person: " + person.getName()));

Example using an anonymous inner class:

people.forEachWithIndex(new ObjectIntProcedure<Person>()
{
    public void value(Person person, int index)
    {
        LOGGER.info("Index: " + index + " person: " + person.getName());
    }
});
Annotations
@Override
forEachWithIndexback to summary
public void forEachWithIndex(int fromIndex, int toIndex, ObjectIntProcedure<? super T> objectIntProcedure)

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

Doc from org.eclipse.collections.api.ordered.OrderedIterable.forEachWithIndex.

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

e.g.
OrderedIterable<People> people = FastList.newListWith(ted, mary, bob, sally)
people.forEachWithIndex(0, 1, (person, index) -> LOGGER.info(person.getName()));

This code would output ted and mary's names.

Annotations
@Override
getOnlyback to summary
public T getOnly()

Overrides default org.eclipse.collections.api.RichIterable.getOnly.

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

Returns the element if the iterable has exactly one element. Otherwise, throw IllegalStateException.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Implements org.eclipse.collections.api.set.SetIterable.hashCode, java.util.Set.hashCode, java.util.Collection.hashCode.

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

Follows the same general contract as Set#hashCode().

Annotations
@Override
iteratorback to summary
public Iterator<T> iterator()

Implements java.lang.Iterable.iterator, java.util.Set.iterator, java.util.Collection.iterator.

Doc from java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

Annotations
@Override
lastback to summary
public T last()

Implements java.util.SortedSet.last.

Doc from java.util.SortedSet.last.

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

Annotations
@Override
maxback to summary
public T max(Comparator<? super T> comparator)

Overrides org.eclipse.collections.impl.AbstractRichIterable.max.

Implements org.eclipse.collections.api.RichIterable.max.

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

Returns the maximum element out of this container based on the comparator.

Annotations
@Override
maxback to summary
public T max()

Overrides org.eclipse.collections.impl.AbstractRichIterable.max.

Implements org.eclipse.collections.api.RichIterable.max, org.eclipse.collections.api.ordered.SortedIterable.max, org.eclipse.collections.api.ordered.OrderedIterable.max.

Doc from org.eclipse.collections.api.ordered.SortedIterable.max.

Returns the maximum element out of this container based on the natural order, not the order of this container. If you want the maximum element based on the order of this container, use getLast().

Annotations
@Override
maxByback to summary
public <V extends Comparable<? super V>> T maxBy(Function<? super T, ? extends V> function)

Overrides org.eclipse.collections.impl.AbstractRichIterable.maxBy.

Implements org.eclipse.collections.api.RichIterable.maxBy.

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

Returns the maximum elements out of this container based on the natural order of the attribute returned by Function.

Annotations
@Override
minback to summary
public T min(Comparator<? super T> comparator)

Overrides org.eclipse.collections.impl.AbstractRichIterable.min.

Implements org.eclipse.collections.api.RichIterable.min.

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

Returns the minimum element out of this container based on the comparator.

Annotations
@Override
minback to summary
public T min()

Overrides org.eclipse.collections.impl.AbstractRichIterable.min.

Implements org.eclipse.collections.api.RichIterable.min, org.eclipse.collections.api.ordered.SortedIterable.min, org.eclipse.collections.api.ordered.OrderedIterable.min.

Doc from org.eclipse.collections.api.ordered.SortedIterable.min.

Returns the minimum element out of this container based on the natural order, not the order of this container. If you want the minimum element based on the order of this container, use getFirst().

Annotations
@Override
minByback to summary
public <V extends Comparable<? super V>> T minBy(Function<? super T, ? extends V> function)

Overrides org.eclipse.collections.impl.AbstractRichIterable.minBy.

Implements org.eclipse.collections.api.RichIterable.minBy.

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

Returns the minimum elements out of this container based on the natural order of the attribute returned by Function.

Annotations
@Override
newWithback to summary
public ImmutableSortedSet<T> newWith(T element)

Overrides org.eclipse.collections.impl.set.sorted.immutable.AbstractImmutableSortedSet.newWith.

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

Doc from 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.

Annotations
@Override
newWithAllback to summary
public ImmutableSortedSet<T> newWithAll(Iterable<? extends T> elements)

Overrides org.eclipse.collections.impl.set.sorted.immutable.AbstractImmutableSortedSet.newWithAll.

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

Doc from 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.

Annotations
@Override
newWithoutback to summary
public ImmutableSortedSet<T> newWithout(T element)

Overrides org.eclipse.collections.impl.set.sorted.immutable.AbstractImmutableSortedSet.newWithout.

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

Doc from 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.

Annotations
@Override
newWithoutAllback to summary
public ImmutableSortedSet<T> newWithoutAll(Iterable<? extends T> elements)

Overrides org.eclipse.collections.impl.set.sorted.immutable.AbstractImmutableSortedSet.newWithoutAll.

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

Doc from 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.

Annotations
@Override
rejectback to summary
public ImmutableSortedSet<T> reject(Predicate<? super T> predicate)

Overrides org.eclipse.collections.impl.set.sorted.immutable.AbstractImmutableSortedSet.reject.

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

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

Returns all elements of the source collection that return false when evaluating of the predicate. This method is also sometimes called filterNot and is the equivalent of calling iterable.select(Predicates.not(predicate)).

Example using a Java 8 lambda expression:

RichIterable<Person> rejected =
    people.reject(person -> person.person.getLastName().equals("Smith"));
Annotations
@Override
rejectWithback to summary
public <P> ImmutableSortedSet<T> rejectWith(Predicate2<? super T, ? super P> predicate, P parameter)

Overrides org.eclipse.collections.impl.set.sorted.immutable.AbstractImmutableSortedSet.rejectWith.

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

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

Similar to reject(Predicate), except with an evaluation parameter for the second generic argument in Predicate2.

E.g. return a Collection of Person elements where the person has an age greater than or equal to 18 years

Example using a Java 8 lambda expression:

RichIterable<Person> rejected =
    people.rejectWith((Person person, Integer age) -> person.getAge() < age, Integer.valueOf(18));
Annotations
@Override
selectback to summary
public ImmutableSortedSet<T> select(Predicate<? super T> predicate)

Overrides org.eclipse.collections.impl.set.sorted.immutable.AbstractImmutableSortedSet.select.

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

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

Returns all elements of the source collection that return true when evaluating the predicate. This method is also commonly called filter.

Example using a Java 8 lambda expression:

RichIterable<Person> selected =
    people.select(person -> person.getAddress().getCity().equals("London"));
Annotations
@Override
selectInstancesOfback to summary
public <S> ImmutableSortedSet<S> selectInstancesOf(Class<S> clazz)

Overrides org.eclipse.collections.impl.set.sorted.immutable.AbstractImmutableSortedSet.selectInstancesOf.

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

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

Returns all elements of the source collection that are instances of the Class clazz.

RichIterable<Integer> integers =
    List.mutable.with(new Integer(0), new Long(0L), new Double(0.0)).selectInstancesOf(Integer.class);
Annotations
@Override
selectWithback to summary
public <P> ImmutableSortedSet<T> selectWith(Predicate2<? super T, ? super P> predicate, P parameter)

Overrides org.eclipse.collections.impl.set.sorted.immutable.AbstractImmutableSortedSet.selectWith.

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

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

Similar to select(Predicate), except with an evaluation parameter for the second generic argument in Predicate2.

E.g. return a Collection of Person elements where the person has an age greater than or equal to 18 years

Example using a Java 8 lambda expression:

RichIterable<Person> selected =
    people.selectWith((Person person, Integer age) -> person.getAge()>= age, Integer.valueOf(18));
Annotations
@Override
sizeback to summary
public int size()

Implements org.eclipse.collections.api.RichIterable.size, java.util.Set.size, java.util.Collection.size.

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

Returns the number of items in this iterable.

Annotations
@Override
takeback to summary
public ImmutableSortedSet<T> take(int count)

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

Doc from org.eclipse.collections.api.ordered.ReversibleIterable.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.

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

Overrides org.eclipse.collections.impl.set.sorted.immutable.AbstractImmutableSortedSet.tap.

Implements org.eclipse.collections.api.set.sorted.ImmutableSortedSet.tap, org.eclipse.collections.api.collection.ImmutableCollection.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
toStackback to summary
public MutableStack<T> toStack()

Overrides org.eclipse.collections.impl.set.sorted.immutable.AbstractImmutableSortedSet.toStack.

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

Doc from org.eclipse.collections.api.ordered.OrderedIterable.toStack.

Converts the OrderedIterable to a mutable MutableStack implementation.

Annotations
@Override
writeReplaceback to summary
private Object writeReplace()
zipback to summary
public <S, R extends Collection<Pair<T, S>>> R zip(Iterable<S> that, R target)

Overrides org.eclipse.collections.impl.AbstractRichIterable.zip.

Implements org.eclipse.collections.api.RichIterable.zip, org.eclipse.collections.api.ordered.OrderedIterable.zip.

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

Same as zip(Iterable) but uses target for output.

Annotations
@Override
zipWithIndexback to summary
public <R extends Collection<Pair<T, Integer>>> R zipWithIndex(R target)

Overrides org.eclipse.collections.impl.AbstractRichIterable.zipWithIndex.

Implements org.eclipse.collections.api.RichIterable.zipWithIndex, org.eclipse.collections.api.ordered.OrderedIterable.zipWithIndex.

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

Same as zipWithIndex() but uses target for output.

Annotations
@Override