public static class IntPriorityQueues.SynchronizedPriorityQueue extends java.lang.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.
|
java.lang.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(java.lang.Integer x)
Enqueues a new element.
|
java.lang.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.
|
java.lang.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)
IntPriorityQueue
enqueue
in interface IntPriorityQueue
x
- the element to enqueue.public int dequeueInt()
IntPriorityQueue
dequeueInt
in interface IntPriorityQueue
public int firstInt()
IntPriorityQueue
firstInt
in interface IntPriorityQueue
public int lastInt()
IntPriorityQueue
lastInt
in interface IntPriorityQueue
public boolean isEmpty()
PriorityQueue
isEmpty
in interface PriorityQueue<java.lang.Integer>
public int size()
PriorityQueue
size
in interface PriorityQueue<java.lang.Integer>
public void clear()
PriorityQueue
clear
in interface PriorityQueue<java.lang.Integer>
public void changed()
PriorityQueue
changed
in interface PriorityQueue<java.lang.Integer>
public IntComparator comparator()
IntPriorityQueue
Note that this specification strengthens the one given in PriorityQueue.comparator()
.
comparator
in interface IntPriorityQueue
comparator
in interface PriorityQueue<java.lang.Integer>
null
if it uses its elements' natural ordering.PriorityQueue.comparator()
public void enqueue(java.lang.Integer x)
PriorityQueue
enqueue
in interface PriorityQueue<java.lang.Integer>
x
- the element to enqueue..public java.lang.Integer dequeue()
PriorityQueue
dequeue
in interface PriorityQueue<java.lang.Integer>
public java.lang.Integer first()
PriorityQueue
first
in interface PriorityQueue<java.lang.Integer>
public java.lang.Integer last()
PriorityQueue
last
in interface PriorityQueue<java.lang.Integer>