public class CollectBooleanToObjectIterable<V> extends AbstractLazyIterable<V>
| Constructor and Description |
|---|
CollectBooleanToObjectIterable(com.gs.collections.api.BooleanIterable iterable,
com.gs.collections.api.block.function.primitive.BooleanToObjectFunction<? extends V> function) |
| Modifier and Type | Method and Description |
|---|---|
void |
each(com.gs.collections.api.block.procedure.Procedure<? super V> procedure)
The procedure is executed for each element in the iterable.
|
<P> void |
forEachWith(com.gs.collections.api.block.procedure.Procedure2<? super V,? super P> procedure,
P parameter)
The procedure2 is evaluated for each element in the iterable with the specified parameter provided
as the second argument.
|
void |
forEachWithIndex(com.gs.collections.api.block.procedure.primitive.ObjectIntProcedure<? super V> objectIntProcedure)
Iterates over the iterable passing each element and the current relative int index to the specified instance of
ObjectIntProcedure.
|
boolean |
isEmpty()
Returns true if this iterable has zero items.
|
java.util.Iterator<V> |
iterator() |
boolean |
notEmpty()
The English equivalent of !this.isEmpty()
|
int |
size()
Returns the number of items in this iterable.
|
aggregateBy, aggregateInPlaceBy, asLazy, chunk, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, concatenate, distinct, drop, flatCollect, getFirst, getLast, groupBy, groupByEach, groupByUniqueKey, into, partition, partitionWith, reject, rejectWith, select, selectInstancesOf, selectWith, take, tap, toArray, toStack, zip, zipWithIndexallSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, appendString, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, count, countWith, detect, detectIfNone, detectWith, detectWithIfNone, flatCollect, forEach, groupBy, groupByEach, groupByUniqueKey, injectInto, injectInto, injectInto, injectInto, injectInto, makeString, makeString, makeString, max, max, maxBy, min, min, minBy, noneSatisfy, noneSatisfyWith, reject, rejectWith, select, selectWith, sumByDouble, sumByFloat, sumByInt, sumByLong, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toArray, toBag, toList, toMap, toSet, toSortedBag, toSortedBag, toSortedBagBy, toSortedList, toSortedList, toSortedListBy, toSortedMap, toSortedMap, toSortedSet, toSortedSet, toSortedSetBy, toString, zip, zipWithIndexclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitallSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, appendString, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, count, countWith, detect, detectIfNone, detectWith, detectWithIfNone, flatCollect, groupBy, groupByEach, groupByUniqueKey, injectInto, injectInto, injectInto, injectInto, injectInto, makeString, makeString, makeString, max, max, maxBy, min, min, minBy, noneSatisfy, noneSatisfyWith, reject, rejectWith, select, selectWith, sumByDouble, sumByFloat, sumByInt, sumByLong, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toArray, toBag, toList, toMap, toSet, toSortedBag, toSortedBag, toSortedBagBy, toSortedList, toSortedList, toSortedListBy, toSortedMap, toSortedMap, toSortedSet, toSortedSet, toSortedSetBy, toString, zip, zipWithIndexpublic CollectBooleanToObjectIterable(com.gs.collections.api.BooleanIterable iterable,
com.gs.collections.api.block.function.primitive.BooleanToObjectFunction<? extends V> function)
public void each(com.gs.collections.api.block.procedure.Procedure<? super V> procedure)
com.gs.collections.api.RichIterableExample using a Java 8 lambda expression:
people.each(person -> LOGGER.info(person.getName()));
Example using an anonymous inner class:
people.each(new ProcedureThis method is a variant of() { public void value(Person person) { LOGGER.info(person.getName()); } });
InternalIterable.forEach(Procedure)
that has a signature conflict with Iterable#forEach(java.util.function.Consumer).InternalIterable.forEach(Procedure),
Iterable#forEach(java.util.function.Consumer)public void forEachWithIndex(com.gs.collections.api.block.procedure.primitive.ObjectIntProcedure<? super V> objectIntProcedure)
com.gs.collections.api.InternalIterableExample 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() { public void value(Person person, int index) { LOGGER.info("Index: " + index + " person: " + person.getName()); } });
forEachWithIndex in interface com.gs.collections.api.InternalIterable<V>forEachWithIndex in class AbstractRichIterable<V>public <P> void forEachWith(com.gs.collections.api.block.procedure.Procedure2<? super V,? super P> procedure, P parameter)
com.gs.collections.api.InternalIterableExample 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() { public void value(Person person, Person other) { if (person.isRelatedTo(other)) { LOGGER.info(person.getName()); } } }, fred);
forEachWith in interface com.gs.collections.api.InternalIterable<V>forEachWith in class AbstractRichIterable<V>public java.util.Iterator<V> iterator()
public int size()
com.gs.collections.api.RichIterablesize in interface com.gs.collections.api.RichIterable<V>size in class AbstractLazyIterable<V>public boolean isEmpty()
com.gs.collections.api.RichIterableisEmpty in interface com.gs.collections.api.RichIterable<V>isEmpty in class AbstractLazyIterable<V>public boolean notEmpty()
com.gs.collections.api.RichIterablenotEmpty in interface com.gs.collections.api.RichIterable<V>notEmpty in class AbstractRichIterable<V>