|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--fipaos.util.Queue
This is a simple class which defines methods which all queues
should implement
Field Summary | |
protected java.util.Vector |
_queue
Vector containing the message queue |
Constructor Summary | |
protected |
Queue(int max_size)
Stores information such as maximum size of the queue |
Method Summary | |
void |
addItem(java.lang.Object obj)
Adds an object to the queue |
void |
flush()
Method to flush the contents of the queue |
java.lang.Object |
getItem()
Get the next message from the queue. |
java.lang.Object |
getItemWithoutBlocking()
Get the next message from the queue. |
protected abstract java.lang.Object |
getNextItem()
Method to get the next element from the queue It is down to the queue implementation to determine which item in the queue to retreive |
boolean |
isEmpty()
Method to determine if the queue is empty |
boolean |
isFull()
Method to determine if the queue is full |
static void |
main(java.lang.String[] args)
Test harness for the various Queue implementations |
int |
queueLength()
Returns the number of items currently in the queue. |
void |
releaseBlock()
Method to release all blocked threads within the queue - once invoked, getItem() will never block again |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.Vector _queue
Constructor Detail |
protected Queue(int max_size)
max_size
- The most elements that can be contained within the
queue at once, or -1 for no limitMethod Detail |
public int queueLength()
public void addItem(java.lang.Object obj)
obj
- The object to add, given that the queue is not fullpublic java.lang.Object getItem()
public java.lang.Object getItemWithoutBlocking()
public boolean isFull()
public boolean isEmpty()
public void flush()
public void releaseBlock()
protected abstract java.lang.Object getNextItem()
public static void main(java.lang.String[] args) throws java.lang.Throwable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |