Class AbstractLazyIterable<T>
- java.lang.Object
-
- org.eclipse.collections.impl.AbstractRichIterable<T>
-
- org.eclipse.collections.impl.lazy.AbstractLazyIterable<T>
-
- All Implemented Interfaces:
Iterable<T>
,InternalIterable<T>
,LazyIterable<T>
,RichIterable<T>
- Direct Known Subclasses:
ChunkBooleanIterable
,ChunkByteIterable
,ChunkCharIterable
,ChunkDoubleIterable
,ChunkFloatIterable
,ChunkIntIterable
,ChunkIterable
,ChunkLongIterable
,ChunkShortIterable
,CollectBooleanToObjectIterable
,CollectByteToObjectIterable
,CollectCharToObjectIterable
,CollectDoubleToObjectIterable
,CollectFloatToObjectIterable
,CollectIntToObjectIterable
,CollectIterable
,CollectLongToObjectIterable
,CollectShortToObjectIterable
,CompositeIterable
,DistinctIterable
,DropIterable
,DropWhileIterable
,FlatCollectBooleanToObjectIterable
,FlatCollectByteToObjectIterable
,FlatCollectCharToObjectIterable
,FlatCollectDoubleToObjectIterable
,FlatCollectFloatToObjectIterable
,FlatCollectIntToObjectIterable
,FlatCollectIterable
,FlatCollectLongToObjectIterable
,FlatCollectShortToObjectIterable
,Interval
,LazyIterableAdapter
,RejectIterable
,ReverseIterable
,SelectInstancesOfIterable
,SelectIterable
,TakeIterable
,TakeWhileIterable
,TapIterable
,ZipIterable
,ZipWithIndexIterable
public abstract class AbstractLazyIterable<T> extends AbstractRichIterable<T> implements LazyIterable<T>
AbstractLazyIterable provides a base from which deferred iterables such as SelectIterable, RejectIterable and CollectIterable can be derived.
-
-
Constructor Summary
Constructors Constructor Description AbstractLazyIterable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LazyIterable<T>
asLazy()
LazyIterable<RichIterable<T>>
chunk(int size)
<V> LazyIterable<V>
collect(Function<? super T,? extends V> function)
LazyBooleanIterable
collectBoolean(BooleanFunction<? super T> booleanFunction)
LazyByteIterable
collectByte(ByteFunction<? super T> byteFunction)
LazyCharIterable
collectChar(CharFunction<? super T> charFunction)
LazyDoubleIterable
collectDouble(DoubleFunction<? super T> doubleFunction)
LazyFloatIterable
collectFloat(FloatFunction<? super T> floatFunction)
<V> LazyIterable<V>
collectIf(Predicate<? super T> predicate, Function<? super T,? extends V> function)
LazyIntIterable
collectInt(IntFunction<? super T> intFunction)
LazyLongIterable
collectLong(LongFunction<? super T> longFunction)
LazyShortIterable
collectShort(ShortFunction<? super T> shortFunction)
<P,V>
LazyIterable<V>collectWith(Function2<? super T,? super P,? extends V> function, P parameter)
LazyIterable<T>
concatenate(Iterable<T> iterable)
LazyIterable<T>
distinct()
LazyIterable<T>
drop(int count)
LazyIterable<T>
dropWhile(Predicate<? super T> predicate)
<V> LazyIterable<V>
flatCollect(Function<? super T,? extends Iterable<V>> function)
T
getFirst()
T
getLast()
T
getOnly()
<V> Multimap<V,T>
groupBy(Function<? super T,? extends V> function)
<V> Multimap<V,T>
groupByEach(Function<? super T,? extends Iterable<V>> function)
<V> MapIterable<V,T>
groupByUniqueKey(Function<? super T,? extends V> function)
<R extends Collection<T>>
Rinto(R target)
boolean
isEmpty()
<V extends Comparable<? super V>>
Optional<T>maxByOptional(Function<? super T,? extends V> function)
Optional<T>
maxOptional()
Optional<T>
maxOptional(Comparator<? super T> comparator)
<V extends Comparable<? super V>>
Optional<T>minByOptional(Function<? super T,? extends V> function)
Optional<T>
minOptional()
Optional<T>
minOptional(Comparator<? super T> comparator)
PartitionMutableList<T>
partition(Predicate<? super T> predicate)
<P> PartitionMutableList<T>
partitionWith(Predicate2<? super T,? super P> predicate, P parameter)
LazyIterable<T>
reject(Predicate<? super T> predicate)
<P> LazyIterable<T>
rejectWith(Predicate2<? super T,? super P> predicate, P parameter)
LazyIterable<T>
select(Predicate<? super T> predicate)
<S> LazyIterable<S>
selectInstancesOf(Class<S> clazz)
<P> LazyIterable<T>
selectWith(Predicate2<? super T,? super P> predicate, P parameter)
int
size()
<V> ObjectDoubleMap<V>
sumByDouble(Function<? super T,? extends V> groupBy, DoubleFunction<? super T> function)
<V> ObjectDoubleMap<V>
sumByFloat(Function<? super T,? extends V> groupBy, FloatFunction<? super T> function)
<V> ObjectLongMap<V>
sumByInt(Function<? super T,? extends V> groupBy, IntFunction<? super T> function)
<V> ObjectLongMap<V>
sumByLong(Function<? super T,? extends V> groupBy, LongFunction<? super T> function)
LazyIterable<T>
take(int count)
LazyIterable<T>
takeWhile(Predicate<? super T> predicate)
LazyIterable<T>
tap(Procedure<? super T> procedure)
<E> E[]
toArray(E[] array)
MutableStack<T>
toStack()
<S> LazyIterable<Pair<T,S>>
zip(Iterable<S> that)
LazyIterable<Pair<T,Integer>>
zipWithIndex()
-
Methods inherited from class org.eclipse.collections.impl.AbstractRichIterable
allSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, collect, collectIf, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, count, countByEach, countWith, detect, detectOptional, detectWith, detectWithIfNone, detectWithOptional, flatCollect, forEach, forEachWith, forEachWithIndex, groupBy, groupByEach, groupByUniqueKey, injectInto, injectInto, injectInto, injectInto, injectInto, max, max, maxBy, min, min, minBy, noneSatisfy, noneSatisfyWith, reject, rejectWith, select, selectWith, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toArray, toBag, toBiMap, toList, toMap, toSet, toSortedBag, toSortedBag, toSortedBagBy, toSortedListBy, toSortedMap, toSortedMap, toSortedMapBy, toSortedSet, toSortedSet, toSortedSetBy, toString, zip, zipWithIndex
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.collections.api.InternalIterable
forEach, forEachWith, forEachWithIndex
-
Methods inherited from interface java.lang.Iterable
iterator, spliterator
-
Methods inherited from interface org.eclipse.collections.api.LazyIterable
flatCollectWith
-
Methods inherited from interface org.eclipse.collections.api.RichIterable
aggregateBy, aggregateBy, aggregateInPlaceBy, allSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, appendString, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, containsAny, containsAnyIterable, containsBy, containsNone, containsNoneIterable, count, countBy, countBy, countByEach, countByEach, countByWith, countByWith, countWith, detect, detectIfNone, detectOptional, detectWith, detectWithIfNone, detectWithOptional, each, flatCollect, flatCollectBoolean, flatCollectByte, flatCollectChar, flatCollectDouble, flatCollectFloat, flatCollectInt, flatCollectLong, flatCollectShort, flatCollectWith, forEach, getAny, groupBy, groupByAndCollect, groupByEach, groupByUniqueKey, injectInto, injectInto, injectInto, injectInto, injectInto, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, makeString, makeString, makeString, makeString, max, max, maxBy, min, min, minBy, noneSatisfy, noneSatisfyWith, notEmpty, reduce, reduceInPlace, reduceInPlace, reject, rejectWith, select, selectWith, summarizeDouble, summarizeFloat, summarizeInt, summarizeLong, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toArray, toBag, toBiMap, toImmutableBag, toImmutableBiMap, toImmutableList, toImmutableMap, toImmutableSet, toImmutableSortedBag, toImmutableSortedBag, toImmutableSortedBagBy, toImmutableSortedList, toImmutableSortedList, toImmutableSortedListBy, toImmutableSortedSet, toImmutableSortedSet, toImmutableSortedSetBy, toList, toMap, toMap, toSet, toSortedBag, toSortedBag, toSortedBagBy, toSortedList, toSortedList, toSortedListBy, toSortedMap, toSortedMap, toSortedMapBy, toSortedSet, toSortedSet, toSortedSetBy, toString, zip, zipWithIndex
-
-
-
-
Method Detail
-
asLazy
public LazyIterable<T> asLazy()
- Specified by:
asLazy
in interfaceRichIterable<T>
- Overrides:
asLazy
in classAbstractRichIterable<T>
-
into
public <R extends Collection<T>> R into(R target)
- Specified by:
into
in interfaceLazyIterable<T>
- Specified by:
into
in interfaceRichIterable<T>
- Overrides:
into
in classAbstractRichIterable<T>
-
toArray
public <E> E[] toArray(E[] array)
- Specified by:
toArray
in interfaceRichIterable<T>
- Overrides:
toArray
in classAbstractRichIterable<T>
-
size
public int size()
- Specified by:
size
in interfaceRichIterable<T>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceRichIterable<T>
- Overrides:
isEmpty
in classAbstractRichIterable<T>
-
getFirst
public T getFirst()
- Specified by:
getFirst
in interfaceLazyIterable<T>
- Specified by:
getFirst
in interfaceRichIterable<T>
-
getLast
public T getLast()
- Specified by:
getLast
in interfaceRichIterable<T>
-
getOnly
public T getOnly()
- Specified by:
getOnly
in interfaceRichIterable<T>
-
select
public LazyIterable<T> select(Predicate<? super T> predicate)
- Specified by:
select
in interfaceLazyIterable<T>
- Specified by:
select
in interfaceRichIterable<T>
-
selectWith
public <P> LazyIterable<T> selectWith(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
selectWith
in interfaceLazyIterable<T>
- Specified by:
selectWith
in interfaceRichIterable<T>
-
reject
public LazyIterable<T> reject(Predicate<? super T> predicate)
- Specified by:
reject
in interfaceLazyIterable<T>
- Specified by:
reject
in interfaceRichIterable<T>
-
rejectWith
public <P> LazyIterable<T> rejectWith(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
rejectWith
in interfaceLazyIterable<T>
- Specified by:
rejectWith
in interfaceRichIterable<T>
-
partition
public PartitionMutableList<T> partition(Predicate<? super T> predicate)
- Specified by:
partition
in interfaceRichIterable<T>
-
partitionWith
public <P> PartitionMutableList<T> partitionWith(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
partitionWith
in interfaceRichIterable<T>
-
selectInstancesOf
public <S> LazyIterable<S> selectInstancesOf(Class<S> clazz)
- Specified by:
selectInstancesOf
in interfaceLazyIterable<T>
- Specified by:
selectInstancesOf
in interfaceRichIterable<T>
-
collect
public <V> LazyIterable<V> collect(Function<? super T,? extends V> function)
- Specified by:
collect
in interfaceLazyIterable<T>
- Specified by:
collect
in interfaceRichIterable<T>
-
collectBoolean
public LazyBooleanIterable collectBoolean(BooleanFunction<? super T> booleanFunction)
- Specified by:
collectBoolean
in interfaceLazyIterable<T>
- Specified by:
collectBoolean
in interfaceRichIterable<T>
-
collectByte
public LazyByteIterable collectByte(ByteFunction<? super T> byteFunction)
- Specified by:
collectByte
in interfaceLazyIterable<T>
- Specified by:
collectByte
in interfaceRichIterable<T>
-
collectChar
public LazyCharIterable collectChar(CharFunction<? super T> charFunction)
- Specified by:
collectChar
in interfaceLazyIterable<T>
- Specified by:
collectChar
in interfaceRichIterable<T>
-
collectDouble
public LazyDoubleIterable collectDouble(DoubleFunction<? super T> doubleFunction)
- Specified by:
collectDouble
in interfaceLazyIterable<T>
- Specified by:
collectDouble
in interfaceRichIterable<T>
-
collectFloat
public LazyFloatIterable collectFloat(FloatFunction<? super T> floatFunction)
- Specified by:
collectFloat
in interfaceLazyIterable<T>
- Specified by:
collectFloat
in interfaceRichIterable<T>
-
collectInt
public LazyIntIterable collectInt(IntFunction<? super T> intFunction)
- Specified by:
collectInt
in interfaceLazyIterable<T>
- Specified by:
collectInt
in interfaceRichIterable<T>
-
collectLong
public LazyLongIterable collectLong(LongFunction<? super T> longFunction)
- Specified by:
collectLong
in interfaceLazyIterable<T>
- Specified by:
collectLong
in interfaceRichIterable<T>
-
collectShort
public LazyShortIterable collectShort(ShortFunction<? super T> shortFunction)
- Specified by:
collectShort
in interfaceLazyIterable<T>
- Specified by:
collectShort
in interfaceRichIterable<T>
-
collectWith
public <P,V> LazyIterable<V> collectWith(Function2<? super T,? super P,? extends V> function, P parameter)
- Specified by:
collectWith
in interfaceLazyIterable<T>
- Specified by:
collectWith
in interfaceRichIterable<T>
-
flatCollect
public <V> LazyIterable<V> flatCollect(Function<? super T,? extends Iterable<V>> function)
- Specified by:
flatCollect
in interfaceLazyIterable<T>
- Specified by:
flatCollect
in interfaceRichIterable<T>
-
concatenate
public LazyIterable<T> concatenate(Iterable<T> iterable)
- Specified by:
concatenate
in interfaceLazyIterable<T>
-
collectIf
public <V> LazyIterable<V> collectIf(Predicate<? super T> predicate, Function<? super T,? extends V> function)
- Specified by:
collectIf
in interfaceLazyIterable<T>
- Specified by:
collectIf
in interfaceRichIterable<T>
-
take
public LazyIterable<T> take(int count)
- Specified by:
take
in interfaceLazyIterable<T>
-
drop
public LazyIterable<T> drop(int count)
- Specified by:
drop
in interfaceLazyIterable<T>
-
takeWhile
public LazyIterable<T> takeWhile(Predicate<? super T> predicate)
- Specified by:
takeWhile
in interfaceLazyIterable<T>
-
dropWhile
public LazyIterable<T> dropWhile(Predicate<? super T> predicate)
- Specified by:
dropWhile
in interfaceLazyIterable<T>
-
distinct
public LazyIterable<T> distinct()
- Specified by:
distinct
in interfaceLazyIterable<T>
-
toStack
public MutableStack<T> toStack()
-
groupBy
public <V> Multimap<V,T> groupBy(Function<? super T,? extends V> function)
- Specified by:
groupBy
in interfaceRichIterable<T>
-
groupByEach
public <V> Multimap<V,T> groupByEach(Function<? super T,? extends Iterable<V>> function)
- Specified by:
groupByEach
in interfaceRichIterable<T>
-
groupByUniqueKey
public <V> MapIterable<V,T> groupByUniqueKey(Function<? super T,? extends V> function)
- Specified by:
groupByUniqueKey
in interfaceRichIterable<T>
-
zip
public <S> LazyIterable<Pair<T,S>> zip(Iterable<S> that)
- Specified by:
zip
in interfaceLazyIterable<T>
- Specified by:
zip
in interfaceRichIterable<T>
-
zipWithIndex
public LazyIterable<Pair<T,Integer>> zipWithIndex()
- Specified by:
zipWithIndex
in interfaceLazyIterable<T>
- Specified by:
zipWithIndex
in interfaceRichIterable<T>
-
chunk
public LazyIterable<RichIterable<T>> chunk(int size)
- Specified by:
chunk
in interfaceLazyIterable<T>
- Specified by:
chunk
in interfaceRichIterable<T>
-
tap
public LazyIterable<T> tap(Procedure<? super T> procedure)
- Specified by:
tap
in interfaceLazyIterable<T>
- Specified by:
tap
in interfaceRichIterable<T>
-
sumByInt
public <V> ObjectLongMap<V> sumByInt(Function<? super T,? extends V> groupBy, IntFunction<? super T> function)
- Specified by:
sumByInt
in interfaceRichIterable<T>
-
sumByFloat
public <V> ObjectDoubleMap<V> sumByFloat(Function<? super T,? extends V> groupBy, FloatFunction<? super T> function)
- Specified by:
sumByFloat
in interfaceRichIterable<T>
-
sumByLong
public <V> ObjectLongMap<V> sumByLong(Function<? super T,? extends V> groupBy, LongFunction<? super T> function)
- Specified by:
sumByLong
in interfaceRichIterable<T>
-
sumByDouble
public <V> ObjectDoubleMap<V> sumByDouble(Function<? super T,? extends V> groupBy, DoubleFunction<? super T> function)
- Specified by:
sumByDouble
in interfaceRichIterable<T>
-
minOptional
public Optional<T> minOptional(Comparator<? super T> comparator)
- Specified by:
minOptional
in interfaceRichIterable<T>
-
maxOptional
public Optional<T> maxOptional(Comparator<? super T> comparator)
- Specified by:
maxOptional
in interfaceRichIterable<T>
-
minOptional
public Optional<T> minOptional()
- Specified by:
minOptional
in interfaceRichIterable<T>
-
maxOptional
public Optional<T> maxOptional()
- Specified by:
maxOptional
in interfaceRichIterable<T>
-
minByOptional
public <V extends Comparable<? super V>> Optional<T> minByOptional(Function<? super T,? extends V> function)
- Specified by:
minByOptional
in interfaceRichIterable<T>
-
maxByOptional
public <V extends Comparable<? super V>> Optional<T> maxByOptional(Function<? super T,? extends V> function)
- Specified by:
maxByOptional
in interfaceRichIterable<T>
-
-