|
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Objectav.util.ArrayQueue<T>
public class ArrayQueue<T>
This is an array based Queue implementation.
This class is synchronized by a ReentrantReadWriteLock.
| Constructor Summary | |
|---|---|
ArrayQueue()
|
|
ArrayQueue(int initCapacity)
|
|
| Method Summary | ||
|---|---|---|
void |
clear()
clear all |
|
T |
dequeue()
remove the first element from the queue and return it. |
|
|
enqueue(V o)
add o to the end of the queue. |
|
void |
enqueueAll(Collection<? extends T> collection)
add all objects in collection to end of the queue. |
|
void |
ensureCapacity(int minCapacity)
|
|
boolean |
isEmpty()
test whether this queue is empty. |
|
T |
peek()
return the first element in the queue but don't remove it from the queue. |
|
|
precede(V o)
add o to the beginning of the queue. |
|
int |
size()
return size of the queue. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ArrayQueue(int initCapacity)
public ArrayQueue()
| Method Detail |
|---|
public <V extends T> void enqueue(V o)
Queue
enqueue in interface Queue<T>public void enqueueAll(Collection<? extends T> collection)
Queue
enqueueAll in interface Queue<T>public <V extends T> void precede(V o)
Queue
precede in interface Queue<T>public void ensureCapacity(int minCapacity)
public T peek()
Queue
peek in interface Queue<T>public T dequeue()
Queue
dequeue in interface Queue<T>public boolean isEmpty()
Queue
isEmpty in interface Queue<T>public int size()
Queue
size in interface Queue<T>public void clear()
Queue
clear in interface Queue<T>
|
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||