|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||
com.sas.collection.Queue
public class Queue
A Queue is an object which refers to a linked list of objects that are placed at the end of the list when added, and removed from the beginning of the list when removed. Basically, a first in first out (FIFO) queue. The Queue class is synchronized and thus is thread safe.
Pair,
Serialized Form| Field Summary | |
|---|---|
protected com.sas.collection.Pair |
_head
|
protected long |
_size
|
protected com.sas.collection.Pair |
_tail
|
| Constructor Summary | |
|---|---|
Queue()
Queue Constructor creates and instantiates the head and tail of the Queue class. |
|
| Method Summary | |
|---|---|
void |
add(java.lang.Object info)
Add places an object at the end of the queue. |
void |
clear()
Clear removes all items from the queue and sets the size to zero. |
java.lang.Object |
dequeue()
Removes and returns an object from the top of the queue. |
long |
getSize()
Returns the current size of the queue. |
protected void |
init()
init is used by the constructor and by the clear method to clear/initialize the head, tail, and size. |
boolean |
isEmpty()
Tests if the head of the queue is pointing to the tail of the queue, if true, the queue is empty. |
| Field Detail |
|---|
protected com.sas.collection.Pair _head
protected com.sas.collection.Pair _tail
protected long _size
| Constructor Detail |
|---|
public Queue()
| Method Detail |
|---|
protected void init()
public void clear()
public void add(java.lang.Object info)
info - any objectpublic java.lang.Object dequeue()
public boolean isEmpty()
public long getSize()
|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||