Class ConverterIterable<I,​O>

  • Type Parameters:
    I - The input type.
    O - The output type.
    All Implemented Interfaces:
    java.lang.Iterable<O>

    public class ConverterIterable<I,​O>
    extends java.lang.Object
    implements java.lang.Iterable<O>
    An iterable that returns instances of a ConverterIterator..
    Author:
    Garret Wilson
    See Also:
    Converter
    • Constructor Summary

      Constructors 
      Constructor Description
      ConverterIterable​(java.lang.Iterable<I> iterable, Converter<I,​O> converter)
      Iterable and converter constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Converter<I,​O> getConverter()  
      protected java.lang.Iterable<I> getIterable()  
      java.util.Iterator<O> iterator()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Constructor Detail

      • ConverterIterable

        public ConverterIterable​(java.lang.Iterable<I> iterable,
                                 Converter<I,​O> converter)
        Iterable and converter constructor.
        Parameters:
        iterable - The iterable of source objects.
        converter - The converter to be used on the iterable.
        Throws:
        java.lang.NullPointerException - of if the given iterable and/or converter is null.
    • Method Detail

      • getIterable

        protected java.lang.Iterable<I> getIterable()
        Returns:
        The iterable this class decorates.
      • getConverter

        public Converter<I,​O> getConverter()
        Returns:
        The converter for converting the elements.
      • iterator

        public java.util.Iterator<O> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<I>