net.sf.jga.algorithms
Class Filter.FilterIterator<T>

java.lang.Object
  extended by net.sf.jga.algorithms.Filter.FilterIterator<T>
All Implemented Interfaces:
java.util.Iterator<T>
Enclosing class:
Filter

public static class Filter.FilterIterator<T>
extends java.lang.Object
implements java.util.Iterator<T>

Iterator that only returns elements that meet the given selection criteria.


Constructor Summary
Filter.FilterIterator(java.util.Iterator<? extends T> iter, UnaryFunctor<T,java.lang.Boolean> pred)
          Builds a FilterIterator that will return only qualifying elements of the given iterator.
 
Method Summary
 boolean hasNext()
           
 T next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Filter.FilterIterator

public Filter.FilterIterator(java.util.Iterator<? extends T> iter,
                             UnaryFunctor<T,java.lang.Boolean> pred)
Builds a FilterIterator that will return only qualifying elements of the given iterator.

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 © 2002-2006 David A. Hall. All Rights Reserved.