|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.hp.hpl.jena.util.iterator.LazyIterator
An ExtendedIterator that is created lazily.
This is useful when constructing an iterator is expensive and
you'd prefer to delay doing it until certain it's actually needed.
For example, if you have iterator1.andThen(iterator2)
you could implement iterator2 as a LazyIterator.
The sequence to be defined is defined by the subclass's definition
of create(). That is called exactly once on the first attempt
to interact with the LazyIterator.
| Constructor Summary | |
LazyIterator()
An ExtendedIterator that is created lazily. |
|
| Method Summary | |
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. |
void |
close()
Close the iterator |
abstract ExtendedIterator |
create()
The subclass must define this to return the ExtendedIterator to invoke. |
ExtendedIterator |
filterDrop(Filter f)
return a new iterator containing only the elements of _this_ which are rejected by the filter _f_. |
ExtendedIterator |
filterKeep(Filter f)
return a new iterator containing only the elements of _this_ which pass the filter _f_. |
boolean |
hasNext()
|
ExtendedIterator |
mapWith(Map1 map1)
return a new iterator where each element is the result of applying _map1_ to the corresponding element of _this_. |
java.lang.Object |
next()
|
void |
remove()
|
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public LazyIterator()
| Method Detail |
public 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 ExtendedIterator andThen(ClosableIterator other)
ExtendedIterator
andThen in interface ExtendedIteratorpublic ExtendedIterator filterKeep(Filter f)
ExtendedIterator
filterKeep in interface ExtendedIteratorpublic ExtendedIterator filterDrop(Filter f)
ExtendedIterator
filterDrop in interface ExtendedIteratorpublic ExtendedIterator mapWith(Map1 map1)
ExtendedIterator
mapWith in interface ExtendedIteratorpublic void close()
ClosableIterator
close in interface ClosableIteratorpublic abstract ExtendedIterator create()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||