public static class IntPriorityQueues.SynchronizedPriorityQueue extends Object implements IntPriorityQueue
| Modifier and Type | Method and Description |
|---|---|
void |
changed()
Notifies the queue that the first element has changed (optional operation).
|
void |
clear()
Removes all elements from this queue.
|
IntComparator |
comparator()
Returns the comparator associated with this sorted set, or null if it uses its elements' natural ordering.
|
Integer |
dequeue()
Dequeues the first element from the queue.
|
int |
dequeueInt()
Dequeues the first element from the queue.
|
void |
enqueue(int x)
Enqueues a new element.
|
void |
enqueue(Integer x)
Enqueues a new element.
|
Integer |
first()
Returns the first element of the queue.
|
int |
firstInt()
Returns the first element of the queue.
|
boolean |
isEmpty()
Checks whether the queue is empty.
|
Integer |
last()
Returns the last element of the queue, that is, the element the would be dequeued last (optional operation).
|
int |
lastInt()
Returns the last element of the queue, that is, the element the would be dequeued last (optional operation).
|
int |
size()
Returns the number of elements in this queue.
|
public void enqueue(int x)
IntPriorityQueueenqueue in interface IntPriorityQueuex - the element to enqueue.public int dequeueInt()
IntPriorityQueuedequeueInt in interface IntPriorityQueuepublic int firstInt()
IntPriorityQueuefirstInt in interface IntPriorityQueuepublic int lastInt()
IntPriorityQueuelastInt in interface IntPriorityQueuepublic boolean isEmpty()
PriorityQueueisEmpty in interface PriorityQueue<Integer>public int size()
PriorityQueuesize in interface PriorityQueue<Integer>public void clear()
PriorityQueueclear in interface PriorityQueue<Integer>public void changed()
PriorityQueuechanged in interface PriorityQueue<Integer>public IntComparator comparator()
IntPriorityQueueNote that this specification strengthens the one given in PriorityQueue.comparator().
comparator in interface IntPriorityQueuecomparator in interface PriorityQueue<Integer>null if it uses its elements' natural ordering.PriorityQueue.comparator()public void enqueue(Integer x)
PriorityQueueenqueue in interface PriorityQueue<Integer>x - the element to enqueue..public Integer dequeue()
PriorityQueuedequeue in interface PriorityQueue<Integer>public Integer first()
PriorityQueuefirst in interface PriorityQueue<Integer>public Integer last()
PriorityQueuelast in interface PriorityQueue<Integer>