|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.exolab.jms.messagemgr.MessageQueue
The message queue stored messages based on a comparator. The implementation is based on a synchronized linked list.
We can easily improve on this implementation and this implementation is not synchronized.
Constructor Summary | |
MessageQueue(java.util.Comparator comparator)
Instantiate an instance of this class with the specified comparator the comparator is used to order the elements in the queue. |
Method Summary | |
void |
add(java.lang.Object object)
Add this element to the queue in the required order. |
void |
clear()
Remove all the elements from the queue |
boolean |
contains(java.lang.Object object)
Check if the specified object exists |
java.lang.Object |
first()
Returns the first element in the queue. |
boolean |
isEmpty()
Check if the queue is empty |
java.util.Iterator |
iterator()
Return an iterator to the list |
java.lang.Object |
last()
Returns the last element in the queue. |
boolean |
remove(java.lang.Object object)
Remove the object from the queue |
java.lang.Object |
removeFirst()
Removes and returns the first element on the queue. |
java.lang.Object |
removeLast()
Removes and returns the last element in the queue |
int |
size()
Return the number elements in the queue |
java.lang.Object[] |
toArray()
Return all elements in the collection |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MessageQueue(java.util.Comparator comparator)
comparator
- used for orderingMethod Detail |
public void add(java.lang.Object object)
object
- object to addpublic boolean contains(java.lang.Object object)
object
- - object to checkpublic boolean isEmpty()
public java.lang.Object[] toArray()
public java.util.Iterator iterator()
public boolean remove(java.lang.Object object)
object
- object to removepublic void clear()
public int size()
public java.lang.Object first()
null
, if the
queue is emptypublic java.lang.Object last()
null
, if the
queue is emptypublic java.lang.Object removeFirst()
null
, if the
queue is emptypublic java.lang.Object removeLast()
null
, if the
queue is empty
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |