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 priority queue, or null if it uses its elements' natural ordering.
|
java.lang.Integer |
dequeue()
Deprecated.
|
int |
dequeueInt()
Dequeues the first element from the queue.
|
void |
enqueue(int x)
Enqueues a new element.
|
void |
enqueue(java.lang.Integer x)
Deprecated.
|
boolean |
equals(java.lang.Object o) |
java.lang.Integer |
first()
Deprecated.
|
int |
firstInt()
Returns the first element of the queue.
|
int |
hashCode() |
boolean |
isEmpty()
Checks whether this queue is empty.
|
java.lang.Integer |
last()
Deprecated.
|
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.PriorityQueue.enqueue(Object)
public int dequeueInt()
IntPriorityQueue
dequeueInt
in interface IntPriorityQueue
IntPriorityQueue.dequeue()
public int firstInt()
IntPriorityQueue
firstInt
in interface IntPriorityQueue
IntPriorityQueue.first()
public int lastInt()
IntPriorityQueue
This default implementation just throws an UnsupportedOperationException
.
lastInt
in interface IntPriorityQueue
IntPriorityQueue.last()
public boolean isEmpty()
PriorityQueue
This default implementation checks whether PriorityQueue.size()
is zero.
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
This default implementation just throws an UnsupportedOperationException
.
changed
in interface PriorityQueue<java.lang.Integer>
public IntComparator comparator()
IntPriorityQueue
comparator
in interface IntPriorityQueue
comparator
in interface PriorityQueue<java.lang.Integer>
PriorityQueue.comparator()
@Deprecated public void enqueue(java.lang.Integer x)
IntPriorityQueue
This default implementation delegates to the corresponding type-specific method.
enqueue
in interface IntPriorityQueue
enqueue
in interface PriorityQueue<java.lang.Integer>
x
- the element to enqueue.@Deprecated public java.lang.Integer dequeue()
IntPriorityQueue
This default implementation delegates to the corresponding type-specific method.
dequeue
in interface IntPriorityQueue
dequeue
in interface PriorityQueue<java.lang.Integer>
@Deprecated public java.lang.Integer first()
IntPriorityQueue
This default implementation delegates to the corresponding type-specific method.
first
in interface IntPriorityQueue
first
in interface PriorityQueue<java.lang.Integer>
@Deprecated public java.lang.Integer last()
IntPriorityQueue
This default implementation just throws an UnsupportedOperationException
.
This default implementation delegates to the corresponding type-specific method.
last
in interface IntPriorityQueue
last
in interface PriorityQueue<java.lang.Integer>
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object