|
Orbital library | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object orbital.util.DelegateCollection orbital.util.DelegateList orbital.util.QueuedIterator
public class QueuedIterator
QueuedIterator is an iterator that queues elements added to it and provides an iterator view to them.
Much like queues, elements added are returned in FIFO order.
The List implementation part of this class provides an interface to the internal data queue maintained. Objects will be returned (via iterator view) from the head of it, and therefore objects appended to it are returned in FIFO order.
Constructor Summary | |
---|---|
QueuedIterator()
Create a new non-synchronized queued iterator. |
|
QueuedIterator(boolean synchronizedQueue)
Create a new queued iterator. |
Method Summary | |
---|---|
boolean |
addAll(java.util.Iterator i)
Add all objects of an iterator to this queued iterator. |
boolean |
hasNext()
Checks whether the queued iterator currently has a next element. |
java.lang.Object |
next()
Returns the elements added to this queued iterator in FIFO order. |
void |
remove()
Not supported. |
Methods inherited from class orbital.util.DelegateList |
---|
add, addAll, get, indexOf, lastIndexOf, listIterator, listIterator, remove, set, setDelegatee, setDelegatee, subList |
Methods inherited from class orbital.util.DelegateCollection |
---|
add, addAll, clear, contains, containsAll, equals, getDelegatee, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
Constructor Detail |
---|
public QueuedIterator(boolean synchronizedQueue)
synchronizedQueue
- whether to use Collections.synchronizedList(java.util.List)
on the buffering queue.public QueuedIterator()
Method Detail |
---|
public boolean hasNext()
Note: This state might change when someone added data.
hasNext
in interface java.util.Iterator
DelegateCollection.isEmpty()
public java.lang.Object next()
next
in interface java.util.Iterator
public void remove()
remove
in interface java.util.Iterator
java.lang.UnsupportedOperationException
- on every call.public boolean addAll(java.util.Iterator i)
Functionals.foldRight(BinaryFunction, Object, Iterator)
|
Orbital library 1.3.0: 11 Apr 2009 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |