it.unimi.dsi.fastutil
Class PriorityQueues.EmptyPriorityQueue

java.lang.Object
  extended byit.unimi.dsi.fastutil.PriorityQueues.EmptyPriorityQueue
All Implemented Interfaces:
BytePriorityQueue, CharPriorityQueue, DoublePriorityQueue, FloatPriorityQueue, IntPriorityQueue, LongPriorityQueue, PriorityQueue, ShortPriorityQueue
Enclosing class:
PriorityQueues

public static class PriorityQueues.EmptyPriorityQueue
extends Object
implements BytePriorityQueue, ShortPriorityQueue, IntPriorityQueue, LongPriorityQueue, CharPriorityQueue, FloatPriorityQueue, DoublePriorityQueue, PriorityQueue

An immutable class representing the empty priority queue and implementing all type-specific priority queue interfaces.

This class may be useful to implement your own in case you subclass a type-specific priority queue.


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.
 Comparator comparator()
          Returns the comparator associated with this queue, or null if it uses its elements' natural ordering.
 Object dequeue()
          Dequeues the first() element from the queue.
 byte dequeueByte()
          Dequeues the first element from the queue.
 char dequeueChar()
          Dequeues the first element from the queue.
 double dequeueDouble()
          Dequeues the first element from the queue.
 float dequeueFloat()
          Dequeues the first element from the queue.
 int dequeueInt()
          Dequeues the first element from the queue.
 long dequeueLong()
          Dequeues the first element from the queue.
 short dequeueShort()
          Dequeues the first element from the queue.
 void enqueue(byte k)
          Enqueues a new element.
 void enqueue(char k)
          Enqueues a new element.
 void enqueue(double k)
          Enqueues a new element.
 void enqueue(float k)
          Enqueues a new element.
 void enqueue(int k)
          Enqueues a new element.
 void enqueue(long k)
          Enqueues a new element.
 void enqueue(Object ok)
          Enqueues a new element.
 void enqueue(short k)
          Enqueues a new element.
 Object first()
          Returns the first element of the queue.
 byte firstByte()
          Returns the front element of the queue.
 char firstChar()
          Returns the front element of the queue.
 double firstDouble()
          Returns the front element of the queue.
 float firstFloat()
          Returns the front element of the queue.
 int firstInt()
          Returns the front element of the queue.
 long firstLong()
          Returns the front element of the queue.
 short firstShort()
          Returns the front element of the queue.
 boolean isEmpty()
          Checks whether the queue is empty.
 Object last()
          Returns the last element of the queue, that is, the element the would be dequeued last (optional operation).
 byte lastByte()
          Returns the rear element of the queue, that is, the element the would be dequeued last (optional operation).
 char lastChar()
          Returns the rear element of the queue, that is, the element the would be dequeued last (optional operation).
 double lastDouble()
          Returns the rear element of the queue, that is, the element the would be dequeued last (optional operation).
 float lastFloat()
          Returns the rear element of the queue, that is, the element the would be dequeued last (optional operation).
 int lastInt()
          Returns the rear element of the queue, that is, the element the would be dequeued last (optional operation).
 long lastLong()
          Returns the rear element of the queue, that is, the element the would be dequeued last (optional operation).
 short lastShort()
          Returns the rear 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(Object ok)
Description copied from interface: PriorityQueue
Enqueues a new element.

Specified by:
enqueue in interface PriorityQueue
Parameters:
ok - the element to enqueue..

enqueue

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

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

enqueue

public void enqueue(char k)
Description copied from interface: CharPriorityQueue
Enqueues a new element.

Specified by:
enqueue in interface CharPriorityQueue
Parameters:
k - the element to enqueue..

enqueue

public void enqueue(short k)
Description copied from interface: ShortPriorityQueue
Enqueues a new element.

Specified by:
enqueue in interface ShortPriorityQueue
Parameters:
k - the element to enqueue..

enqueue

public void enqueue(int k)
Description copied from interface: IntPriorityQueue
Enqueues a new element.

Specified by:
enqueue in interface IntPriorityQueue
Parameters:
k - the element to enqueue..

enqueue

public void enqueue(long k)
Description copied from interface: LongPriorityQueue
Enqueues a new element.

Specified by:
enqueue in interface LongPriorityQueue
Parameters:
k - the element to enqueue..

enqueue

public void enqueue(float k)
Description copied from interface: FloatPriorityQueue
Enqueues a new element.

Specified by:
enqueue in interface FloatPriorityQueue
Parameters:
k - the element to enqueue..

enqueue

public void enqueue(double k)
Description copied from interface: DoublePriorityQueue
Enqueues a new element.

