This project has retired. For details please refer to its Attic page.
DoFnIterator (Apache Crunch 0.10.0 API)

org.apache.crunch.util
Class DoFnIterator<S,T>

java.lang.Object
  extended by org.apache.crunch.util.DoFnIterator<S,T>
Type Parameters:
S - The type of the delegate iterator
T - The returned type
All Implemented Interfaces:
Iterator<T>

public class DoFnIterator<S,T>
extends Object
implements Iterator<T>

An Iterator<T> that combines a delegate Iterator<S> and a DoFn<S, T>, generating data by passing the contents of the iterator through the function. Note that the input DoFn should have both its setContext and initialize functions called before it is passed to the constructor.


Constructor Summary
DoFnIterator(Iterator<S> iter, DoFn<S,T> fn)
           
 
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

DoFnIterator

public DoFnIterator(Iterator<S> iter,
                    DoFn<S,T> fn)
Method Detail

hasNext

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

next

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

remove

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


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.