|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.dasein.util.Jiterator<T>
T - the type of object being managed in the jiteratorpublic class Jiterator<T>
A "Just-in-time" iterator for streaming a flow of objects across an iterable interface. This class is useful in situations where you don't want to keep your list of objects around in memory, but instead are using the collection to move them from one location (often slow-loading) to another.
To use the jiterator, just construct it and starting pushing items into it. Once the last item has
been added, call complete().
Last Modified $Date: 2009/07/02 01:37:02 $
| Constructor Summary | |
|---|---|
Jiterator()
Constructs an empty jiterator into which you can start adding items. |
|
Jiterator(Collection<T> list)
Constructs a jiterator from the specified collection. |
|
Jiterator(JiteratorFilter<T> filter)
|
|
| Method Summary | |
|---|---|
void |
complete()
Marks the jiterator as complete. |
boolean |
hasNext()
Checks to see if there are more elements to be processed in the jiterator. |
boolean |
isComplete()
|
boolean |
isLoaded()
|
Iterator<T> |
iterator()
|
T |
next()
Provides the next element in the jiterator. |
void |
push(T item)
Pushes a new item into the jiterator. |
void |
remove()
This operation is not allowed |
void |
setLoadException(Exception e)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Jiterator()
public Jiterator(JiteratorFilter<T> filter)
public Jiterator(Collection<T> list)
list - the source list of items to initialize the jiterator with| Method Detail |
|---|
public void complete()
public boolean hasNext()
hasNext in interface Iterator<T>JiteratorLoadException - an error occurred during the load of the jiteratorpublic boolean isComplete()
public boolean isLoaded()
public Iterator<T> iterator()
iterator in interface Iterable<T>
public T next()
throws JiteratorLoadException
next in interface Iterator<T>NoSuchElementException - an attempt was made to read beyond the last item in the jiterator
JiteratorLoadExceptionpublic void push(T item)
item - the item to be added
IllegalStateException - an attempt was made to push an item on a jiterator marked completepublic void remove()
remove in interface Iterator<T>UnsupportedOperationException - always thrownpublic void setLoadException(Exception e)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||