|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.oozie.util.PriorityDelayQueue.QueueElement<E>
public static class PriorityDelayQueue.QueueElement<E>
Element wrapper required by the queue.
This wrapper keeps track of the priority and the age of a queue element.
Constructor Summary | |
---|---|
PriorityDelayQueue.QueueElement(E element)
Create an Element wrapper with no delay and minimum priority. |
|
PriorityDelayQueue.QueueElement(E element,
int priority,
long delay,
TimeUnit unit)
Create an Element wrapper. |
Method Summary | |
---|---|
int |
compareTo(Delayed o)
Compare the age of this wrapper element with another. |
long |
getDelay(TimeUnit unit)
Return the delay of the element. |
E |
getElement()
Return the element from the wrapper. |
int |
getPriority()
Return the priority of the element. |
void |
setDelay(long delay,
TimeUnit unit)
Set the delay of the element. |
String |
toString()
Return the string representation of the wrapper element. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PriorityDelayQueue.QueueElement(E element, int priority, long delay, TimeUnit unit)
element
- element.priority
- priority of the element.delay
- delay of the element.unit
- time unit of the delay.
IllegalArgumentException
- if the element is NULL, the priority is negative or if the delay is
negative.public PriorityDelayQueue.QueueElement(E element)
element
- element.Method Detail |
---|
public E getElement()
public int getPriority()
public void setDelay(long delay, TimeUnit unit)
delay
- delay of the element.unit
- time unit of the delay.public long getDelay(TimeUnit unit)
getDelay
in interface Delayed
unit
- time unit of the delay.
public int compareTo(Delayed o)
compareTo
in interface Comparable<Delayed>
o
- the other wrapper element to compare with.
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |