| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | allSatisfy(Predicate<? super T> 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 <P> boolean | allSatisfyWith(Predicate2<? super T, ? super P> predicate, P parameter)
Overrides org. Implements org. Returns true if the predicate evaluates to true for every element of the collection, or returns false. |
| public boolean | anySatisfy(Predicate<? super T> predicate)
Overrides org. Implements org. Returns true if the predicate evaluates to true for any element of the iterable. |
| public <P> boolean | anySatisfyWith(Predicate2<? super T, ? super P> predicate, P parameter)
Overrides org. Implements org. Returns true if the predicate evaluates to true for any element of the collection, or return false. |
| public <V> LazyIterable | collect(Function<? super T, ? extends V> function)
Overrides org. Implements org. Creates a deferred iterable for collecting elements from the current iterable. |
| public <V> LazyIterable | collectIf(Predicate<? super T> predicate, Function<? super T, ? extends V> function)
Overrides org. Implements org. Creates a deferred iterable for selecting and collecting elements from the current iterable. |
| public T | detect(Predicate<? super T> 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 T> predicate)
Overrides org. Implements org. Returns the first element of the iterable for which the predicate evaluates to true as an Optional. |
| public <P> T | detectWith(Predicate2<? super T, ? super P> predicate, P parameter)
Overrides org. Implements org. Returns the first element that evaluates to true for the specified predicate2 and parameter, or null if none evaluate to true. |
| public <P> Optional | detectWithOptional(Predicate2<? super T, ? super P> predicate, P parameter)
Overrides org. Implements org. Returns the first element that evaluates to true for the specified predicate2 and parameter as an Optional. |
| public LazyIterable | distinct()
Overrides org. Implements org. Creates a deferred distinct iterable to get distinct elements from the current iterable. |
| public LazyIterable | drop(int count)
Overrides org. Implements org. Creates a deferred drop iterable for the current iterable using the specified count as the limit. |
| public LazyIterable | dropWhile(Predicate<? super T> predicate)
Overrides org. Implements org.
|
| public void | each(Procedure<? super T> procedure)
Implements org. The procedure is executed for each element in the iterable. |
| public <V> LazyIterable | flatCollect(Function<? super T, ? extends Iterable<V>> function)
Overrides org. Implements org. Creates a deferred flattening iterable for the current iterable. |
| public <P> void | forEachWith(Procedure2<? super T, ? 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 T> 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 T | getFirst()
Overrides org. Implements org. Returns the first element of an iterable. |
| public T | getLast()
Overrides org. Implements org. Returns the last element of an iterable. |
| public <R extends Collection | into(R target)
Overrides org. Implements org. Iterates over this iterable adding all elements into the target collection. |
| public boolean | isEmpty()
Overrides org. Implements org. Returns true if this iterable has zero items. |
| public Iterator | |
| public boolean | noneSatisfy(Predicate<? super T> 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 <P> boolean | noneSatisfyWith(Predicate2<? super T, ? super P> predicate, P parameter)
Overrides org. Implements org. Returns true if the predicate evaluates to false for every element of the collection, or return false. |
| public LazyIterable | reject(Predicate<? super T> predicate)
Overrides org. Implements org. Creates a deferred iterable for rejecting elements from the current iterable. |
| public LazyIterable | select(Predicate<? super T> predicate)
Overrides org. Implements org. Creates a deferred iterable for selecting elements from the current iterable. |
| public int | size()
Overrides org. Implements org. Returns the number of items in this iterable. |
| public LazyIterable | take(int count)
Overrides org. Implements org. Creates a deferred take iterable for the current iterable using the specified count as the limit. |
| public LazyIterable | takeWhile(Predicate<? super T> predicate)
Overrides org. Implements org.
|
| adapted | back to summary |
|---|---|
| private final Iterable<T> adapted | |
| LazyIterableAdapter | back to summary |
|---|---|
| public LazyIterableAdapter(Iterable<T> newAdapted) | |
| allSatisfy | back to summary |
|---|---|
| public boolean allSatisfy(Predicate<? super T> 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.
| |
| allSatisfyWith | back to summary |
|---|---|
| public <P> boolean allSatisfyWith(Predicate2<? super T, ? super P> predicate, P parameter) Overrides org. Implements org. Doc from org. Returns true if the predicate evaluates to true for every element of the collection, or returns false.
| |
| anySatisfy | back to summary |
|---|---|
| public boolean anySatisfy(Predicate<? super T> 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.
| |
| anySatisfyWith | back to summary |
|---|---|
| public <P> boolean anySatisfyWith(Predicate2<? super T, ? super P> predicate, P parameter) Overrides org. Implements org. Doc from org. Returns true if the predicate evaluates to true for any element of the collection, or return false. Returns false if the collection is empty.
| |
| collect | back to summary |
|---|---|
| public <V> LazyIterable Overrides org. Implements org. Doc from org. Creates a deferred iterable for collecting elements from the current iterable.
| |
| collectIf | back to summary |
|---|---|
| public <V> LazyIterable Overrides org. Implements org. Doc from org. Creates a deferred iterable for selecting and collecting elements from the current iterable.
| |
| detect | back to summary |
|---|---|
| public T detect(Predicate<? super T> 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"));
| |
| detectWith | back to summary |
|---|---|
| public <P> T detectWith(Predicate2<? super T, ? super P> predicate, P parameter) Overrides org. Implements org. Doc from org. Returns the first element that evaluates to true for the specified predicate2 and parameter, or null if none evaluate to true. Example using a Java 8 lambda expression:
Person person =
people.detectWith((person, fullName) -> person.getFullName().equals(fullName), "John Smith");
| |
| detectWithOptional | back to summary |
|---|---|
| public <P> Optional Overrides org. Implements org. Doc from org. Returns the first element that evaluates to true for the specified predicate2 and parameter as an Optional. Example using a Java 8 lambda expression:
Optional<Person> person =
people.detectWithOptional((person, fullName) -> person.getFullName().equals(fullName), "John Smith");
| |
| distinct | back to summary |
|---|---|
| public LazyIterable Overrides org. Implements org. Doc from org. Creates a deferred distinct iterable to get distinct elements from the current iterable.
| |
| drop | back to summary |
|---|---|
| public LazyIterable Overrides org. Implements org. Doc from org. Creates a deferred drop iterable for the current iterable using the specified count as the limit.
| |
| dropWhile | back to summary |
|---|---|
| public LazyIterable Overrides org. Implements org.
| |
| 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..
| |
| flatCollect | back to summary |
|---|---|
| public <V> LazyIterable Overrides org. Implements org. Doc from org. Creates a deferred flattening iterable for the current iterable.
| |
| 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());
}
});
| |
| getFirst | back to summary |
|---|---|
| public T getFirst() Overrides org. Implements org. Doc from org. Returns the first element of an iterable. In the case of a List it is the element at the first index. In the case of any other Collection, it is the first element that would be returned during an iteration. If the iterable is empty, null is returned. If null is a valid element of the container, then a developer would need to check to see if the iterable is empty to validate that a null result was not due to the container being empty. The order of Sets are not guaranteed (except for TreeSets and other Ordered Set implementations), so if you use this method, the first element could be any element from the Set.
| |
| getLast | back to summary |
|---|---|
| public T getLast() Overrides org. Implements org. Doc from org. Returns the last element of an iterable. In the case of a List it is the element at the last index. In the case of any other Collection, it is the last element that would be returned during an iteration. If the iterable is empty, null is returned. If null is a valid element of the container, then a developer would need to check to see if the iterable is empty to validate that a null result was not due to the container being empty. The order of Sets are not guaranteed (except for TreeSets and other Ordered Set implementations), so if you use this method, the last element could be any element from the Set.
| |
| into | back to summary |
|---|---|
| public <R extends Collection Overrides org. Implements org. Doc from org. Iterates over this iterable adding all elements into the target collection.
| |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Overrides org. Implements org. Doc from org. Returns true if this iterable has zero items.
| |
| 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 T> 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.
| |
| noneSatisfyWith | back to summary |
|---|---|
| public <P> boolean noneSatisfyWith(Predicate2<? super T, ? super P> predicate, P parameter) Overrides org. Implements org. Doc from org. Returns true if the predicate evaluates to false for every element of the collection, or return false. Returns true if the collection is empty.
| |
| reject | back to summary |
|---|---|
| public LazyIterable Overrides org. Implements org. Doc from org. Creates a deferred iterable for rejecting elements from the current iterable.
| |
| select | back to summary |
|---|---|
| public LazyIterable Overrides org. Implements org. Doc from org. Creates a deferred iterable for selecting elements from the current iterable.
| |
| size | back to summary |
|---|---|
| public int size() Overrides org. Implements org. Doc from org. Returns the number of items in this iterable.
| |
| take | back to summary |
|---|---|
| public LazyIterable Overrides org. Implements org. Doc from org. Creates a deferred take iterable for the current iterable using the specified count as the limit.
| |
| takeWhile | back to summary |
|---|---|
| public LazyIterable Overrides org. Implements org.
| |