FROM
- The class that is the source of conversionTO
- The class that is converted to
Note: as this class is not RDF-specific in any way it is a good candidate for
AIFBcommons.public class ConvertingIterator<FROM,TO> extends Object implements Iterator<TO>
Constructor and Description |
---|
ConvertingIterator(Iterator<FROM> wrapped)
The iterator takes the wrapped class and converts it to other classes on
the fly.
|
ConvertingIterator(Iterator<FROM> wrapped,
Converter<FROM,TO> converter)
The iterator takes the wrapped class and converts it to other classes on
the fly.
|
Modifier and Type | Method and Description |
---|---|
TO |
convert(FROM next)
convert the passed object to the outgoing object
|
boolean |
hasNext() |
TO |
next() |
void |
remove() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
public ConvertingIterator(Iterator<FROM> wrapped)
wrapped
- the wrapped iteratorpublic boolean hasNext()
hasNext
in interface Iterator<TO>
Iterator.hasNext()
public TO next()
next
in interface Iterator<TO>
Iterator.next()
public TO convert(FROM next)
next
- the next object to convertpublic void remove()
remove
in interface Iterator<TO>
Iterator.remove()
Copyright © 2005–2016 IT-Consulting Dr. Max V?lkel | Project started at FZI Forschungszentrum Informatik, www.fzi.de. All rights reserved.