Class EachElement


  • public final class EachElement
    extends java.lang.Object
    Generator factory for each element of a "collection".
    Since:
    1.0
    Version:
    $Revision$ $Date$
    • Constructor Summary

      Constructors 
      Constructor Description
      EachElement()
      EachElement instances 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EachElement

        public EachElement()

        EachElement instances should NOT be constructed in standard programming. Instead, the methods of the class should be invoked statically.

        This constructor is public to permit tools that require a JavaBean instance to operate.

    • 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