public static class CharPriorityQueues.SynchronizedPriorityQueue extends 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 sorted set, or null if it uses its elements' natural ordering.
|
Character |
dequeue()
Dequeues the first element from the queue.
|
char |
dequeueChar()
Dequeues the first element from the queue.
|
void |
enqueue(char x)
Enqueues a new element.
|
void |
enqueue(Character x)
Enqueues a new element.
|
Character |
first()
Returns the first element of the queue.
|
char |
firstChar()
Returns the first element of the queue.
|
boolean |
isEmpty()
Checks whether the queue is empty.
|
Character |
last()
Returns the last element of the queue, that is, the element the would be dequeued last (optional operation).
|
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.public char dequeueChar()
CharPriorityQueue
dequeueChar
in interface CharPriorityQueue
public char firstChar()
CharPriorityQueue
firstChar
in interface CharPriorityQueue
public char lastChar()
CharPriorityQueue
lastChar
in interface CharPriorityQueue
public boolean isEmpty()
PriorityQueue
isEmpty
in interface PriorityQueue<Character>
public int size()
PriorityQueue
size
in interface PriorityQueue<Character>
public void clear()
PriorityQueue
clear
in interface PriorityQueue<Character>
public void changed()
PriorityQueue
changed
in interface PriorityQueue<Character>
public CharComparator comparator()
CharPriorityQueue
Note that this specification strengthens the one given in PriorityQueue.comparator()
.
comparator
in interface CharPriorityQueue
comparator
in interface PriorityQueue<Character>
null
if it uses its elements' natural ordering.PriorityQueue.comparator()
public void enqueue(Character x)
PriorityQueue
enqueue
in interface PriorityQueue<Character>
x
- the element to enqueue..public Character dequeue()
PriorityQueue
dequeue
in interface PriorityQueue<Character>
public Character first()
PriorityQueue
first
in interface PriorityQueue<Character>
public Character last()
PriorityQueue
last
in interface PriorityQueue<Character>