com.davidsoergel.conja
Class MappingThreadSafeNextOnlyIterator<T,J>

java.lang.Object
  extended by com.davidsoergel.conja.MappingThreadSafeNextOnlyIterator<T,J>
All Implemented Interfaces:
ThreadSafeNextOnlyIterator<J>

public abstract class MappingThreadSafeNextOnlyIterator<T,J>
extends java.lang.Object
implements ThreadSafeNextOnlyIterator<J>

An Iterator that maps elements from an underlying iterator through some function on the fly. Easily extended as an anonymous class.

Version:
$Id$
Author:
David Soergel

Constructor Summary
MappingThreadSafeNextOnlyIterator(java.util.Iterator<T> i)
           
MappingThreadSafeNextOnlyIterator(ThreadSafeNextOnlyIterator<T> i)
           
 
Method Summary
abstract  J function(T t)
           
 J next()
          Returns the next object from the iterator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MappingThreadSafeNextOnlyIterator

public MappingThreadSafeNextOnlyIterator(ThreadSafeNextOnlyIterator<T> i)

MappingThreadSafeNextOnlyIterator

public MappingThreadSafeNextOnlyIterator(java.util.Iterator<T> i)
Method Detail

next

public J next()
       throws java.util.NoSuchElementException
Description copied from interface: ThreadSafeNextOnlyIterator
Returns the next object from the iterator. Must be thread-safe, i.e. multiple threads should be able to poll simultaneously

Specified by:
next in interface ThreadSafeNextOnlyIterator<J>
Throws:
java.util.NoSuchElementException

function

public abstract J function(T t)


Copyright © 2006-2010 David Soergel. All Rights Reserved.