|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.hp.hpl.jena.util.iterator.NiceIterator
public class NiceIterator
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.
| Constructor Summary | |
|---|---|
NiceIterator()
|
|
| Method Summary | |
|---|---|
ExtendedIterator |
andThen(ClosableIterator other)
make a new iterator, which is us then the other chap. |
static ExtendedIterator |
andThen(java.util.Iterator a,
java.util.Iterator b)
concatenate two closable iterators. |
static java.util.List |
asList(ExtendedIterator it)
Answer a list of the elements from it, in order, consuming
that iterator. |
static java.util.Set |
asSet(ExtendedIterator it)
Answer a list of the elements of it in order, consuming this iterator. |
void |
close()
default close: don't need to do anything. |
static void |
close(java.util.Iterator it)
If it is a Closableiterator, close it. |
static ExtendedIterator |
emptyIterator()
An iterator over no elements. |
ExtendedIterator |
filterDrop(Filter f)
make a new iterator, which is our elements that do not pass the filter |
ExtendedIterator |
filterKeep(Filter f)
make a new iterator, which is our elements that pass the filter |
boolean |
hasNext()
default hasNext: no elements, return false. |
ExtendedIterator |
mapWith(Map1 map1)
make a new iterator which is the elementwise _map1_ of the base iterator. |
java.lang.Object |
next()
default next: throw an exception. |
void |
remove()
default remove: we have no elements, so we can't remove any. |
java.lang.Object |
removeNext()
Answer the next object, and remove it. |
java.util.List |
toList()
Answer a list of the elements in order, consuming this iterator. |
java.util.Set |
toSet()
Answer a list of the elements in order, consuming this iterator. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NiceIterator()
| Method Detail |
|---|
public void close()
close in interface ClosableIteratorpublic boolean hasNext()
hasNext in interface java.util.Iteratorpublic java.lang.Object next()
next in interface java.util.Iteratorpublic void remove()
remove in interface java.util.Iteratorpublic java.lang.Object removeNext()
removeNext in interface ExtendedIterator
public static ExtendedIterator andThen(java.util.Iterator a,
java.util.Iterator b)
public ExtendedIterator andThen(ClosableIterator other)
andThen in interface ExtendedIteratorpublic ExtendedIterator filterKeep(Filter f)
filterKeep in interface ExtendedIteratorpublic ExtendedIterator filterDrop(Filter f)
filterDrop in interface ExtendedIteratorpublic ExtendedIterator mapWith(Map1 map1)
mapWith in interface ExtendedIteratorpublic static void close(java.util.Iterator it)
it is a Closableiterator, close it. Abstracts away from
tests [that were] scattered through the code.
public static ExtendedIterator emptyIterator()
public java.util.List toList()
toList in interface ExtendedIteratorpublic java.util.Set toSet()
toSet in interface ExtendedIteratorpublic static java.util.Set asSet(ExtendedIterator it)
it in order, consuming this iterator.
Canonical implementation of toSet().
public static java.util.List asList(ExtendedIterator it)
it, in order, consuming
that iterator. Canonical implementation of toList().
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||