Specified by:
enqueue in interface DoublePriorityQueue
Parameters:
k - the element to enqueue..

dequeue

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

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

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.

dequeueChar

public char dequeueChar()
Description copied from interface: CharPriorityQueue
Dequeues the first element from the queue.

Specified by:
dequeueChar in interface CharPriorityQueue
Returns:
the dequeued element.

dequeueShort

public short dequeueShort()
Description copied from interface: ShortPriorityQueue
Dequeues the first element from the queue.

Specified by:
dequeueShort in interface ShortPriorityQueue
Returns:
the dequeued element.

dequeueInt

public int dequeueInt()
Description copied from interface: IntPriorityQueue
Dequeues the first element from the queue.

Specified by:
dequeueInt in interface IntPriorityQueue
Returns:
the dequeued element.

dequeueLong

public long dequeueLong()
Description copied from interface: LongPriorityQueue
Dequeues the first element from the queue.

Specified by:
dequeueLong in interface LongPriorityQueue
Returns:
the dequeued element.

dequeueFloat

public float dequeueFloat()
Description copied from interface: FloatPriorityQueue
Dequeues the first element from the queue.

Specified by:
dequeueFloat in interface FloatPriorityQueue
Returns:
the dequeued element.

dequeueDouble

public double dequeueDouble()
Description copied from interface: DoublePriorityQueue
Dequeues the first element from the queue.

Specified by:
dequeueDouble in interface DoublePriorityQueue
Returns:
the dequeued element.

first

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

Specified by:
first in interface PriorityQueue
Returns:
the first element.

firstByte

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

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

firstChar

public char firstChar()
Description copied from interface: CharPriorityQueue
Returns the front element of the queue.

Specified by:
firstChar in interface CharPriorityQueue
Returns:
the front element.

firstShort

public short firstShort()
Description copied from interface: ShortPriorityQueue
Returns the front element of the queue.

Specified by:
firstShort in interface ShortPriorityQueue
Returns:
the front element.

firstInt

public int firstInt()
Description copied from interface: IntPriorityQueue
Returns the front element of the queue.

Specified by:
firstInt in interface IntPriorityQueue
Returns:
the front element.

firstLong

public long firstLong()
Description copied from interface: LongPriorityQueue
Returns the front element of the queue.

Specified by:
firstLong in interface LongPriorityQueue
Returns:
the front element.

firstFloat

public float firstFloat()
Description copied from interface: FloatPriorityQueue
Returns the front element of the queue.

Specified by:
firstFloat in interface FloatPriorityQueue
Returns:
the front element.

firstDouble

public double firstDouble()
Description copied from interface: DoublePriorityQueue
Returns the front element of the queue.

Specified by:
firstDouble in interface DoublePriorityQueue
Returns:
the front element.

last

public Object 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
Returns:
the last element.

lastByte

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

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

lastChar

public char lastChar()
Description copied from interface: CharPriorityQueue
Returns the rear element of the queue, that is, the element the would be dequeued last (optional operation).

Specified by:
lastChar in interface CharPriorityQueue
Returns:
the rear element.

lastShort

public short lastShort()
Description copied from interface: ShortPriorityQueue
Returns the rear element of the queue, that is, the element the would be dequeued last (optional operation).

Specified by:
lastShort in interface ShortPriorityQueue
Returns:
the rear element.

lastInt

public int lastInt()
Description copied from interface: IntPriorityQueue
Returns the rear element of the queue, that is, the element the would be dequeued last (optional operation).

Specified by:
lastInt in interface IntPriorityQueue
Returns:
the rear element.

lastLong

public long lastLong()
Description copied from interface: LongPriorityQueue
Returns the rear element of the queue, that is, the element the would be dequeued last (optional operation).

Specified by:
lastLong in interface LongPriorityQueue
Returns:
the rear element.

lastFloat

public float lastFloat()
Description copied from interface: FloatPriorityQueue
Returns the rear element of the queue, that is, the element the would be dequeued last (optional operation).

Specified by:
lastFloat in interface FloatPriorityQueue
Returns:
the rear element.

lastDouble

public double lastDouble()
Description copied from interface: DoublePriorityQueue
Returns the rear element of the queue, that is, the element the would be dequeued last (optional operation).

Specified by:
lastDouble in interface DoublePriorityQueue
Returns:
the rear element.

comparator

public Comparator comparator()
Description copied from interface: PriorityQueue
Returns the comparator associated with this queue, or null if it uses its elements' natural ordering.

Specified by:
comparator in interface PriorityQueue
Returns:
the comparator associated with this sorted set, or null if it uses its elements' natural ordering.

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

size

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

Specified by:
size in interface PriorityQueue
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

isEmpty

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

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