| java.lang.Object com.hp.hpl.jena.util.iterator.NiceIterator
All known Subclasses: com.hp.hpl.jena.util.iterator.MapFilterIterator, com.hp.hpl.jena.util.iterator.SingletonIterator, com.hp.hpl.jena.util.iterator.WrappedIterator, com.hp.hpl.jena.util.iterator.NullIterator, com.hp.hpl.jena.mem.ObjectIterator, com.hp.hpl.jena.graph.impl.FragmentTripleIterator,
NiceIterator | public class NiceIterator implements ExtendedIterator(Code) | | NiceIterator is the standard base class implementing ExtendedIterator. It provides
the static methods for andThen , filterKeep and
filterDrop ; these can be reused from any other class. It defines
equivalent instance methods for descendants and to satisfy ExtendedIterator.
author: kers |
Method Summary | |
public static ExtendedIterator | andThen(Iterator a, Iterator b) concatenate two closable iterators. | public ExtendedIterator | andThen(ClosableIterator other) make a new iterator, which is us then the other chap. | public static List | asList(ExtendedIterator it) Answer a list of the elements from it , in order, consuming
that iterator. | public static Set | asSet(ExtendedIterator it) Answer a list of the elements of it in order, consuming this iterator. | public void | close() default close: don't need to do anything. | public static void | close(Iterator it) If it is a Closableiterator, close it. | public static ExtendedIterator | emptyIterator() An iterator over no elements. | protected void | ensureHasNext() | public ExtendedIterator | filterDrop(Filter f) | public ExtendedIterator | filterKeep(Filter f) | public boolean | hasNext() default hasNext: no elements, return false. | public ExtendedIterator | mapWith(Map1 map1) make a new iterator which is the elementwise _map1_ of the base iterator. | public Object | next() default next: throw an exception. | protected Object | noElements(String message) Utility method for this and other (sub)classes: raise the appropriate
"no more elements" exception. | public void | remove() default remove: we have no elements, so we can't remove any. | public Object | removeNext() Answer the next object, and remove it. | public List | toList() Answer a list of the elements in order, consuming this iterator. | public Set | toSet() Answer a list of the elements in order, consuming this iterator. |
NiceIterator | public NiceIterator()(Code) | | |
asList | public static List asList(ExtendedIterator it)(Code) | | Answer a list of the elements from it , in order, consuming
that iterator. Canonical implementation of toList().
|
asSet | public static Set asSet(ExtendedIterator it)(Code) | | Answer a list of the elements of it in order, consuming this iterator.
Canonical implementation of toSet().
|
close | public void close()(Code) | | default close: don't need to do anything.
|
close | public static void close(Iterator it)(Code) | | If it is a Closableiterator, close it. Abstracts away from
tests [that were] scattered through the code.
|
emptyIterator | public static ExtendedIterator emptyIterator()(Code) | | An iterator over no elements.
A class singleton which doesn't iterate. |
ensureHasNext | protected void ensureHasNext()(Code) | | |
hasNext | public boolean hasNext()(Code) | | default hasNext: no elements, return false.
|
next | public Object next()(Code) | | default next: throw an exception.
|
noElements | protected Object noElements(String message)(Code) | | Utility method for this and other (sub)classes: raise the appropriate
"no more elements" exception. I note that we raised the wrong exception
in at least one case ...
Parameters: message - the string to include in the exception never - but we have a return type to please the compiler |
remove | public void remove()(Code) | | default remove: we have no elements, so we can't remove any.
|
removeNext | public Object removeNext()(Code) | | Answer the next object, and remove it.
|
toList | public List toList()(Code) | | Answer a list of the elements in order, consuming this iterator.
|
toSet | public Set toSet()(Code) | | Answer a list of the elements in order, consuming this iterator.
|
|
|