public abstract class Applications extends Object
| Constructor and Description |
|---|
Applications() |
| Modifier and Type | Method and Description |
|---|---|
static <E> void |
each(E[] array,
Consumer<E> consumer)
Applies a side effect on each elements of the source array.
|
static <E> void |
each(Iterable<E> iterable,
Consumer<E> consumer)
Applies a side effect on each elements of the source iterable.
|
static <E> void |
each(Iterator<E> iterator,
Consumer<E> consumer)
Applies a side effect on each elements of the source iterator.
|
static <R,E> List<R> |
map(E[] array,
Function<E,R> function)
Creates a List yielding the result of the transformation applied by the
function on the elements of the source array.
|
static <R,E> List<R> |
map(Iterable<E> iterable,
Function<E,R> function)
Creates a List yielding the result of the transformation applied by the
function on the elements of the source iterable.
|
static <R,E> List<R> |
map(Iterator<E> iterator,
Function<E,R> function)
Creates a List yielding the result of the transformation applied by the
function on the elements of the source iterator.
|
static <E> Iterator<E> |
tap(E[] array,
Consumer<E> consumer)
Creates an iterator yielding each element of the source array after
applying the passed consumer.
|
static <E> Iterator<E> |
tap(Iterable<E> iterable,
Consumer<E> consumer)
Creates an iterator yielding each element of the source iterable after
applying the passed consumer.
|
static <E> Iterator<E> |
tap(Iterator<E> iterator,
Consumer<E> consumer)
Creates an iterator yielding each element of the source iterator after
applying the passed consumer.
|
static <R,E> Iterator<R> |
transform(E[] array,
Function<E,R> function)
Creates an iterator yielding the result of the transformation applied by
the function on the elements of the source array.
|
static <R,E> Iterator<R> |
transform(Iterable<E> iterable,
Function<E,R> function)
Creates an iterator yielding the result of the transformation applied by
the function on the elements of the source iterable.
|
static <R,E> Iterator<R> |
transform(Iterator<E> iterator,
Function<E,R> function)
Creates an iterator yielding the result of the transformation applied by
the function on the elements of the source iterator.
|
public static <R,E> Iterator<R> transform(Iterable<E> iterable, Function<E,R> function)
transform([1,2,3], toStringTransformer) -> ["1", "2", "3"]
R - the result iterator element type parameterE - the input iterable element type parameteriterable - the iterable where elements are fetched fromfunction - a function used to transform each elementpublic static <R,E> Iterator<R> transform(Iterator<E> iterator, Function<E,R> function)
transform([1,2,3], toStringTransformer) -> ["1", "2", "3"]
R - the result iterator element type parameterE - the input iterator element type parameteriterator - the iterator where elements are fetched fromfunction - a function used to transform each elementpublic static <R,E> Iterator<R> transform(E[] array, Function<E,R> function)
transform([1,2,3], toStringTransformer) -> ["1", "2", "3"]
R - the result iterator element type parameterE - the input array element type parameterarray - the array where elements are fetched fromfunction - a function used to transform each elementpublic static <E> Iterator<E> tap(Iterator<E> iterator, Consumer<E> consumer)
tap([1,2,3], sideEffect) -> [1, 2, 3]
E - the element type parameteriterator - the iteratorconsumer - the consumer to be appliedpublic static <E> Iterator<E> tap(Iterable<E> iterable, Consumer<E> consumer)
tap([1,2,3], sideEffect) -> [1, 2, 3]
E - the element type parameteriterable - the iterableconsumer - the consumer to be appliedpublic static <E> Iterator<E> tap(E[] array, Consumer<E> consumer)
tap([1,2,3], sideEffect) -> [1, 2, 3]
E - the element type parameterarray - the arrayconsumer - the consumer to be appliedpublic static <E> void each(Iterable<E> iterable, Consumer<E> consumer)
> each([1,2], println) -> void
1
2
>
E - the iterable element type parameteriterable - the iterable where elements are fetched fromconsumer - the consumer applied to every element fetched from the
iterablepublic static <E> void each(Iterator<E> iterator, Consumer<E> consumer)
> each([1,2], println) -> void
1
2
>
E - the iterator element type parameteriterator - the iterator where elements are fetched fromconsumer - the consumer applied to every element fetched from the
iteratorpublic static <E> void each(E[] array,
Consumer<E> consumer)
> each([1,2], println) -> void
1
2
>
E - the array element type parameterarray - the array where elements are fetched fromconsumer - the consumer applied to every element fetched from the arraypublic static <R,E> List<R> map(Iterable<E> iterable, Function<E,R> function)
map([1,2,3], toStringTransformer) -> ["1", "2", "3"]
R - the result iterator element type parameterE - the input array element type parameteriterable - the iterable where elements are fetched fromfunction - a function used to transform each elementpublic static <R,E> List<R> map(Iterator<E> iterator, Function<E,R> function)
map([1,2,3], toStringTransformer) -> ["1", "2", "3"]
R - the result iterator element type parameterE - the input array element type parameteriterator - the iterator where elements are fetched fromfunction - a function used to transform each elementpublic static <R,E> List<R> map(E[] array, Function<E,R> function)
map([1,2,3], toStringTransformer) -> ["1", "2", "3"]
R - the result iterator element type parameterE - the input array element type parameterarray - the array where elements are fetched fromfunction - a function used to transform each elementCopyright © 2017. All rights reserved.