public static class PriorityDelayQueue.QueueElement<E> extends Object implements Delayed
| Constructor and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
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.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 int compareTo(Delayed o)
compareTo in interface Comparable<Delayed>o - the other wrapper element to compare with.Copyright © 2015 Apache Software Foundation. All Rights Reserved.