| com.hp.hpl.jena.util.iterator.ExtendedIterator
All known Subclasses: com.hp.hpl.jena.util.iterator.MapFilterIterator, com.hp.hpl.jena.util.iterator.SingletonIterator, com.hp.hpl.jena.graph.TripleMatchIterator, com.hp.hpl.jena.db.impl.ResultSetIterator, com.hp.hpl.jena.util.iterator.NiceIterator, com.hp.hpl.jena.util.iterator.LazyIterator,
ExtendedIterator | public interface ExtendedIterator extends ClosableIterator(Code) | | an ExtendedIterator is a ClosableIterator on which other operations are
defined for convenience in iterator composition: composition, filtering
in, filtering out, and element mapping.
NOTE that the result of each of these operations consumes the base
iterator(s); they do not make independant copies.
The canonical implementation of ExtendedIterator is NiceIterator, which
also defines static methods for these operations that will work on any
ClosableIterators.
author: kers |
Method Summary | |
public ExtendedIterator | andThen(ClosableIterator other) return a new iterator which delivers all the elements of this iterator and
then all the elements of the other iterator. | public ExtendedIterator | filterDrop(Filter f) return a new iterator containing only the elements of _this_ which
are rejected by the filter _f_. | public ExtendedIterator | filterKeep(Filter f) return a new iterator containing only the elements of _this_ which
pass the filter _f_. | public ExtendedIterator | mapWith(Map1 map1) return a new iterator where each element is the result of applying
_map1_ to the corresponding element of _this_. | public Object | removeNext() Answer the next object, and remove it. | public List | toList() Answer a list of the [remaining] elements of this iterator, in order,
consuming this iterator. | public Set | toSet() Answer a set of the [remaining] elements of this iterator, in order,
consuming this iterator. |
andThen | public ExtendedIterator andThen(ClosableIterator other)(Code) | | return a new iterator which delivers all the elements of this iterator and
then all the elements of the other iterator. Does not copy either iterator;
they are consumed as the result iterator is consumed.
|
filterDrop | public ExtendedIterator filterDrop(Filter f)(Code) | | return a new iterator containing only the elements of _this_ which
are rejected by the filter _f_. The order of the elements is preserved.
Does not copy _this_, which is consumed as the reult is consumed.
|
filterKeep | public ExtendedIterator filterKeep(Filter f)(Code) | | return a new iterator containing only the elements of _this_ which
pass the filter _f_. The order of the elements is preserved. Does not
copy _this_, which is consumed as the result is consumed.
|
mapWith | public ExtendedIterator mapWith(Map1 map1)(Code) | | return a new iterator where each element is the result of applying
_map1_ to the corresponding element of _this_. _this_ is not
copied; it is consumed as the result is consumed.
|
removeNext | public Object removeNext()(Code) | | Answer the next object, and remove it. Equivalent to next(); remove().
|
toList | public List toList()(Code) | | Answer a list of the [remaining] elements of this iterator, in order,
consuming this iterator.
|
toSet | public Set toSet()(Code) | | Answer a set of the [remaining] elements of this iterator, in order,
consuming this iterator.
|
|
|