Class EachElement
- java.lang.Object
-
- org.apache.commons.functor.generator.util.EachElement
-
public final class EachElement extends java.lang.ObjectGenerator factory for each element of a "collection".- Since:
- 1.0
- Version:
- $Revision$ $Date$
-
-
Constructor Summary
Constructors Constructor Description EachElement()EachElementinstances should NOT be constructed in standard programming.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <E> Generator<E>from(E[] array)Get a Generator for each element of an Object[].static <E> Generator<E>from(java.util.Collection<? extends E> collection)Get a Generator for each element of a Collection.static <E> Generator<E>from(java.util.Iterator<? extends E> iter)Get a Generator for each element of an Iterator.static <K,V>
Generator<java.util.Map.Entry<K,V>>from(java.util.Map<? extends K,? extends V> map)Get a Generator for each entry of a Map.
-
-
-
Method Detail
-
from
public static <E> Generator<E> from(java.util.Collection<? extends E> collection)
Get a Generator for each element of a Collection.- Type Parameters:
E- the type of elements held in the input collection.- Parameters:
collection- to iterate- Returns:
- Generator
-
from
public static <K,V> Generator<java.util.Map.Entry<K,V>> from(java.util.Map<? extends K,? extends V> map)
Get a Generator for each entry of a Map.- Type Parameters:
K- the type of keys maintained by the input map.V- the type of mapped values in the input map.- Parameters:
map- to iterate- Returns:
- Generator
-
from
public static <E> Generator<E> from(E[] array)
Get a Generator for each element of an Object[].- Type Parameters:
E- the type of elements held in the input array.- Parameters:
array- to iterate- Returns:
- Generator
-
from
public static <E> Generator<E> from(java.util.Iterator<? extends E> iter)
Get a Generator for each element of an Iterator.- Type Parameters:
E- the type of elements held in the input iterator.- Parameters:
iter- to iterate- Returns:
- Generator
-
-