com.sdm.quasar.client.core.common.util
Class AbstractConverterIterator

java.lang.Object
  extended bycom.sdm.quasar.client.core.common.util.AbstractConverterIterator
All Implemented Interfaces:
java.util.Iterator

public abstract class AbstractConverterIterator
extends java.lang.Object
implements java.util.Iterator

A simple Iterator, that may be used to convert values iterated by an original Iterator. This conversion must be 1:1; which means every iterated value of the original iterator has exactly one converted value.

Version:
1.$Revision$
Author:
Thomas Wolf

Constructor Summary
AbstractConverterIterator(java.util.Iterator iterator)
          Creates a new AbstractConverterIterator.
 
Method Summary
protected abstract  java.lang.Object convert(java.lang.Object iteratedValue)
          Converts the given value iterated by the original Iterator.
 java.util.Iterator getIterator()
          Returns the original Iterator.
 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

AbstractConverterIterator

public AbstractConverterIterator(java.util.Iterator iterator)
Creates a new AbstractConverterIterator.

Method Detail

getIterator

public final java.util.Iterator getIterator()
Returns the original Iterator.


remove

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

hasNext

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

next

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

convert

protected abstract java.lang.Object convert(java.lang.Object iteratedValue)
Converts the given value iterated by the original Iterator.

Parameters:
iteratedValue - the value iterated by the original Iterator
Returns:
the converted value, which will be returned by this Iterator