|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A PriorityQueue is a queue in which all elements have an object signifying its priority; it is up to implementations to specify a valid range of objects and a means of ordering them.
Elements are returned based on their priority, highest priority is returned first. Elements of same priority are returned in the same order they were added.
Method Summary | |
boolean |
add(java.lang.Object obj,
java.lang.Object priority)
|
void |
clear()
|
void |
clear(java.lang.Object minPriority)
removes all elements from the queue that have a lower priority than the specified threshold. |
boolean |
isEmpty()
|
boolean |
isEmpty(java.lang.Object minPriority)
|
boolean |
isThreadSafe()
|
java.lang.Object |
peek()
This method is implemented only for non-threadsafe queues so that it does not have InterruptedException in its signature. |
java.lang.Object |
peek(boolean blocking)
|
java.lang.Object |
peek(int timeoutMillis)
|
java.lang.Object |
peek(java.lang.Object minPriority)
same as remove(), but ignores elements of a lower priority than a minimum threshold. |
java.lang.Object |
peek(java.lang.Object minPriority,
boolean blocking)
|
java.lang.Object |
peek(java.lang.Object minPriority,
int timeoutMillis)
|
java.lang.Object |
remove()
This method is implemented only for non-threadsafe queues so that it does not have InterruptedException in its signature. |
java.lang.Object |
remove(boolean blocking)
|
java.lang.Object |
remove(int timeoutMillis)
|
java.lang.Object |
remove(java.lang.Object minPriority)
same as remove(), but ignores elements of a lower priority than a minimum threshold. |
java.lang.Object |
remove(java.lang.Object minPriority,
boolean blocking)
|
java.lang.Object |
remove(java.lang.Object minPriority,
int timeoutMillis)
|
void |
setAcceptanceThreshold(java.lang.Object o)
Tells the queue to discard elements that have a lower priority than o. |
int |
size()
|
int |
size(java.lang.Object minPriority)
|
Method Detail |
public boolean add(java.lang.Object obj, java.lang.Object priority)
public java.lang.Object remove()
public java.lang.Object remove(boolean blocking) throws java.lang.InterruptedException
java.lang.InterruptedException
public java.lang.Object remove(int timeoutMillis) throws java.lang.InterruptedException, TimeoutException
java.lang.InterruptedException
TimeoutException
public java.lang.Object remove(java.lang.Object minPriority)
public java.lang.Object remove(java.lang.Object minPriority, boolean blocking) throws java.lang.InterruptedException
java.lang.InterruptedException
public java.lang.Object remove(java.lang.Object minPriority, int timeoutMillis) throws java.lang.InterruptedException, TimeoutException
java.lang.InterruptedException
TimeoutException
public java.lang.Object peek()
public java.lang.Object peek(boolean blocking) throws java.lang.InterruptedException
java.lang.InterruptedException
public java.lang.Object peek(int timeoutMillis) throws java.lang.InterruptedException, TimeoutException
java.lang.InterruptedException
TimeoutException
public java.lang.Object peek(java.lang.Object minPriority)
public java.lang.Object peek(java.lang.Object minPriority, boolean blocking) throws java.lang.InterruptedException
java.lang.InterruptedException
public java.lang.Object peek(java.lang.Object minPriority, int timeoutMillis) throws java.lang.InterruptedException, TimeoutException
java.lang.InterruptedException
TimeoutException
public int size()
public int size(java.lang.Object minPriority)
public boolean isEmpty()
public boolean isEmpty(java.lang.Object minPriority)
public void clear()
public void clear(java.lang.Object minPriority)
public void setAcceptanceThreshold(java.lang.Object o)
public boolean isThreadSafe()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |