org.jbind.util.collection
Class TransformingIterator

java.lang.Object
  extended byorg.jbind.util.collection.TransformingIterator
All Implemented Interfaces:
java.util.Iterator
Direct Known Subclasses:
TransformingListIterator

public class TransformingIterator
extends java.lang.Object
implements java.util.Iterator


Nested Class Summary
static interface TransformingIterator.ITransformation
          Interface which must be implemented in order to decide wheter objects should be included in the iteration or not.
 
Constructor Summary
TransformingIterator(java.util.Iterator anIterator, TransformingIterator.ITransformation aTransformation)
          Constructs a TransformingIterator, i.e.
 
Method Summary
 boolean hasNext()
           
 java.lang.Object next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransformingIterator

public TransformingIterator(java.util.Iterator anIterator,
                            TransformingIterator.ITransformation aTransformation)
Constructs a TransformingIterator, i.e.  an iterator which returns as many transformed objects as the source iterator contains objects.

Parameters:
anIterator - The iterator that should be transformed.
aTransformation - The transformation that should be applied to the objects.
Method Detail

next

public java.lang.Object next()
Specified by:
next in interface java.util.Iterator

hasNext

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

remove

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