E - The type of element managed by this collection.public class Queue<E> extends ClosedCollection<E> implements FIFO<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 |
addElementToTail(E element)
This method adds a new element to the tail of the queue.
|
E |
getHeadElement()
This method returns a reference to the element at the head of the queue
without removing the element from the queue.
|
E |
removeElementFromHead()
This method removes the next element from the head of the queue.
|
createDefaultIterator, getElementAtIndex, getElementsInRange, getIndexOfElement, getNumberOfElements, removeAllElementscompareTo, containsAllElementsIn, containsAnyElementsIn, containsElement, equals, hashCode, isEmpty, iterator, normalizedIndex, toArray, toArray, toString, toStringpublic Queue()
public Queue(int capacity)
capacity - The maximum number of elements that can be in the queue
at one time.public final void addElementToTail(E element) throws java.lang.InterruptedException
FIFOaddElementToTail in interface FIFO<E>element - The new element to be added.java.lang.InterruptedException - The thread that was waiting to add an element
was interrupted.public final E removeElementFromHead() throws java.lang.InterruptedException
FIFOremoveElementFromHead in interface FIFO<E>java.lang.InterruptedException - The thread that was waiting to remove an element
was interrupted.public final E getHeadElement()
FIFOgetHeadElement in interface FIFO<E>Copyright © 2014 Crater Dog Technologies(TM). All rights reserved.