| Modifier and Type | Class and Description |
|---|---|
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private final MutableList |
| Access | Constructor and Description |
|---|---|
| private | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public boolean | allSatisfy(Predicate<? super E> predicate)
Overrides org. Implements org. Returns true if the predicate evaluates to true for every element of the iterable or if the iterable is empty. |
| public boolean | anySatisfy(Predicate<? super E> predicate)
Overrides org. Implements org. Returns true if the predicate evaluates to true for any element of the iterable. |
| public E | detect(Predicate<? super E> predicate)
Overrides org. Implements org. Returns the first element of the iterable for which the predicate evaluates to true or null in the case where no element returns true. |
| public Optional | detectOptional(Predicate<? super E> predicate)
Overrides org. Implements org. Returns the first element of the iterable for which the predicate evaluates to true as an Optional. |
| public void | each(Procedure<? super E> procedure)
Implements org. The procedure is executed for each element in the iterable. |
| public <P> void | forEachWith(Procedure2<? super E, ? super P> procedure, P parameter)
Overrides org. Implements org. The procedure2 is evaluated for each element in the iterable with the specified parameter provided as the second argument. |
| public void | forEachWithIndex(ObjectIntProcedure<? super E> objectIntProcedure)
Overrides org. Implements org. Iterates over the iterable passing each element and the current relative int index to the specified instance of ObjectIntProcedure. |
| public Iterator | |
| public boolean | noneSatisfy(Predicate<? super E> predicate)
Overrides org. Implements org. Returns true if the predicate evaluates to false for every element of the iterable or if the iterable is empty. |
| public int | size()
Overrides org. Implements org. Returns the number of items in this iterable. |
| public static <T> CompositeIterable |
| iterables | back to summary |
|---|---|
| private final MutableList<Iterable<E>> iterables | |
| CompositeIterable | back to summary |
|---|---|
| private CompositeIterable(MutableList<Iterable<E>> newIterables) | |
| CompositeIterable | back to summary |
|---|---|
| public CompositeIterable() | |
| add | back to summary |
|---|---|
| public void add(Iterable<E> iterable) | |
| allSatisfy | back to summary |
|---|---|
| public boolean allSatisfy(Predicate<? super E> predicate) Overrides org. Implements org. Doc from org. Returns true if the predicate evaluates to true for every element of the iterable or if the iterable is empty. Otherwise, returns false.
| |
| anySatisfy | back to summary |
|---|---|
| public boolean anySatisfy(Predicate<? super E> predicate) Overrides org. Implements org. Doc from org. Returns true if the predicate evaluates to true for any element of the iterable. Returns false if the iterable is empty, or if no element returned true when evaluating the predicate.
| |
| detect | back to summary |
|---|---|
| public E detect(Predicate<? super E> predicate) Overrides org. Implements org. Doc from org. Returns the first element of the iterable for which the predicate evaluates to true or null in the case where no element returns true. This method is commonly called find. Example using a Java 8 lambda expression:
Person person =
people.detect(person -> person.getFirstName().equals("John") && person.getLastName().equals("Smith"));
| |
| detectOptional | back to summary |
|---|---|
| public Optional Overrides org. Implements org. Doc from org. Returns the first element of the iterable for which the predicate evaluates to true as an Optional. This method is commonly called find. Example using a Java 8 lambda expression:
Person person =
people.detectOptional(person -> person.getFirstName().equals("John") && person.getLastName().equals("Smith"));
| |
| each | back to summary |
|---|---|
| public void each(Procedure<? super E> 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..
| |
| forEachWith | back to summary |
|---|---|
| public <P> void forEachWith(Procedure2<? super E, ? 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 E> 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());
}
});
| |
| iterator | back to summary |
|---|---|
| public Iterator Implements java. Doc from java. Returns an iterator over elements of type
| |
| noneSatisfy | back to summary |
|---|---|
| public boolean noneSatisfy(Predicate<? super E> predicate) Overrides org. Implements org. Doc from org. Returns true if the predicate evaluates to false for every element of the iterable or if the iterable is empty. Otherwise, returns false.
| |
| size | back to summary |
|---|---|
| public int size() Overrides org. Implements org. Doc from org. Returns the number of items in this iterable.
| |
| with | back to summary |
|---|---|
| public static <T> CompositeIterable | |
| Modifier and Type | Field and Description |
|---|---|
| private Iterator | |
| private final Iterator |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public E | |
| public void | remove()
Overrides default java. Removes from the underlying collection the last element returned by this iterator (optional operation). |
| innerIterator | back to summary |
|---|---|
| private Iterator<E> innerIterator | |
| iterablesIterator | back to summary |
|---|---|
| private final Iterator<Iterable<E>> iterablesIterator | |
| CompositeIterator | back to summary |
|---|---|
| private CompositeIterator(MutableList<Iterable<E>> iterables) | |
| hasNext | back to summary |
|---|---|
| public boolean hasNext() Implements java. Doc from java. Returns
| |
| next | back to summary |
|---|---|
| public E next() Implements java. Doc from java. Returns the next element in the iteration.
| |
| remove | back to summary |
|---|---|
| public void remove() Overrides default java. Doc from java. Removes from the underlying collection the last element returned
by this iterator (optional operation). This method can be called
only once per call to The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method, unless an overriding class has specified a concurrent modification policy.
The behavior of an iterator is unspecified if this method is called
after a call to the
| |