Class MapIterator<X,​Y>

  • All Implemented Interfaces:
    java.util.Iterator<Y>

    public class MapIterator<X,​Y>
    extends java.lang.Object
    implements java.util.Iterator<Y>
    An MapIterator maps an Iterator contents to produce a new Iterator
    • Constructor Summary

      Constructors 
      Constructor Description
      MapIterator​(java.util.Iterator<? extends X> i, java.util.function.Function<X,​Y> f)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean hasNext()  
      static <X,​Y>
      java.util.Set<Y>
      map​(java.util.function.Function<X,​Y> f, java.util.Collection<X> i)  
      static <X,​Y>
      java.util.Iterator<Y>
      map​(java.util.function.Function<X,​Y> f, java.util.Iterator<X> i)  
      Y next()  
      void remove()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Iterator

        forEachRemaining
    • Constructor Detail

      • MapIterator

        public MapIterator​(java.util.Iterator<? extends X> i,
                           java.util.function.Function<X,​Y> f)
    • Method Detail

      • next

        public Y next()
        Specified by:
        next in interface java.util.Iterator<X>
      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface java.util.Iterator<X>
      • remove

        public void remove()
                    throws java.lang.UnsupportedOperationException
        Specified by:
        remove in interface java.util.Iterator<X>
        Throws:
        java.lang.UnsupportedOperationException
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • map

        public static <X,​Y> java.util.Iterator<Y> map​(java.util.function.Function<X,​Y> f,
                                                            java.util.Iterator<X> i)
      • map

        public static <X,​Y> java.util.Set<Y> map​(java.util.function.Function<X,​Y> f,
                                                       java.util.Collection<X> i)