|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A subset of methods from the java.util.Queue
interface
introduced in Java 5.0.
Includes suffient methods from Queue
to enable the
implementation of simple FIFO queues for use within OGSA-DAI.
Excludes all methods in the java.util.Iterable
and
java.util.Collection
interfaces except
iterator()
and size()
.
As in Java 5.0, Queue
implementations do not allow
the insertion of null
elements.
Method Summary | |
java.lang.Object |
element()
Retrieves the head of the queue without removing it. |
java.util.Iterator |
iterator()
Returns an iterator over the elements in this queue. |
boolean |
offer(java.lang.Object item)
Inserts, if possible, an object into the queue. |
java.lang.Object |
peek()
Retrieves the head of the queue without removing it. |
java.lang.Object |
poll()
Retrieves and removes the head of the queue. |
java.lang.Object |
remove()
Retrieves and removes the head of the queue. |
void |
remove(java.lang.Object item)
Removes the specified item from the queue. |
int |
size()
Returns the number of elements in this queue. |
Method Detail |
public boolean offer(java.lang.Object item)
item
- The item to insert. Must not be null
.
true
if it was possible to add the element
to this queue, otherwise false
.public java.lang.Object poll()
null
if the
queue is empty.public java.lang.Object remove() throws java.util.NoSuchElementException
poll
, which performs a similar task, this method
throws an exception if called on an empty queue.
java.util.NoSuchElementException
- if this queue is empty.public void remove(java.lang.Object item) throws java.util.NoSuchElementException
item
- The item to remove.
java.util.NoSuchElementException
- if this queue is empty.public java.lang.Object peek()
null
if the
queue is empty.public java.lang.Object element() throws java.util.NoSuchElementException
peek
, which performs a similar task, this method
throws an exception if called on an empty queue.
java.util.NoSuchElementException
- if this queue is empty.public int size()
public java.util.Iterator iterator() throws java.util.ConcurrentModificationException
java.util.ConcurrentModificationException
- if the order
of the queue is changed while the iterator is in use.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |