it.unimi.dsi.fastutil.ints
Interface IntPriorityQueue

All Superinterfaces:
PriorityQueue<java.lang.Integer>
All Known Implementing Classes:
AbstractIntPriorityQueue, IntArrayPriorityQueue, IntHeapPriorityQueue, IntPriorityQueues.SynchronizedPriorityQueue

public interface IntPriorityQueue
extends PriorityQueue<java.lang.Integer>

A type-specific PriorityQueue; provides some additional methods that use polymorphism to avoid (un)boxing.

Additionally, this interface strengthens comparator().


Method Summary
 IntComparator comparator()
          Returns the comparator associated with this sorted set, or null if it uses its elements' natural ordering.
 int dequeueInt()
          Dequeues the first element from the queue.
 void enqueue(int x)
          Enqueues a new element.
 int firstInt()
          Returns the front element of the queue.
 int lastInt()
          Returns the rear element of the queue, that is, the element the would be dequeued last (optional operation).
 
Methods inherited from interface it.unimi.dsi.fastutil.PriorityQueue
changed, clear, dequeue, enqueue, first, isEmpty, last, size
 

Method Detail

enqueue

void enqueue(int x)
Enqueues a new element.

Parameters:
x - the element to enqueue..

dequeueInt

int dequeueInt()
Dequeues the first element from the queue.

Returns:
the dequeued element.
Throws:
java.util.NoSuchElementException - if the queue is empty.

firstInt

int firstInt()
Returns the front element of the queue.

Returns:
the front element.
Throws:
java.util.NoSuchElementException - if the queue is empty.

lastInt

int lastInt()
Returns the rear element of the queue, that is, the element the would be dequeued last (optional operation).

Returns:
the rear element.
Throws:
java.util.NoSuchElementException - if the queue is empty.

comparator

IntComparator comparator()
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 PriorityQueue<java.lang.Integer>
Returns:
the comparator associated with this sorted set, or null if it uses its elements' natural ordering.
See Also:
PriorityQueue.comparator()