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