Class ConverterIterator<I,O>
java.lang.Object
com.globalmentor.collections.iterators.ConverterIterator<I,O>
- Type Parameters:
I
- The input type.O
- The output type.
- All Implemented Interfaces:
Iterator<O>
- Direct Known Subclasses:
ConverterListIterator
An iterator that returns its objects converted using a
Converter
.- Author:
- Garret Wilson
- See Also:
-
Constructor Details
-
ConverterIterator
Iterator and converter constructor.- Parameters:
iterator
- The iterator of source objects.converter
- The conversor to be used on the iterable.- Throws:
NullPointerException
- of if the given iterator and/or converter isnull
.
-
-
Method Details
-
getIterator
- Returns:
- The iterator this class decorates.
-
getConverter
- Returns:
- The converter for converting the elements.
-
hasNext
public boolean hasNext() -
next
This implementation converts the next object before returning it.
-
remove
public void remove()
-