it.unimi.dsi.fastutil.bytes
Class BytePriorityQueues.SynchronizedPriorityQueue

java.lang.Object
  extended by it.unimi.dsi.fastutil.bytes.BytePriorityQueues.SynchronizedPriorityQueue
All Implemented Interfaces:
BytePriorityQueue, PriorityQueue<Byte>
Enclosing class:
BytePriorityQueues

public static class BytePriorityQueues.SynchronizedPriorityQueue
extends Object
implements BytePriorityQueue

A synchronized wrapper class for priority queues.


Field Summary
static long serialVersionUID
           
 
Method Summary
 void changed()
          Notifies the queue that the first element has changed (optional operation).
 void clear()
          Removes all elements from this queue.
 ByteComparator comparator()
          Returns the comparator associated with this sorted set, or null if it uses its elements' natural ordering.
 Byte dequeue()
          Dequeues the first element from the queue.
 byte dequeueByte()
          Dequeues the first element from the queue.
 void enqueue(byte x)
          Enqueues a new element.
 void enqueue(Byte x)
          Enqueues a new element.
 Byte first()
          Returns the first element of the queue.
 byte firstByte()
          Returns the first element of the queue.
 boolean isEmpty()
          Checks whether the queue is empty.
 Byte last()
          Returns the last element of the queue, that is, the element the would be dequeued last (optional operation).
 byte lastByte()
          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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values
Method Detail

enqueue

public void enqueue(byte x)
Description copied from interface: BytePriorityQueue
Enqueues a new element.

Specified by:
enqueue in interface BytePriorityQueue
Parameters:
x - the element to enqueue.

dequeueByte

public byte dequeueByte()
Description copied from interface: BytePriorityQueue
Dequeues the first element from the queue.

Specified by:
dequeueByte in interface BytePriorityQueue
Returns:
the dequeued element.

firstByte

public byte firstByte()
Description copied from interface: BytePriorityQueue
Returns the first element of the queue.

Specified by:
firstByte in interface BytePriorityQueue
Returns:
the first element.

lastByte

public byte lastByte()
Description copied from interface: BytePriorityQueue
Returns the last element of the queue, that is, the element the would be dequeued last (optional operation).

Specified by:
lastByte in interface BytePriorityQueue
Returns:
the last element.

isEmpty

public boolean isEmpty()
Description copied from interface: PriorityQueue
Checks whether the queue is empty.

Specified by:
isEmpty in interface PriorityQueue<Byte>
Returns:
true if the queue is empty.

size

public int size()
Description copied from interface: PriorityQueue
Returns the number of elements in this queue.

Specified by:
size in interface PriorityQueue<Byte>
Returns:
the number of elements in this queue.

clear

public void clear()
Description copied from interface: PriorityQueue
Removes all elements from this queue.

Specified by:
clear in interface PriorityQueue<Byte>

changed

public void changed()
Description copied from interface: PriorityQueue
Notifies the queue that the first element has changed (optional operation).

Specified by:
changed in interface PriorityQueue<Byte>

comparator

public ByteComparator comparator()
Description copied from interface: BytePriorityQueue
Returns the comparator associated with this sorted set, or null if it uses its elements' natural ordering.

Note that this specification strengthens the one given in PriorityQueue.comparator().

Specified by:
comparator in interface BytePriorityQueue
Specified by:
comparator in interface PriorityQueue<Byte>
Returns:
the comparator associated with this sorted set, or null if it uses its elements' natural ordering.
See Also:
PriorityQueue.comparator()

enqueue

public void enqueue(Byte x)
Description copied from interface: PriorityQueue
Enqueues a new element.

Specified by:
enqueue in interface PriorityQueue<Byte>
Parameters:
x - the element to enqueue..

dequeue

public Byte dequeue()
Description copied from interface: PriorityQueue
Dequeues the first element from the queue.

Specified by:
dequeue in interface PriorityQueue<Byte>
Returns:
the dequeued element.

first

public Byte first()
Description copied from interface: PriorityQueue
Returns the first element of the queue.

Specified by:
first in interface PriorityQueue<Byte>
Returns:
the first element.

last

public Byte last()
Description copied from interface: PriorityQueue
Returns the last element of the queue, that is, the element the would be dequeued last (optional operation).

Specified by:
last in interface PriorityQueue<Byte>
Returns:
the last element.