org.apache.commons.functor.generator.util
Class EachElement

java.lang.Object
  extended by org.apache.commons.functor.generator.util.EachElement

public final class EachElement
extends java.lang.Object

Generator factory for each element of a "collection".

Since:
1.0
Version:
$Revision: 666345 $ $Date: 2008-06-10 17:13:44 -0500 (Tue, 10 Jun 2008) $
Author:
Jason Horman (jason@jhorman.org)

Constructor Summary
EachElement()
          Create a new EachElement for bean-dependent APIs.
 
Method Summary
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(E[] array)
          Get a Generator for each element of an Object[].
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EachElement

public EachElement()
Create a new EachElement for bean-dependent APIs.

Method Detail

from

public static final <E> Generator<E> from(java.util.Collection<? extends E> collection)
Get a Generator for each element of a Collection.

Parameters:
collection - to iterate
Returns:
Generator

from

public static final <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.

Parameters:
map - to iterate
Returns:
Generator

from

public static final <E> Generator<E> from(E[] array)
Get a Generator for each element of an Object[].

Parameters:
array - to iterate
Returns:
Generator

from

public static final <E> Generator<E> from(java.util.Iterator<? extends E> iter)
Get a Generator for each element of an Iterator.

Parameters:
iter - to iterate
Returns:
Generator


Copyright © 2003-2008 The Apache Software Foundation. All Rights Reserved.