@Immutable public class LazyIterableAdapter<T> extends AbstractLazyIterable<T>
| Constructor and Description |
|---|
LazyIterableAdapter(java.lang.Iterable<T> newAdapted) |
| Modifier and Type | Method and Description |
|---|---|
<V> com.gs.collections.api.LazyIterable<V> |
collect(com.gs.collections.api.block.function.Function<? super T,? extends V> function)
Creates a deferred iterable for collecting elements from the current iterable.
|
<V> com.gs.collections.api.LazyIterable<V> |
collectIf(com.gs.collections.api.block.predicate.Predicate<? super T> predicate,
com.gs.collections.api.block.function.Function<? super T,? extends V> function)
Creates a deferred iterable for selecting and collecting elements from the current iterable.
|
com.gs.collections.api.LazyIterable<T> |
distinct()
Creates a deferred distinct iterable to get distinct elements from the current iterable.
|
com.gs.collections.api.LazyIterable<T> |
drop(int count)
Creates a deferred drop iterable for the current iterable using the specified count as the limit.
|
<V> com.gs.collections.api.LazyIterable<V> |
flatCollect(com.gs.collections.api.block.function.Function<? super T,? extends java.lang.Iterable<V>> function)
Creates a deferred flattening iterable for the current iterable.
|
void |
forEach(com.gs.collections.api.block.procedure.Procedure<? super T> procedure)
The procedure is executed for each element in the iterable.
|
<P> void |
forEachWith(com.gs.collections.api.block.procedure.Procedure2<? super T,? 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 T> objectIntProcedure)
Iterates over the iterable passing each element and the current relative int index to the specified instance of
ObjectIntProcedure
|
<R extends java.util.Collection<T>> |
into(R target)
Iterates over this iterable adding all elements into the target collection.
|
java.util.Iterator<T> |
iterator() |
com.gs.collections.api.LazyIterable<T> |
reject(com.gs.collections.api.block.predicate.Predicate<? super T> predicate)
Creates a deferred iterable for rejecting elements from the current iterable.
|
com.gs.collections.api.LazyIterable<T> |
select(com.gs.collections.api.block.predicate.Predicate<? super T> predicate)
Creates a deferred iterable for selecting elements from the current iterable.
|
int |
size()
Returns the number of items in this iterable.
|
com.gs.collections.api.LazyIterable<T> |
take(int count)
Creates a deferred take iterable for the current iterable using the specified count as the limit.
|
java.lang.Object[] |
toArray()
Converts this iterable to an array.
|
aggregateBy, aggregateInPlaceBy, allSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, appendString, asLazy, chunk, collect, collectBoolean, collectBoolean, collectByte, collectByte, collectChar, collectChar, collectDouble, collectDouble, collectFloat, collectFloat, collectIf, collectInt, collectInt, collectLong, collectLong, collectShort, collectShort, collectWith, collectWith, concatenate, contains, containsAll, containsAllArguments, containsAllIterable, count, countWith, detect, detectIfNone, detectWith, detectWithIfNone, flatCollect, getFirst, getLast, groupBy, groupBy, groupByEach, groupByEach, groupByUniqueKey, injectInto, injectInto, injectInto, injectInto, injectInto, isEmpty, makeString, makeString, makeString, max, max, maxBy, min, min, minBy, noneSatisfy, noneSatisfyWith, notEmpty, partition, partitionWith, reject, rejectWith, rejectWith, select, selectInstancesOf, selectWith, selectWith, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toArray, toBag, toList, toMap, toSet, toSortedList, toSortedList, toSortedListBy, toSortedMap, toSortedMap, toSortedSet, toSortedSet, toSortedSetBy, toStack, toString, zip, zip, zipWithIndex, zipWithIndexpublic LazyIterableAdapter(java.lang.Iterable<T> newAdapted)
public void forEach(com.gs.collections.api.block.procedure.Procedure<? super T> procedure)
com.gs.collections.api.InternalIterablee.g. people.forEach(new Procedure() { public void value(Person person) { LOGGER.info(person.getName()); } });
public void forEachWithIndex(com.gs.collections.api.block.procedure.primitive.ObjectIntProcedure<? super T> objectIntProcedure)
com.gs.collections.api.InternalIterablee.g. people.forEachWithIndex(new ObjectIntProcedure() { public void value(Person person, int index) { LOGGER.info("Index: " + index + " person: " + person.getName()); } });
public <P> void forEachWith(com.gs.collections.api.block.procedure.Procedure2<? super T,? super P> procedure, P parameter)
com.gs.collections.api.InternalIterablee.g. people.forEachWith(new Procedure2() { public void value(Person person, Person other) { if (person.isRelatedTo(other)) { LOGGER.info(person.getName()); } } }, fred);
public java.util.Iterator<T> iterator()
public <R extends java.util.Collection<T>> R into(R target)
com.gs.collections.api.LazyIterableinto in interface com.gs.collections.api.LazyIterable<T>into in class AbstractLazyIterable<T>public com.gs.collections.api.LazyIterable<T> select(com.gs.collections.api.block.predicate.Predicate<? super T> predicate)
com.gs.collections.api.LazyIterableselect in interface com.gs.collections.api.LazyIterable<T>select in interface com.gs.collections.api.RichIterable<T>select in class AbstractLazyIterable<T>public com.gs.collections.api.LazyIterable<T> reject(com.gs.collections.api.block.predicate.Predicate<? super T> predicate)
com.gs.collections.api.LazyIterablereject in interface com.gs.collections.api.LazyIterable<T>reject in interface com.gs.collections.api.RichIterable<T>reject in class AbstractLazyIterable<T>predicate - a Predicate to use as the reject criteriaPredicate.accept(Object) method to evaluate to falsepublic <V> com.gs.collections.api.LazyIterable<V> collect(com.gs.collections.api.block.function.Function<? super T,? extends V> function)
com.gs.collections.api.LazyIterablecollect in interface com.gs.collections.api.LazyIterable<T>collect in interface com.gs.collections.api.RichIterable<T>collect in class AbstractLazyIterable<T>public <V> com.gs.collections.api.LazyIterable<V> flatCollect(com.gs.collections.api.block.function.Function<? super T,? extends java.lang.Iterable<V>> function)
com.gs.collections.api.LazyIterableflatCollect in interface com.gs.collections.api.LazyIterable<T>flatCollect in interface com.gs.collections.api.RichIterable<T>flatCollect in class AbstractLazyIterable<T>function - The Function to applyfunctionpublic <V> com.gs.collections.api.LazyIterable<V> collectIf(com.gs.collections.api.block.predicate.Predicate<? super T> predicate, com.gs.collections.api.block.function.Function<? super T,? extends V> function)
com.gs.collections.api.LazyIterablecollectIf in interface com.gs.collections.api.LazyIterable<T>collectIf in interface com.gs.collections.api.RichIterable<T>collectIf in class AbstractLazyIterable<T>public com.gs.collections.api.LazyIterable<T> take(int count)
com.gs.collections.api.LazyIterabletake in interface com.gs.collections.api.LazyIterable<T>take in class AbstractLazyIterable<T>public com.gs.collections.api.LazyIterable<T> drop(int count)
com.gs.collections.api.LazyIterabledrop in interface com.gs.collections.api.LazyIterable<T>drop in class AbstractLazyIterable<T>public com.gs.collections.api.LazyIterable<T> distinct()
com.gs.collections.api.LazyIterabledistinct in interface com.gs.collections.api.LazyIterable<T>distinct in class AbstractLazyIterable<T>public java.lang.Object[] toArray()
com.gs.collections.api.RichIterabletoArray in interface com.gs.collections.api.RichIterable<T>toArray in class AbstractLazyIterable<T>Collection.toArray()public int size()
com.gs.collections.api.RichIterablesize in interface com.gs.collections.api.RichIterable<T>size in class AbstractLazyIterable<T>