|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.exolab.jms.common.util.OrderedQueue
The OrderedQueue is responsible for managing the expiration of the leases. The LeaseComparator is used to determine where they are inserted and the lease with the shortest duration is removed from the queue first. It is implemented suing a Vector but this could be changed to improve performance.
Constructor Summary | |
OrderedQueue(java.util.Comparator comparator)
Construct an instance of this class with the comparator 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 |
java.lang.Object |
firstElement()
Return the first element on the queue |
boolean |
remove(java.lang.Object object)
Remove the object from the queue |
java.lang.Object |
removeFirstElement()
Remove the first element from the queue or null if there are no elements on the queue. |
int |
size()
Return the number elements in the queue |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public OrderedQueue(java.util.Comparator comparator)
comparator
- used for orderingMethod Detail |
public void add(java.lang.Object object)
object
- object to addpublic boolean remove(java.lang.Object object)
object
- object to removetrue
if the object was removedpublic void clear()
public int size()
public java.lang.Object firstElement()
public java.lang.Object removeFirstElement()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |