| Modifier and Type | Class and Description |
|---|---|
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private final LongToObjectFunction | |
| private final LongIterable |
| Access | Constructor and Description |
|---|---|
| public | FlatCollectLongToObjectIterable(LongIterable iterable, LongToObjectFunction<? extends Iterable<V>> function)
|
| Modifier and Type | Method and Description |
|---|---|
| public boolean | allSatisfy(Predicate<? super V> 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 V, ? 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 V> 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 V, ? 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 | detect(Predicate<? super V> 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 V> 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 V> procedure)
Implements org. The procedure is executed for each element in the iterable. |
| public <P> void | forEachWith(Procedure2<? super V, ? 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 V> 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 V> 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 V, ? 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. |
| function | back to summary |
|---|---|
| private final LongToObjectFunction<? extends Iterable<V>> function | |
| iterable | back to summary |
|---|---|
| private final LongIterable iterable | |
| FlatCollectLongToObjectIterable | back to summary |
|---|---|
| public FlatCollectLongToObjectIterable(LongIterable iterable, LongToObjectFunction<? extends Iterable<V>> function) | |
| allSatisfy | back to summary |
|---|---|
| public boolean allSatisfy(Predicate<? super V> 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 V, ? 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 V> 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 V, ? 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.
| |
| detect | back to summary |
|---|---|
| public V detect(Predicate<? super V> 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 V> 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 V, ? 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 V> 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 V> 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 V, ? 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.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final LongToObjectFunction | |
| private Iterator | |
| private final LongIterator |
| Access | Constructor and Description |
|---|---|
| public | FlatCollectLongIterator(LongIterable iterable, LongToObjectFunction<? extends Iterable<V>> newFunction)
|
| public | FlatCollectLongIterator(LongIterator newIterator, LongToObjectFunction<? extends Iterable<V>> newFunction)
|
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public V | |
| public void | remove()
Overrides default java. Removes from the underlying collection the last element returned by this iterator (optional operation). |
| function | back to summary |
|---|---|
| private final LongToObjectFunction<? extends Iterable<V>> function | |
| innerIterator | back to summary |
|---|---|
| private Iterator<V> innerIterator | |
| iterator | back to summary |
|---|---|
| private final LongIterator iterator | |
| FlatCollectLongIterator | back to summary |
|---|---|
| public FlatCollectLongIterator(LongIterable iterable, LongToObjectFunction<? extends Iterable<V>> newFunction) | |
| FlatCollectLongIterator | back to summary |
|---|---|
| public FlatCollectLongIterator(LongIterator newIterator, LongToObjectFunction<? extends Iterable<V>> newFunction) | |
| hasNext | back to summary |
|---|---|
| public boolean hasNext() Implements java. Doc from java. Returns
| |
| next | back to summary |
|---|---|
| public V 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
| |