|
||||||||||
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<T>
public class NiceIterator<T>
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 | ||
---|---|---|
static
|
andThen(java.util.Iterator<T> a,
java.util.Iterator<? extends T> b)
concatenate two closable iterators. |
|
|
andThen(java.util.Iterator<X> other)
make a new iterator, which is us then the other chap. |
|
static
|
asList(ExtendedIterator<T> it)
Answer a list of the elements from it , in order, consuming
that iterator. |
|
static
|
asSet(ExtendedIterator<T> 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
|
emptyIterator()
An iterator over no elements. |
|
ExtendedIterator<T> |
filterDrop(Filter<T> f)
make a new iterator, which is our elements that do not pass the filter |
|
ExtendedIterator<T> |
filterKeep(Filter<T> f)
make a new iterator, which is our elements that pass the filter |
|
boolean |
hasNext()
default hasNext: no elements, return false. |
|
|
mapWith(Map1<T,U> map1)
make a new iterator which is the elementwise _map1_ of the base iterator. |
|
T |
next()
default next: throw an exception. |
|
void |
remove()
default remove: we have no elements, so we can't remove any. |
|
T |
removeNext()
Answer the next object, and remove it. |
|
java.util.List<T> |
toList()
Answer a list of the elements in order, consuming this iterator. |
|
java.util.Set<T> |
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 ClosableIterator<T>
public boolean hasNext()
hasNext
in interface java.util.Iterator<T>
public T next()
next
in interface java.util.Iterator<T>
public void remove()
remove
in interface java.util.Iterator<T>
public T removeNext()
removeNext
in interface ExtendedIterator<T>
public static <T> ExtendedIterator<T> andThen(java.util.Iterator<T> a, java.util.Iterator<? extends T> b)
public <X extends T> ExtendedIterator<T> andThen(java.util.Iterator<X> other)
andThen
in interface ExtendedIterator<T>
public ExtendedIterator<T> filterKeep(Filter<T> f)
filterKeep
in interface ExtendedIterator<T>
public ExtendedIterator<T> filterDrop(Filter<T> f)
filterDrop
in interface ExtendedIterator<T>
public <U> ExtendedIterator<U> mapWith(Map1<T,U> map1)
mapWith
in interface ExtendedIterator<T>
public 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 <T> ExtendedIterator<T> emptyIterator()
public java.util.List<T> toList()
toList
in interface ExtendedIterator<T>
public java.util.Set<T> toSet()
toSet
in interface ExtendedIterator<T>
public static <T> java.util.Set<T> asSet(ExtendedIterator<T> it)
it
in order, consuming this iterator.
Canonical implementation of toSet().
public static <T> java.util.List<T> asList(ExtendedIterator<T> 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 |