T
- The type of the contained objects.public interface Elements<T> extends Mappable<T>, Filterable<T>, Appendable<T>, Prependable<T>, SideEffectable<T>, Repeatable<T>, HeadAndTail<T>, YieldsJavaCollection<T>, Existance<T>, Iterable<T>, Reducible<T>
Modifier and Type | Method and Description |
---|---|
Elements<T> |
eval()
Force-evaluate the current elements, applying all composed functions
on each element.
|
Elements<T> |
filter(Predicate<? super T> filter)
Provide a predicate that evaluates which element(s) to be
included.
|
<O> Elements<O> |
flatMap(Fn<? super T,? extends Iterable<O>> fn) |
Optional<T> |
head()
Gets the head, or first element, if it exists.
|
Elements<Elem<T>> |
indexed()
Couple each element with its positional index.
|
Elements<Elem<T>> |
indexedFrom(int startIndex)
Couple each element with its positional index,
starting from a given index.
|
String |
join()
Join all elements to one
String . |
String |
join(String separator)
Join all elements to one
String with all
elements joined with the given separator. |
Optional<T> |
last()
Gets the last element.
|
<O> Elements<O> |
map(Fn<? super T,O> function)
Apply a function on any contained element(s), returning the result
in a new mappable container.
|
Elements<T> |
repeat(int times)
Repeat the contained elements a given amount of times.
|
Elements<T> |
tail()
Gets the tail, i.e. the remainder after the head.
|
Elements<T> |
take(int amount)
Take only a maximum amount of elements.
|
Elements<T> |
takeUntil(Predicate<? super T> predicate)
Take elements until a given predicate evaluates to true.
|
Elements<T> |
takeWhile(Predicate<? super T> predicate)
Take elements as long as a given predicate
evaluates to true.
|
append, append
prepend, prepend
forEach, iterator, spliterator
each
Elements<Elem<T>> indexed()
Elem
s.Elements<Elem<T>> indexedFrom(int startIndex)
startIndex
- the beginning index to assign to the first element.Elem
s.Elements<T> take(int amount)
amount
- the amount to take.Elements<T> takeWhile(Predicate<? super T> predicate)
predicate
- The predicate, when evaluates an element to false,
will not include that element, nor any more elements.Elements<T> takeUntil(Predicate<? super T> predicate)
predicate
- The predicate, when evaluates an element to true,
will not include that element, nor any more elements.Optional<T> head()
HeadAndTail
head
in interface HeadAndTail<T>
Elements<T> tail()
HeadAndTail
tail
in interface HeadAndTail<T>
String join()
String
.String join(String separator)
String
with all
elements joined with the given separator.<O> Elements<O> map(Fn<? super T,O> function)
Mappable
Elements<T> filter(Predicate<? super T> filter)
Filterable
filter
in interface Filterable<T>
filter
- The predicate, when evaluates an element to false,
will exclude that element.Elements<T> repeat(int times)
Repeatable
IllegalArgumentException
(eventually)repeat
in interface Repeatable<T>
times
- The amount to repeat.Elements<T> eval()
Elements
.Copyright © 2016. All rights reserved.