public class Queue
extends java.lang.Object
| Constructor and Description |
|---|
Queue()
Create a new fine queue.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addElement(java.lang.Object o,
int index)
Adds element to vector at specified position.
|
java.lang.Object |
checkFirst()
Returns the first element of this queue WITHOUT removing it!
|
protected java.lang.Object |
checkFirstElement()
Returns the first element of this queue.
|
void |
clear()
Removes all entries from this queue.
|
void |
enqueue(java.lang.Object o)
Enqueues element into this queue.
|
void |
enqueueAtBeginning(java.lang.Object o)
Adds elements to this queue, but the element will be set on the beginning of the queue.
|
java.lang.Object |
get()
Returns the first element of this queue.
|
protected java.lang.Object |
getFirstElement()
Returns the first element of this queue.
|
boolean |
isEmpty()
Tests that this queue has no components.
|
Iterator |
iterator()
Returns an iterator for this queue.
|
int |
size()
Returns the number of components in this queue.
|
public boolean isEmpty()
true if and only if this queue has no components, that is, its size is zero;
false otherwise.public void enqueue(java.lang.Object o)
o - element to enqueue.public void enqueueAtBeginning(java.lang.Object o)
o - element to enqueue.public java.lang.Object get()
public java.lang.Object checkFirst()
public void clear()
public Iterator iterator()
This iterator allows to access every item inside this queue and supports the remove method.
public int size()
protected java.lang.Object getFirstElement()
protected java.lang.Object checkFirstElement()
protected void addElement(java.lang.Object o,
int index)
o - object to add.index - where to insert the object. If -1, the object will be added at the end.