|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jcontrol.util.Queue
public class Queue
A queue is a FIFO (First-In-First-Out) buffer. When elements are pushed into the queue they are appended at the end. Popping elements always returns the element at the first index, i.e. the oldest element.
Constructor Summary | |
---|---|
Queue(int initialSize)
Creates a Queue instance. |
Method Summary | |
---|---|
int |
getSize()
Returns the size of the queue. |
Object |
pop()
Removes the oldest element from the queue and returns it. |
void |
push(Object o)
Pushes any object into the queue. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, notifyAll, toString, wait |
Constructor Detail |
---|
public Queue(int initialSize)
initialSize
- the initial size of the internal data array. If the length of the
queue exceeds this initial size, the data array will be enlarged.Method Detail |
---|
public void push(Object o)
o
- an object to push into the queue.public Object pop()
null
if the queue is empty.public int getSize()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |