org.jjoost.collections.iters
Class MappedIterator<X,Y>

java.lang.Object
  extended by org.jjoost.collections.iters.MappedIterator<X,Y>
Type Parameters:
X -
Y -
All Implemented Interfaces:
java.util.Iterator<Y>
Direct Known Subclasses:
MappedClosableIterator

public class MappedIterator<X,Y>
extends java.lang.Object
implements java.util.Iterator<Y>

Given an Iterator object and a function, yields an Iterator representing the result of applying that function to every element of the supplied Iterator

Author:
b.elliottsmith

Constructor Summary
MappedIterator(java.util.Iterator<? extends X> base, Function<? super X,? extends Y> function)
           
 
Method Summary
 boolean hasNext()
           
 Y next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MappedIterator

public MappedIterator(java.util.Iterator<? extends X> base,
                      Function<? super X,? extends Y> function)
Method Detail

hasNext

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

next

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

remove

public void remove()
Specified by:
remove in interface java.util.Iterator<Y>