net.sf.jga.fn.algorithm
Class FindIteratorFunctor<T>

java.lang.Object
  extended by net.sf.jga.fn.UnaryFunctor<java.util.Iterator<? extends T>,FindIterator<T>>
      extended by net.sf.jga.fn.algorithm.FindIteratorFunctor<T>
All Implemented Interfaces:
java.io.Serializable, Visitable
Direct Known Subclasses:
Find, FindElement

public abstract class FindIteratorFunctor<T>
extends UnaryFunctor<java.util.Iterator<? extends T>,FindIterator<T>>

Abstract base class for functors that take an input iterator and return a FindIterator. This class provides the ability to prevent excessive iterator wrapping by tracking the identity of the functor that has produced the wrapped iterator, and not re-wrapping an iterator if it was produced by the same object that is currently requesting a wrapped iterator.

Copyright © 2004 David A. Hall

Author:
David A. Hall
See Also:
Serialized Form

Constructor Summary
FindIteratorFunctor()
           
 
Method Summary
protected  FindIterator<T> wrap(java.util.Iterator<? extends T> iterator)
          Conditionally wraps the input iterator in a FindIterator for return.
 
Methods inherited from class net.sf.jga.fn.UnaryFunctor
accept, bind, compose, compose, fn, generate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FindIteratorFunctor

public FindIteratorFunctor()
Method Detail

wrap

protected FindIterator<T> wrap(java.util.Iterator<? extends T> iterator)
Conditionally wraps the input iterator in a FindIterator for return. Uses a Wrapper to determine if the input iterator is one that this object has already built and returned: if so, then there is no need to wrap it again.



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