org.openanzo.util
Class MappedIterator<F,T>

java.lang.Object
  extended by org.openanzo.util.MappedIterator<F,T>
Type Parameters:
F - Type of object within base Iterator
T - Type of object returned from this Iterator
All Implemented Interfaces:
java.util.Iterator<T>

public class MappedIterator<F,T>
extends java.lang.Object
implements java.util.Iterator<T>

Author:
Lee Feigenbaum ( feigenbl@us.ibm.com )

Constructor Summary
MappedIterator(java.util.Iterator<F> base, Function<F,T> f)
          Create a new MappedIterator that runs a function on each member of an iterator before it is retrieved in order to convert from one type to another
 
Method Summary
 boolean hasNext()
           
 T 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<F> base,
                      Function<F,T> f)
Create a new MappedIterator that runs a function on each member of an iterator before it is retrieved in order to convert from one type to another

Parameters:
base - Iterator to wrap
f - Function to run on iterator values before they are returned
Method Detail

hasNext

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

next

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

remove

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


Copyright © 2007 Cambridge Semantics Inc.. All Rights Reserved.