Class Mapped<OriginalType,​ResultType>

  • Type Parameters:
    OriginalType - The original type of the values iterated by the decorated Iterator.
    ResultType - The type of the values iterated by this Iterator.
    All Implemented Interfaces:
    java.util.Iterator<ResultType>

    public final class Mapped<OriginalType,​ResultType>
    extends BaseIterator<ResultType>
    An Iterator that maps the elements of another Iterator using a Function before iterating them.
    • Constructor Detail

      • Mapped

        public Mapped​(Function<? super OriginalType,​? extends ResultType> mapFunction,
                      java.util.Iterator<OriginalType> original)
        Creates a Mapped Iterator that iterates the elements of the given Iterator after mapping them using the given Function.
        Parameters:
        mapFunction - The Function to apply to all elements.
        original - The Iterator to be mapped.
    • Method Detail

      • hasNext

        public final boolean hasNext()