net.sf.jga.algorithms
Class Transform.AdjacentIterator<T,R>

java.lang.Object
  extended by net.sf.jga.algorithms.Transform.AdjacentIterator<T,R>
All Implemented Interfaces:
java.util.Iterator<R>
Enclosing class:
Transform

public static class Transform.AdjacentIterator<T,R>
extends java.lang.Object
implements java.util.Iterator<R>

Iterator that applies a given BinaryFunctor to successive pairs of elements from a given iterator, returning the results as elements.


Constructor Summary
Transform.AdjacentIterator(java.util.Iterator<? extends T> iter, BinaryFunctor<T,T,R> fn)
          Builds a TransormAdjacentIterator that applies the given functor to adjacent elements of the given base iterator.
 
Method Summary
 boolean hasNext()
           
 R next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Transform.AdjacentIterator

public Transform.AdjacentIterator(java.util.Iterator<? extends T> iter,
                                  BinaryFunctor<T,T,R> fn)
Builds a TransormAdjacentIterator that applies the given functor to adjacent elements of the given base iterator.

Method Detail

hasNext

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

next

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

remove

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


Copyright © 2002-2006 David A. Hall. All Rights Reserved.