|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ontoware.rdf2go.util.ConvertingIterator<FROM,TO>
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>
An iterator that converts from "FROM" to "TO", by wrapping an existing iterator. This is needed when converting statements or resource-uris from one iterator to another, for the Adapter implementations. You still have to implement the "convert" method, but the handling of the Java generics is done.
| Constructor Summary | |
|---|---|
ConvertingIterator(java.util.Iterator<FROM> wrapped)
The iterator takes the wrapped class and converts it to other classes on the fly. |
|
ConvertingIterator(java.util.Iterator<FROM> wrapped,
Converter<FROM,TO> converter)
The iterator takes the wrapped class and converts it to other classes on the fly. |
|
| Method Summary | |
|---|---|
TO |
convert(FROM next)
convert the passed object to the outgoing object |
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 |
|---|
public ConvertingIterator(java.util.Iterator<FROM> wrapped)
wrapped - the wrapped iterator
public ConvertingIterator(java.util.Iterator<FROM> wrapped,
Converter<FROM,TO> converter)
wrapped - the wrapped iteratorconverter - the converter| Method Detail |
|---|
public boolean hasNext()
hasNext in interface java.util.Iterator<TO>Iterator.hasNext()public TO next()
next in interface java.util.Iterator<TO>Iterator.next()public TO convert(FROM next)
next - the next object to convert
public void remove()
remove in interface java.util.Iterator<TO>Iterator.remove()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||