@ReadOnly @Functional public interface InfiniteIterable<ELEMENT> extends FunctionalIterable<ELEMENT>
| Modifier and Type | Method and Description |
|---|---|
default @Nonnull InfiniteIterable<ELEMENT> |
filter(@Nonnull FailablePredicate<? super ELEMENT,?> predicate)
Returns the elements of this iterable that satisfy the given predicate.
|
default @Nonnull InfiniteIterable<ELEMENT> |
filterNot(@Nonnull FailablePredicate<? super ELEMENT,?> predicate)
Returns the elements of this iterable that do not satisfy the given predicate.
|
default @Nonnull InfiniteIterable<ELEMENT> |
filterNulls()
Returns the elements of this iterable without the null values.
|
default <TYPE> @Nonnull InfiniteIterable<TYPE> |
flatten(@Positive int level)
Returns the elements of this iterable with all collections up to the given level flattened.
|
default <TYPE> @Nonnull InfiniteIterable<TYPE> |
flattenAll()
Returns the elements of this iterable with all collections directly or indirectly contained in this iterable flattened.
|
default <TYPE> @Nonnull InfiniteIterable<TYPE> |
flattenOne()
Returns the elements of this iterable with all collections directly contained in this iterable flattened.
|
static <ELEMENT> @Nonnull InfiniteIterable<ELEMENT> |
generate(@Nonnull Producer<? extends FailableProducer<? extends ELEMENT,?>> producer)
Returns a new infinite iterable that generates an infinite number of elements with the producer produced by the given producer.
|
default <TYPE> @Nonnull InfiniteIterable<TYPE> |
instanceOf(@Nonnull Class<TYPE> type)
Returns the elements of this iterable which are an instance of the given type.
|
default boolean |
isEmpty()
Returns whether this iterable is empty.
|
static <ELEMENT> @Nonnull InfiniteIterable<ELEMENT> |
iterate(ELEMENT firstElement,
@Nonnull FailableUnaryOperator<ELEMENT,?> unaryOperator)
Returns a new infinite iterable that iterates over the sequence produced by the given operator from the given first element.
|
default <TYPE> @Nonnull InfiniteIterable<TYPE> |
map(@Nonnull FailableUnaryFunction<? super ELEMENT,? extends TYPE,?> function)
Returns the elements of this iterable mapped by the given function.
|
static <ELEMENT> @Nonnull InfiniteIterable<ELEMENT> |
repeat(ELEMENT element)
Returns a new infinite iterable that repeats the given element infinitely.
|
default @NonNegative int |
size(@Positive int limit)
Returns the size of this iterable or the given limit if the size is greater than the limit.
|
default @Nonnull InfiniteIterable<ELEMENT> |
skip(@Positive int number)
Returns the elements of this iterable after discarding the given number of elements from the beginning.
|
default <TYPE> @Nonnull InfiniteIterable<Pair<ELEMENT,TYPE>> |
zipLongest(@Nonnull FiniteIterable<? extends TYPE> iterable)
Returns the elements from this and the given iterable as pairs, where the i-th pair contains the i-th element of each iterable.
|
default <TYPE> @Nonnull InfiniteIterable<Pair<ELEMENT,TYPE>> |
zipShortest(@Nonnull InfiniteIterable<? extends TYPE> iterable)
Returns the elements from this and the given iterable as pairs, where the i-th pair contains the i-th element of each iterable.
|
extract, get, hasSize, isEmptyOrSingle, isSingle, iterator, limit, sizeAtLeast, sizeAtMost, zipLongest, zipShortestforEach, spliterator@Pure @Nonnull static <ELEMENT> @Nonnull InfiniteIterable<ELEMENT> repeat(@Captured ELEMENT element)
@Pure @Nonnull static <ELEMENT> @Nonnull InfiniteIterable<ELEMENT> iterate(@Captured ELEMENT firstElement, @Nonnull @Nonnull FailableUnaryOperator<ELEMENT,?> unaryOperator)
@Pure @Nonnull static <ELEMENT> @Nonnull InfiniteIterable<ELEMENT> generate(@Captured @Nonnull @Nonnull Producer<? extends FailableProducer<? extends ELEMENT,?>> producer)
FunctionalIterable.get(int) are no longer side-effect free and calling them repeatedly leads to unexpected results.@Pure default boolean isEmpty()
FunctionalIterableisEmpty in interface FunctionalIterable<ELEMENT>@Pure
@NonNegative
default @NonNegative int size(@Positive
@Positive int limit)
FunctionalIterablesize in interface FunctionalIterable<ELEMENT>@Pure @Nonnull default @Nonnull InfiniteIterable<ELEMENT> filter(@Nonnull @Nonnull FailablePredicate<? super ELEMENT,?> predicate)
FunctionalIterableIterationException.filter in interface FunctionalIterable<ELEMENT>@Pure @Nonnull default @Nonnull InfiniteIterable<ELEMENT> filterNot(@Nonnull @Nonnull FailablePredicate<? super ELEMENT,?> predicate)
FunctionalIterableIterationException.filterNot in interface FunctionalIterable<ELEMENT>@Pure @Nonnull default @Nonnull InfiniteIterable<ELEMENT> filterNulls()
FunctionalIterablefilterNulls in interface FunctionalIterable<ELEMENT>@Pure @Nonnull default <TYPE> @Nonnull InfiniteIterable<TYPE> map(@Nonnull @Nonnull FailableUnaryFunction<? super ELEMENT,? extends TYPE,?> function)
FunctionalIterableIterationException.map in interface FunctionalIterable<ELEMENT>@Pure @Nonnull default <TYPE> @Nonnull InfiniteIterable<TYPE> instanceOf(@Nonnull @Nonnull Class<TYPE> type)
FunctionalIterableinstanceOf in interface FunctionalIterable<ELEMENT>@Pure @Nonnull default @Nonnull InfiniteIterable<ELEMENT> skip(@Positive @Positive int number)
FunctionalIterableskip in interface FunctionalIterable<ELEMENT>@Pure @Nonnull default <TYPE> @Nonnull InfiniteIterable<Pair<ELEMENT,TYPE>> zipShortest(@Nonnull @Nonnull InfiniteIterable<? extends TYPE> iterable)
FunctionalIterablezipShortest in interface FunctionalIterable<ELEMENT>@Pure @Nonnull default <TYPE> @Nonnull InfiniteIterable<Pair<ELEMENT,TYPE>> zipLongest(@Nonnull @Nonnull FiniteIterable<? extends TYPE> iterable)
FunctionalIterablezipLongest in interface FunctionalIterable<ELEMENT>@Pure @Nonnull default <TYPE> @Nonnull InfiniteIterable<TYPE> flatten(@Positive @Positive int level)
FunctionalIterableflatten in interface FunctionalIterable<ELEMENT>@Pure @Nonnull default <TYPE> @Nonnull InfiniteIterable<TYPE> flattenOne()
FunctionalIterableflattenOne in interface FunctionalIterable<ELEMENT>@Pure @Nonnull default <TYPE> @Nonnull InfiniteIterable<TYPE> flattenAll()
FunctionalIterableflattenAll in interface FunctionalIterable<ELEMENT>Copyright © 2017. All rights reserved.