| Modifier and Type | Class and Description |
|---|---|
(package private) class |
AbstractEnumerable<E>
Abstract implementation of the
Enumerable interface. |
class |
CachedEnumerable<E>
Enumerable that caches the elements being enumerated. |
(package private) class |
ChoiceEnumerable<E>
Enumerable that chooses among the elements of the given
Iterator instances. |
(package private) class |
EnumeratorEnumerable<E>
Enumerable that encapsulates an enumerator. |
(package private) class |
IterableEnumerable<E>
Enumerable encapsulating an Iterable. |
class |
LateBindingEnumerable<E>
Enumerable whose source of elements can be defined after
construction. |
(package private) class |
LazyEnumerable<E>
Enumerable that retrieves its source of elements lazily. |
class |
OnceEnumerable<E>
EnumeratorEnumerable that yields one enumerator only. |
(package private) class |
PipeEnumerable<T,E>
Enumerable that support high compositionality. |
(package private) class |
SuppliedEnumerable<E>
Enumerable that returns enumerators yielded by a Supplier. |
| Modifier and Type | Field and Description |
|---|---|
Enumerable<E> |
CachedEnumerableState.source
Enumerable instance providing the elements to cache. |
| Modifier and Type | Method and Description |
|---|---|
default Enumerable<E> |
Enumerable.append(E... elements)
Appends the given elements to the end of the current
Enumerable. |
default <T> Enumerable<T> |
Enumerable.as(Class<T> clazz)
Converts the current enumerable to another type.
|
default <T> Enumerable<T> |
Enumerable.asFiltered(Class<T> clazz)
Converts and filters the current enumerable to another type.
|
default Enumerable<E> |
Enumerable.asTolerant(Consumer<? super Exception> handler)
Returns a tolerant
Enumerable with 0 retries enumerating
over the elements of the current Enumerable. |
default Enumerable<E> |
Enumerable.asTolerant(Consumer<? super Exception> handler,
int retries)
Returns a tolerant
Enumerable enumerating over the elements
of the current Enumerable. |
static <E> Enumerable<E> |
Enumerable.choiceOf(Supplier<IntSupplier> indexSupplier,
Iterable<E> first,
Iterable<? extends E> second,
Iterable<? extends E>... rest)
Returns an
Enumerable that chooses its elements from other
Iterable instances. |
static <E> Enumerable<E> |
Enumerable.choiceOf(Supplier<IntSupplier> indexSupplier,
Supplier<IntUnaryOperator> altIndexSupplier,
Iterable<E> first,
Iterable<? extends E> second,
Iterable<? extends E>... rest)
Returns an
Enumerable that chooses its elements from other
Iterable instances. |
static <E> Enumerable<E> |
PipeEnumerable.concat(Enumerable<E> enumerable,
Iterable<? extends E> elements)
Concatenates the given
elements to the given enumerable. |
default Enumerable<E> |
Enumerable.concat(Iterable<? extends E> elements)
Concatenates the given
Iterable to the current
Enumerable. |
default Enumerable<E> |
Enumerable.concatOn(E... elements)
Concatenates the given elements to the current
Enumerable. |
default Enumerable<E> |
Enumerable.distinct()
Returns an
Enumerable enumerating over the distinct elements
of the current Enumerable. |
static <E> Enumerable<E> |
PipeEnumerable.distinct(Enumerable<E> enumerable)
Returns an
Enumerable that has the same elements as the given
enumerable but with duplicates removed. |
static <E> Enumerable<E> |
Enumerable.empty()
Returns an
Enumerable with no elements. |
static <E> Enumerable<E> |
PipeEnumerable.filter(Enumerable<E> enumerable,
Predicate<? super E> predicate)
Returns an
Enumerable that has the elements of the given
enumerable that pass the given predicate. |
default Enumerable<E> |
Enumerable.filter(Predicate<? super E> predicate)
Returns an
Enumerable enumerating over the current elements
satisfying the given Predicate. |
static <E,R> Enumerable<R> |
PipeEnumerable.flatMap(Enumerable<E> enumerable,
Function<? super E,? extends Iterable<? extends R>> mapper)
Returns an
Enumerable that replaces the elements of the given
enumerable with the elements of the Iterable obtained
by applying the given mapper on the each element. |
default <R> Enumerable<R> |
Enumerable.flatMap(Function<? super E,? extends Iterable<? extends R>> mapper)
Returns an
Enumerable enumerating over the iterables produced
by applying the given mapper over the elements of the current
Enumerable. |
static <E> Enumerable<E> |
Enumerable.iterate(E seed,
UnaryOperator<E> f)
Returns an
Enumerable enumerating over the elements generated by
repeatedly applying the given unary operator on the given seed. |
static <E> Enumerable<E> |
PipeEnumerable.limit(Enumerable<E> enumerable,
long maxSize)
Returns an
Enumerable that limits the elements of the given
enumerable to the given limit. |
default Enumerable<E> |
Enumerable.limit(long maxSize)
Returns an
Enumerable enumerating over the current elements up to
the given limit. |
static <E> Enumerable<E> |
PipeEnumerable.limitWhile(Enumerable<E> enumerable,
Predicate<? super E> predicate)
Returns an
Enumerable that limits the elements of the given
enumerable while the given predicate holds true when
applied on the elements of the given enumerable. |
default Enumerable<E> |
Enumerable.limitWhile(Predicate<? super E> predicate)
Returns an
Enumerable enumerating over the current elements while
the given predicate holds true. |
default <R> Enumerable<R> |
Enumerable.map(BiFunction<? super E,? super Long,? extends R> mapper)
Returns an
Enumerable enumerating over the current indexed
elements mapped by the given mapper. |
static <E,R> Enumerable<R> |
PipeEnumerable.map(Enumerable<E> enumerable,
BiFunction<? super E,? super Long,? extends R> mapper)
Returns an
Enumerable that maps the elements of the given
enumerable to the values mapped by mapper applied on
each element and its index. |
static <E,R> Enumerable<R> |
PipeEnumerable.map(Enumerable<E> enumerable,
Function<? super E,? extends R> mapper)
Returns an
Enumerable that maps the elements of the given
enumerable to the values mapped by mapper applied on
each element and its index. |
default <R> Enumerable<R> |
Enumerable.map(Function<? super E,? extends R> mapper)
Returns an
Enumerable enumerating over the current elements
mapped by the given mapper. |
static <E> Enumerable<E> |
IterableEnumerable.of(Iterable<E> source)
Constructs an
Enumerable from an Iterable. |
static <E> Enumerable<E> |
Enumerable.of(Iterable<E> source)
Returns an
Enumerable enumerating over the given Iterable
source. |
static <E> Enumerable<E> |
Enumerable.ofLazyIterable(Supplier<? extends Iterable<E>> source)
Returns an
Enumerable enumerating over an Iterable
supplied lazily. |
static <E> Enumerable<E> |
Enumerable.on(E... elements)
Returns an
Enumerable enumerating over the given elements. |
default Enumerable<E> |
Enumerable.peek(Consumer<? super E> action)
Returns an
Enumerable enumerating the current elements while
feeding them to the given Consumer. |
static <E> Enumerable<E> |
PipeEnumerable.peek(Enumerable<E> enumerable,
Consumer<? super E> action)
Returns an
Enumerable that peeks the elements of the given
enumerable, applies the given action on each of them
and then returns the elements unchanged. |
default Enumerable<E> |
Enumerable.prepend(Iterable<? extends E> elements)
Prepends the current
Enumerable by the given Iterable. |
default Enumerable<E> |
Enumerable.prependOn(E... elements)
Prepends the current
Enumerable by the given elements. |
static <E> Enumerable<E> |
Enumerable.range(E startInclusive,
E endExclusive,
UnaryOperator<E> succ,
Comparator<? super E> cmp)
Returns an
Enumerable enumerating over a range of elements. |
static <E> Enumerable<E> |
Enumerable.rangeClosed(E startInclusive,
E endInclusive,
UnaryOperator<E> succ,
Comparator<? super E> cmp)
Returns an
Enumerable enumerating over a range of elements. |
static Enumerable<Integer> |
Enumerable.rangeInt(int startInclusive,
int endExclusive)
Returns an
Enumerable enumerating over a range of integers. |
static Enumerable<Integer> |
Enumerable.rangeIntClosed(int startInclusive,
int endInclusive)
Returns an
Enumerable enumerating over a range of integers. |
static Enumerable<Long> |
Enumerable.rangeLong(long startInclusive,
long endExclusive)
Returns an
Enumerable enumerating over a range of long integers. |
static Enumerable<Long> |
Enumerable.rangeLongClosed(long startInclusive,
long endInclusive)
Returns an
Enumerable enumerating over a range of long integers. |
static <E> Enumerable<E> |
Enumerable.repeat(E element,
long count)
Returns an
Enumerable repeating the given element the given
number of time. |
default Enumerable<E> |
Enumerable.repeatAll(int count)
Returns an
Enumerable repeating all the current elements the
given number of times. |
default Enumerable<E> |
Enumerable.repeatEach(long count)
Returns an
Enumerable repeating each current element the given
number of times. |
default Enumerable<E> |
Enumerable.reverse()
Returns an
Enumerable enumerating over the current elements in
reversed order. |
static <E> Enumerable<E> |
PipeEnumerable.skip(Enumerable<E> enumerable,
long n)
Returns an
Enumerable that skips n times over the
elements of the given enumerable. |
default Enumerable<E> |
Enumerable.skip(long n)
Returns an
Enumerable that skips the given number of current
elements. |
static <E> Enumerable<E> |
PipeEnumerable.skipWhile(Enumerable<E> enumerable,
Predicate<? super E> predicate)
Returns an
Enumerable that skips the elements of the given
enumerable while the given predicate holds true. |
default Enumerable<E> |
Enumerable.skipWhile(Predicate<? super E> predicate)
Returns an
Enumerable that skips while the given condition
holds true. |
default Enumerable<E> |
Enumerable.sorted()
Returns an
Enumerable enumerating over the current elements
in sorted order. |
default Enumerable<E> |
Enumerable.sorted(Comparator<? super E> comparator)
Returns an
Enumerable enumerating over the current elements
in sorted order according to the given comparator. |
default Enumerable<E> |
Enumerable.take(long n)
Returns an
Enumerable enumerating over the current elements up to
the given limit. |
static <E> Enumerable<E> |
PipeEnumerable.takeWhile(Enumerable<E> enumerable,
Predicate<? super E> predicate)
Returns an
Enumerable that limits the elements of the given
enumerable while the given predicate holds true when
applied on the elements of the given enumerable. |
default Enumerable<E> |
Enumerable.takeWhile(Predicate<? super E> predicate)
Returns an
Enumerable enumerating over the current elements while
the given predicate holds true. |
default Enumerable<E> |
Enumerable.union(Iterable<E> others)
Returns an
Enumerable enumerating over the current elements and
over the given Iterable while avoiding duplicates. |
default Enumerable<E> |
Enumerable.unionOn(E... others)
Returns an
Enumerable enumerating over the current elements and
over the given elements while avoiding duplicates. |
static <E> Enumerable<Optional<E>[]> |
PipeEnumerable.zipAll(Enumerable<E> enumerable,
Iterable<? extends E> first,
Iterable<? extends E>... rest)
Returns an
Enumerable that zips the elements of the given
enumerable with the elements of the first
Iterable and the elements of the rest of the given
Iterable instances. |
default Enumerable<Optional<E>[]> |
Enumerable.zipAll(Iterable<? extends E> first,
Iterable<? extends E>... rest)
Returns an
Enumerable consisting of an array of Optional
objects containing elements from the current enumerator and
the given Iterable instances, while any has elements. |
default <T> Enumerable<Pair<Optional<E>,Optional<T>>> |
Enumerable.zipAny(Iterable<T> elements)
Returns an
Enumerable consisting of pairs of elements from the
current enumerator and the given Iterable, while any
of them has elements. |
default <T> Enumerable<Pair<E,T>> |
Enumerable.zipBoth(Enumerable<T> elements)
Returns an
Enumerable consisting of pairs of elements from the
current enumerator and the given Iterable, while both
have elements. |
default <T> Enumerable<Pair<E,Optional<T>>> |
Enumerable.zipLeft(Iterable<T> elements)
Returns an
Enumerable consisting of pairs of elements from the
current enumerator and the given Iterable, while the current
enumerator has elements. |
default <T> Enumerable<Pair<Optional<E>,T>> |
Enumerable.zipRight(Iterable<T> elements)
Returns an
Enumerable consisting of pairs of elements from the
current enumerator and the given Iterable, while the provided
iterator has elements. |
| Modifier and Type | Method and Description |
|---|---|
static <E> Enumerable<E> |
PipeEnumerable.concat(Enumerable<E> enumerable,
Iterable<? extends E> elements)
Concatenates the given
elements to the given enumerable. |
static <E> Enumerable<E> |
PipeEnumerable.distinct(Enumerable<E> enumerable)
Returns an
Enumerable that has the same elements as the given
enumerable but with duplicates removed. |
static void |
Checks.ensureNonEnumerating(Enumerable<?> enumerable)
Checks that an
enumerable is not enumerating. |
static <E> Enumerable<E> |
PipeEnumerable.filter(Enumerable<E> enumerable,
Predicate<? super E> predicate)
Returns an
Enumerable that has the elements of the given
enumerable that pass the given predicate. |
static <E,R> Enumerable<R> |
PipeEnumerable.flatMap(Enumerable<E> enumerable,
Function<? super E,? extends Iterable<? extends R>> mapper)
Returns an
Enumerable that replaces the elements of the given
enumerable with the elements of the Iterable obtained
by applying the given mapper on the each element. |
static <E> Enumerable<E> |
PipeEnumerable.limit(Enumerable<E> enumerable,
long maxSize)
Returns an
Enumerable that limits the elements of the given
enumerable to the given limit. |
static <E> Enumerable<E> |
PipeEnumerable.limitWhile(Enumerable<E> enumerable,
Predicate<? super E> predicate)
Returns an
Enumerable that limits the elements of the given
enumerable while the given predicate holds true when
applied on the elements of the given enumerable. |
static <E,R> Enumerable<R> |
PipeEnumerable.map(Enumerable<E> enumerable,
BiFunction<? super E,? super Long,? extends R> mapper)
Returns an
Enumerable that maps the elements of the given
enumerable to the values mapped by mapper applied on
each element and its index. |
static <E,R> Enumerable<R> |
PipeEnumerable.map(Enumerable<E> enumerable,
Function<? super E,? extends R> mapper)
Returns an
Enumerable that maps the elements of the given
enumerable to the values mapped by mapper applied on
each element and its index. |
static <E> Enumerable<E> |
PipeEnumerable.peek(Enumerable<E> enumerable,
Consumer<? super E> action)
Returns an
Enumerable that peeks the elements of the given
enumerable, applies the given action on each of them
and then returns the elements unchanged. |
static <E> Enumerable<E> |
PipeEnumerable.skip(Enumerable<E> enumerable,
long n)
Returns an
Enumerable that skips n times over the
elements of the given enumerable. |
static <E> Enumerable<E> |
PipeEnumerable.skipWhile(Enumerable<E> enumerable,
Predicate<? super E> predicate)
Returns an
Enumerable that skips the elements of the given
enumerable while the given predicate holds true. |
static <E> Enumerable<E> |
PipeEnumerable.takeWhile(Enumerable<E> enumerable,
Predicate<? super E> predicate)
Returns an
Enumerable that limits the elements of the given
enumerable while the given predicate holds true when
applied on the elements of the given enumerable. |
static <E> Enumerable<Optional<E>[]> |
PipeEnumerable.zipAll(Enumerable<E> enumerable,
Iterable<? extends E> first,
Iterable<? extends E>... rest)
Returns an
Enumerable that zips the elements of the given
enumerable with the elements of the first
Iterable and the elements of the rest of the given
Iterable instances. |
default <T> Enumerable<Pair<E,T>> |
Enumerable.zipBoth(Enumerable<T> elements)
Returns an
Enumerable consisting of pairs of elements from the
current enumerator and the given Iterable, while both
have elements. |
| Constructor and Description |
|---|
CachedEnumerable(Enumerable<E> source)
Constructs a
CachedEnumerable instance that caches the elements
of the given source Enumerable. |
CachedEnumerable(Enumerable<E> source,
long limit,
Consumer<CachedEnumerable<E>> onLimitCallback)
Constructs a
CachedEnumerable instance that caches the elements
of the given source Enumerable up to the given limit. |
CachedEnumerableState(Enumerable<E> source,
CachedEnumerable<E> cachedSource,
long limit,
Consumer<CachedEnumerable<E>> callback)
Constructs a
CachedEnumerableState containing the given
source, cache size and callback. |
Copyright © 2016. All rights reserved.