org.omnaest.utils.structure.iterator.decorator
Class IteratorToIteratorAdapter<FROM,TO>

java.lang.Object
  extended by org.omnaest.utils.structure.iterator.decorator.IteratorToIteratorAdapter<FROM,TO>
All Implemented Interfaces:
Iterator<TO>

public class IteratorToIteratorAdapter<FROM,TO>
extends Object
implements Iterator<TO>

Decorator of an Iterator which uses an ElementConverter to convert the output of the next() method of the underlying Iterator to another type .

Author:
Omnaest

Constructor Summary
IteratorToIteratorAdapter(Iterator<FROM> iterator, ElementConverter<FROM,TO> elementConverter)
           
 
Method Summary
 boolean hasNext()
           
 TO next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IteratorToIteratorAdapter

public IteratorToIteratorAdapter(Iterator<FROM> iterator,
                                 ElementConverter<FROM,TO> elementConverter)
Parameters:
iterator -
elementConverter -
See Also:
IteratorToIteratorAdapter
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<TO>

remove

public void remove()
Specified by:
remove in interface Iterator<TO>

next

public TO next()
Specified by:
next in interface Iterator<TO>


Copyright © 2013. All Rights Reserved.