public static class PriorityDelayQueue.QueueElement<E> extends java.util.concurrent.FutureTask<E> implements java.util.concurrent.Delayed
| Constructor and Description |
|---|
PriorityDelayQueue.QueueElement(XCallable<E> element,
int priority,
long delay,
java.util.concurrent.TimeUnit unit)
Create an Element wrapper.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(java.util.concurrent.Delayed o)
Compare the age of this wrapper element with another.
|
long |
getDelay(java.util.concurrent.TimeUnit unit)
Return the delay of the element.
|
XCallable<E> |
getElement()
Return the element from the wrapper.
|
int |
getPriority()
Return the priority of the element.
|
void |
setDelay(long delay,
java.util.concurrent.TimeUnit unit)
Set the delay of the element.
|
java.lang.String |
toString()
Return the string representation of the wrapper element.
|
public PriorityDelayQueue.QueueElement(XCallable<E> element, int priority, long delay, java.util.concurrent.TimeUnit unit)
element - element.priority - priority of the element.delay - delay of the element.unit - time unit of the delay.java.lang.IllegalArgumentException - if the element is NULL, the priority is negative or if the delay is
negative.public XCallable<E> getElement()
public int getPriority()
public void setDelay(long delay, java.util.concurrent.TimeUnit unit)
delay - delay of the element.unit - time unit of the delay.public long getDelay(java.util.concurrent.TimeUnit unit)
getDelay in interface java.util.concurrent.Delayedunit - time unit of the delay.public int compareTo(java.util.concurrent.Delayed o)
compareTo in interface java.lang.Comparable<java.util.concurrent.Delayed>o - the other wrapper element to compare with.public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2019 Apache Software Foundation. All Rights Reserved.