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

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

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

Adapter from an Iterator with one specific type to another Iterator with another type using a given ElementBidirectionalConverter

Author:
Omnaest

Constructor Summary
IteratorToIteratorAdapter(Iterator<FROM> iterator, ElementBidirectionalConverter<FROM,TO> elementBidirectionalConverter)
           
 
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,
                                 ElementBidirectionalConverter<FROM,TO> elementBidirectionalConverter)
Parameters:
iterator -
elementBidirectionalConverter -
See Also:
IteratorToIteratorAdapter
Method Detail

hasNext

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

next

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

remove

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


Copyright © 2013. All Rights Reserved.