| java.lang.Object org.ontoware.rdf2go.util.ConvertingIterator
ConvertingIterator | public class ConvertingIterator implements Iterator<TO>(Code) | | 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.
author: sauermann < Parameters: FROM - >The class that is the source of conversion< Parameters: TO - >The class that is converted toNote: as this class is not RDF-specific in any way it is a good candidate forAIFBcommons. |
Constructor Summary | |
public | ConvertingIterator(Iterator<FROM> wrapped) The iterator takes the wrapped class and converts it to other classes on
the fly. | public | ConvertingIterator(Iterator<FROM> wrapped, Converter<FROM, TO> converter) The iterator takes the wrapped class and converts it to other classes on
the fly. |
ConvertingIterator | public ConvertingIterator(Iterator<FROM> wrapped)(Code) | | The iterator takes the wrapped class and converts it to other classes on
the fly. You have to override the "convert" method, though.
Parameters: wrapped - the wrapped iterator |
ConvertingIterator | public ConvertingIterator(Iterator<FROM> wrapped, Converter<FROM, TO> converter)(Code) | | The iterator takes the wrapped class and converts it to other classes on
the fly. Pass a converter that handles the conversion.
Parameters: wrapped - the wrapped iterator Parameters: converter - the converter |
convert | public TO convert(FROM next)(Code) | | convert the passed object to the outgoing object
Parameters: next - the next object to convert the converted object |
|
|