public abstract class Applications extends Object
| Constructor and Description |
|---|
Applications() |
| Modifier and Type | Method and Description |
|---|---|
static <E> void |
each(E[] array,
Action<E> action)
Applies a side effect on each elements of the source array.
|
static <E> void |
each(Iterable<E> iterable,
Action<E> action)
Applies a side effect on each elements of the source iterable.
|
static <E> void |
each(Iterator<E> iterator,
Action<E> action)
Applies a side effect on each elements of the source iterator.
|
static <R,E> List<R> |
map(E[] array,
Delegate<R,E> delegate)
Creates a List yielding the result of the transformation applied by the
delegate on the elements of the source array.
|
static <R,E> List<R> |
map(Iterable<E> iterable,
Delegate<R,E> delegate)
Creates a List yielding the result of the transformation applied by the
delegate on the elements of the source iterable.
|
static <R,E> List<R> |
map(Iterator<E> iterator,
Delegate<R,E> delegate)
Creates a List yielding the result of the transformation applied by the
delegate on the elements of the source iterator.
|
static <E> Iterator<E> |
tap(E[] array,
Action<E> action)
Creates an iterator yielding each element of the source array after
applying the passed action.
|
static <E> Iterator<E> |
tap(Iterable<E> iterable,
Action<E> action)
Creates an iterator yielding each element of the source iterable after
applying the passed action.
|
static <E> Iterator<E> |
tap(Iterator<E> iterator,
Action<E> action)
Creates an iterator yielding each element of the source iterator after
applying the passed action.
|
static <R,E> Iterator<R> |
transform(E[] array,
Delegate<R,E> delegate)
Creates an iterator yielding the result of the transformation applied by
the delegate on the elements of the source array.
|
static <R,E> Iterator<R> |
transform(Iterable<E> iterable,
Delegate<R,E> delegate)
Creates an iterator yielding the result of the transformation applied by
the delegate on the elements of the source iterable.
|
static <R,E> Iterator<R> |
transform(Iterator<E> iterator,
Delegate<R,E> delegate)
Creates an iterator yielding the result of the transformation applied by
the delegate on the elements of the source iterator.
|
public static <R,E> Iterator<R> transform(Iterable<E> iterable, Delegate<R,E> delegate)
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 fromdelegate - a delegate used to transform each elementpublic static <R,E> Iterator<R> transform(Iterator<E> iterator, Delegate<R,E> delegate)
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 fromdelegate - a delegate used to transform each elementpublic static <R,E> Iterator<R> transform(E[] array, Delegate<R,E> delegate)
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 fromdelegate - a delegate used to transform each elementpublic static <E> Iterator<E> tap(Iterator<E> iterator, Action<E> action)
tap([1,2,3], sideEffect) -> [1, 2, 3]
E - the element type parameteriterator - the iteratoraction - the action to be appliedpublic static <E> Iterator<E> tap(Iterable<E> iterable, Action<E> action)
tap([1,2,3], sideEffect) -> [1, 2, 3]
E - the element type parameteriterable - the iterableaction - the action to be appliedpublic static <E> Iterator<E> tap(E[] array, Action<E> action)
tap([1,2,3], sideEffect) -> [1, 2, 3]
E - the element type parameterarray - the arrayaction - the action to be appliedpublic static <E> void each(Iterable<E> iterable, Action<E> action)
> each([1,2], println) -> void
1
2
>
E - the iterable element type parameteriterable - the iterable where elements are fetched fromaction - the action applied to every element fetched from the
iterablepublic static <E> void each(Iterator<E> iterator, Action<E> action)
> each([1,2], println) -> void
1
2
>
E - the iterator element type parameteriterator - the iterator where elements are fetched fromaction - the action applied to every element fetched from the
iteratorpublic static <E> void each(E[] array,
Action<E> action)
> each([1,2], println) -> void
1
2
>
E - the array element type parameterarray - the array where elements are fetched fromaction - the action applied to every element fetched from the arraypublic static <R,E> List<R> map(Iterable<E> iterable, Delegate<R,E> delegate)
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 fromdelegate - a delegate used to transform each elementpublic static <R,E> List<R> map(Iterator<E> iterator, Delegate<R,E> delegate)
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 fromdelegate - a delegate used to transform each elementpublic static <R,E> List<R> map(E[] array, Delegate<R,E> delegate)
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 fromdelegate - a delegate used to transform each elementCopyright © 2013. All rights reserved.