ImmutableSortedSet which is created by calling the SortedSets.immutable.empty() method.
| Modifier and Type | Field and Description |
|---|---|
| private final Comparator | |
| pack-priv static final ImmutableSortedSet | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| pack-priv |
| comparator | back to summary |
|---|---|
| private final Comparator<? super T> comparator | |
| INSTANCE | back to summary |
|---|---|
| pack-priv static final ImmutableSortedSet<?> INSTANCE | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| ImmutableEmptySortedSet | back to summary |
|---|---|
| pack-priv ImmutableEmptySortedSet() | |
| ImmutableEmptySortedSet | back to summary |
|---|---|
| pack-priv ImmutableEmptySortedSet(Comparator<? super T> comparator) | |
| collectWithIndex | back to summary |
|---|---|
| public <V> ImmutableList Overrides default org. Doc from org. Returns a new OrderedIterable using results obtained by applying the specified function to each element and its corresponding index.
| |
| collectWithIndex | back to summary |
|---|---|
| public <V, R extends Collection Overrides default org. Doc from org. Adds elements to the target Collection using results obtained by applying the specified function to each element and its corresponding index.
| |
| comparator | back to summary |
|---|---|
| public Comparator Implements org. Doc from java. Returns the comparator used to order the elements in this set,
or
| |
| compareTo | back to summary |
|---|---|
| public int compareTo(SortedSetIterable<T> o) Implements java. Doc from java. 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 The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that
| |
| contains | back to summary |
|---|---|
| public boolean contains(Object object) Overrides org. Implements org. Doc from org. Returns true if the iterable has an element which responds true to element.equals(object).
| |
| drop | back to summary |
|---|---|
| public ImmutableSortedSet Implements org. Doc from org. Returns an iterable after skipping the first
| |
| each | back to summary |
|---|---|
| public void each(Procedure<? super T> procedure) Implements org. Doc from org. 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..
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides java. Implements org. Doc from org. Follows the same general contract as
| |
| first | back to summary |
|---|---|
| public T first() Implements java. Doc from java. Returns the first (lowest) element currently in this set.
| |
| forEach | back to summary |
|---|---|
| public void forEach(int startIndex, int endIndex, Procedure<? super T> procedure) Implements org. Doc from org. 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.
| |
| forEachWith | back to summary |
|---|---|
| public <P> void forEachWith(Procedure2<? super T, ? super P> procedure, P parameter) Overrides org. Implements org. Doc from org. 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);
| |
| forEachWithIndex | back to summary |
|---|---|
| public void forEachWithIndex(ObjectIntProcedure<? super T> objectIntProcedure) Overrides org. Implements org. Doc from org. 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());
}
});
| |
| forEachWithIndex | back to summary |
|---|---|
| public void forEachWithIndex(int fromIndex, int toIndex, ObjectIntProcedure<? super T> objectIntProcedure) Implements org. Doc from org. 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.
| |
| getOnly | back to summary |
|---|---|
| public T getOnly() Overrides default org. Doc from org. Returns the element if the iterable has exactly one element. Otherwise, throw
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Implements org. Doc from org. Follows the same general contract as
| |
| iterator | back to summary |
|---|---|
| public Iterator Implements java. Doc from java. Returns an iterator over elements of type
| |
| last | back to summary |
|---|---|
| public T last() Implements java. Doc from java. Returns the last (highest) element currently in this set.
| |
| max | back to summary |
|---|---|
| public T max(Comparator<? super T> comparator) Overrides org. Implements org. Doc from org. Returns the maximum element out of this container based on the comparator.
| |
| max | back to summary |
|---|---|
| public T max() Overrides org. Implements org. Doc from org. 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
| |
| maxBy | back to summary |
|---|---|
| public <V extends Comparable Overrides org. Implements org. Doc from org. Returns the maximum elements out of this container based on the natural order of the attribute returned by Function.
| |
| min | back to summary |
|---|---|
| public T min(Comparator<? super T> comparator) Overrides org. Implements org. Doc from org. Returns the minimum element out of this container based on the comparator.
| |
| min | back to summary |
|---|---|
| public T min() Overrides org. Implements org. Doc from org. 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
| |
| minBy | back to summary |
|---|---|
| public <V extends Comparable Overrides org. Implements org. Doc from org. Returns the minimum elements out of this container based on the natural order of the attribute returned by Function.
| |
| newWith | back to summary |
|---|---|
| public ImmutableSortedSet Overrides org. Implements org. Doc from org. This method is similar to the
| |
| newWithAll | back to summary |
|---|---|
| public ImmutableSortedSet Overrides org. Implements org. Doc from org. This method is similar to the
| |
| newWithout | back to summary |
|---|---|
| public ImmutableSortedSet Overrides org. Implements org. Doc from org. This method is similar to the
| |
| newWithoutAll | back to summary |
|---|---|
| public ImmutableSortedSet Overrides org. Implements org. Doc from org. This method is similar to the
| |
| reject | back to summary |
|---|---|
| public ImmutableSortedSet Overrides org. Implements org. Doc from org. 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"));
| |
| rejectWith | back to summary |
|---|---|
| public <P> ImmutableSortedSet Overrides org. Implements org. Doc from org. Similar to
E.g. return a Example using a Java 8 lambda expression:
RichIterable<Person> rejected =
people.rejectWith((Person person, Integer age) -> person.getAge() < age, Integer.valueOf(18));
| |
| select | back to summary |
|---|---|
| public ImmutableSortedSet Overrides org. Implements org. Doc from org. 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"));
| |
| selectInstancesOf | back to summary |
|---|---|
| public <S> ImmutableSortedSet Overrides org. Implements org. Doc from org. Returns all elements of the source collection that are instances of the Class
RichIterable<Integer> integers =
List.mutable.with(new Integer(0), new Long(0L), new Double(0.0)).selectInstancesOf(Integer.class);
| |
| selectWith | back to summary |
|---|---|
| public <P> ImmutableSortedSet Overrides org. Implements org. Doc from org. Similar to
E.g. return a Example using a Java 8 lambda expression:
RichIterable<Person> selected =
people.selectWith((Person person, Integer age) -> person.getAge()>= age, Integer.valueOf(18));
| |
| size | back to summary |
|---|---|
| public int size() Implements org. Doc from org. Returns the number of items in this iterable.
| |
| take | back to summary |
|---|---|
| public ImmutableSortedSet Implements org. Doc from org. Returns the first
| |
| tap | back to summary |
|---|---|
| public ImmutableSortedSet Overrides org. Implements org. Doc from org. Executes the Procedure for each element in the iterable and returns Example using a Java 8 lambda expression:
RichIterable<Person> tapped =
people.tap(person -> LOGGER.info(person.getName()));
| |
| toStack | back to summary |
|---|---|
| public MutableStack Overrides org. Overrides default org. Doc from org. Converts the OrderedIterable to a mutable MutableStack implementation.
| |
| writeReplace | back to summary |
|---|---|
| private Object writeReplace() | |
| zip | back to summary |
|---|---|
| public <S, R extends Collection Overrides org. Implements org. Doc from org. Same as
| |
| zipWithIndex | back to summary |
|---|---|
| public <R extends Collection Overrides org. Implements org. Doc from org. Same as
| |