public static class LongPriorityQueues.SynchronizedPriorityQueue extends java.lang.Object implements LongPriorityQueue
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.
|
LongComparator |
comparator()
Returns the comparator associated with this priority queue, or null if it uses its elements' natural ordering.
|
java.lang.Long |
dequeue()
Deprecated.
|
long |
dequeueLong()
Dequeues the first element from the queue.
|
void |
enqueue(long x)
Enqueues a new element.
|
void |
enqueue(java.lang.Long x)
Deprecated.
|
boolean |
equals(java.lang.Object o) |
java.lang.Long |
first()
Deprecated.
|
long |
firstLong()
Returns the first element of the queue.
|
int |
hashCode() |
boolean |
isEmpty()
Checks whether this queue is empty.
|
java.lang.Long |
last()
Deprecated.
|
long |
lastLong()
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(long x)
LongPriorityQueue
enqueue
in interface LongPriorityQueue
x
- the element to enqueue.PriorityQueue.enqueue(Object)
public long dequeueLong()
LongPriorityQueue
dequeueLong
in interface LongPriorityQueue
LongPriorityQueue.dequeue()
public long firstLong()
LongPriorityQueue
firstLong
in interface LongPriorityQueue
LongPriorityQueue.first()
public long lastLong()
LongPriorityQueue
This default implementation just throws an UnsupportedOperationException
.
lastLong
in interface LongPriorityQueue
LongPriorityQueue.last()
public boolean isEmpty()
PriorityQueue
This default implementation checks whether PriorityQueue.size()
is zero.
isEmpty
in interface PriorityQueue<java.lang.Long>
public int size()
PriorityQueue
size
in interface PriorityQueue<java.lang.Long>
public void clear()
PriorityQueue
clear
in interface PriorityQueue<java.lang.Long>
public void changed()
PriorityQueue
This default implementation just throws an UnsupportedOperationException
.
changed
in interface PriorityQueue<java.lang.Long>
public LongComparator comparator()
LongPriorityQueue
comparator
in interface LongPriorityQueue
comparator
in interface PriorityQueue<java.lang.Long>
PriorityQueue.comparator()
@Deprecated public void enqueue(java.lang.Long x)
LongPriorityQueue
This default implementation delegates to the corresponding type-specific method.
enqueue
in interface LongPriorityQueue
enqueue
in interface PriorityQueue<java.lang.Long>
x
- the element to enqueue.@Deprecated public java.lang.Long dequeue()
LongPriorityQueue
This default implementation delegates to the corresponding type-specific method.
dequeue
in interface LongPriorityQueue
dequeue
in interface PriorityQueue<java.lang.Long>
@Deprecated public java.lang.Long first()
LongPriorityQueue
This default implementation delegates to the corresponding type-specific method.
first
in interface LongPriorityQueue
first
in interface PriorityQueue<java.lang.Long>
@Deprecated public java.lang.Long last()
LongPriorityQueue
This default implementation just throws an UnsupportedOperationException
.
This default implementation delegates to the corresponding type-specific method.
last
in interface LongPriorityQueue
last
in interface PriorityQueue<java.lang.Long>
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object