org.databene.commons.iterator
Class ConvertingIterator<S,T>

java.lang.Object
  extended by org.databene.commons.iterator.ConvertingIterator<S,T>
All Implemented Interfaces:
java.io.Closeable, java.util.Iterator<T>, HeavyweightIterator<T>

public class ConvertingIterator<S,T>
extends java.lang.Object
implements HeavyweightIterator<T>

Iterator proxy that converts iterated objects before providing them to the caller.

Created: 16.08.2007 06:34:59

Author:
Volker Bergmann

Field Summary
protected  Converter<S,T> converter
           
protected  java.util.Iterator<S> source
           
 
Constructor Summary
ConvertingIterator(java.util.Iterator<S> source, Converter<S,T> converter)
           
 
Method Summary
 void close()
           
 boolean hasNext()
           
 T next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

source

protected java.util.Iterator<S> source

converter

protected Converter<S,T> converter
Constructor Detail

ConvertingIterator

public ConvertingIterator(java.util.Iterator<S> source,
                          Converter<S,T> converter)
Method Detail

close

public void close()
Specified by:
close in interface java.io.Closeable

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 © 2010. All Rights Reserved.