|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
This is a generic Queue data structure that can be used to store references to any type of data. Items are added at one end of the Queue and taken off at the other end, which is why a Queue is called a First In First Out (FIFO) structure. WARNING: A Queue can fill up to maximum capacity, or it may become empty. Check the return value when calling the enqueue and dequeue functions to see if it is Q_FULL or null.
| Field Summary | |
static int |
Q_FULL
|
static int |
Q_OK
|
| Fields inherited from interface org.primordion.xholon.base.IXholon |
DEFAULT_SIZE_MSG_Q, NINCLUDE_PSC, NINCLUDE_PSx, NINCLUDE_PxC, NINCLUDE_Pxx, NINCLUDE_xSC, NINCLUDE_xSx, NINCLUDE_xxC, NINCLUDE_xxx |
| Method Summary | |
java.lang.Object |
dequeue()
Take an object off the queue. |
int |
enqueue(java.lang.Object p_item)
Add an object to the queue. |
java.util.Vector |
getItems()
Get the internal item array. |
int |
getMaxSize()
Get maximum number of items that can be in the queue. |
int |
getSize()
Get number of items currently in the queue. |
void |
setMaxSize(int maxSize)
Set the maximum number of items that can be in the queue, and allocate space for that many items. |
void |
shuffle()
Randomize the order of the items in the queue. |
void |
sort()
Sort the items in the queue. |
| Field Detail |
public static final int Q_FULL
public static final int Q_OK
| Method Detail |
public int enqueue(java.lang.Object p_item)
p_item - The object.
public java.lang.Object dequeue()
public int getSize()
public int getMaxSize()
public void setMaxSize(int maxSize)
maxSize - Maximum queue size.public void shuffle()
public void sort()
public java.util.Vector getItems()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||