E - The type of element managed by this collection.public class Queue<E> extends ClosedCollection<E>
list| Constructor and Description |
|---|
Queue()
This constructor creates a new queue of unlimited capacity.
|
Queue(int capacity)
This constructor creates a new queue with the specified capacity.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addElement(E element)
This method adds a new element to the tail of the queue.
|
Queue<E> |
copy() |
E |
getHead()
This method returns a reference to the element at the head of the queue
without removing the element from the queue.
|
E |
removeElement()
This method removes the next element from the head of the queue.
|
E[] |
toArray() |
createIterator, getElement, getElements, getIndex, getSize, removeAllcontainsAll, containsAny, containsElement, normalizedIndexcompareTo, equals, hashCodeaddSerializableClass, addSerializableClass, addSerializableClass, createMapper, fromString, fromString, toExposedString, toString, toString, toString, toStringpublic Queue()
public Queue(int capacity)
capacity - The maximum number of elements that can be in the queue
at one time.public E[] toArray()
public final void addElement(E element) throws java.lang.InterruptedException
element - The new element to be added.java.lang.InterruptedException - The thread that was waiting to add an element
was interrupted.public final E removeElement() throws java.lang.InterruptedException
java.lang.InterruptedException - The thread that was waiting to remove an element
was interrupted.public final E getHead()
Copyright © 2016 Crater Dog Technologies(TM). All rights reserved.