Class PriorityQueues

java.lang.Object
it.unimi.dsi.fastutil.PriorityQueues

public class PriorityQueues
extends java.lang.Object
A class providing static methods and objects that do useful things with priority queues.
See Also:
PriorityQueue
  • Nested Class Summary

    Nested Classes
    Modifier and Type Class Description
    static class  PriorityQueues.EmptyPriorityQueue
    An immutable class representing the empty priority queue.
    static class  PriorityQueues.SynchronizedPriorityQueue<K>
    A synchronized wrapper class for priority queues.
  • Field Summary

    Fields
    Modifier and Type Field Description
    static PriorityQueues.EmptyPriorityQueue EMPTY_QUEUE
    An empty indirect priority queue (immutable).
  • Method Summary

    Modifier and Type Method Description
    static <K> PriorityQueue<K> emptyQueue()
    Returns an empty queue (immutable).
    static <K> PriorityQueue<K> synchronize​(PriorityQueue<K> q)
    Returns a synchronized priority queue backed by the specified priority queue.
    static <K> PriorityQueue<K> synchronize​(PriorityQueue<K> q, java.lang.Object sync)
    Returns a synchronized priority queue backed by the specified priority queue, using an assigned object to synchronize.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Method Details

    • emptyQueue

      public static <K> PriorityQueue<K> emptyQueue()
      Returns an empty queue (immutable). It is serializable and cloneable.

      This method provides a typesafe access to EMPTY_QUEUE.

      Type Parameters:
      K - the class of the objects in the queue.
      Returns:
      an empty queue (immutable).
    • synchronize

      public static <K> PriorityQueue<K> synchronize​(PriorityQueue<K> q)
      Returns a synchronized priority queue backed by the specified priority queue.
      Type Parameters:
      K - the class of the objects in the queue.
      Parameters:
      q - the priority queue to be wrapped in a synchronized priority queue.
      Returns:
      a synchronized view of the specified priority queue.
    • synchronize

      public static <K> PriorityQueue<K> synchronize​(PriorityQueue<K> q, java.lang.Object sync)
      Returns a synchronized priority queue backed by the specified priority queue, using an assigned object to synchronize.
      Type Parameters:
      K - the class of the objects in the queue.
      Parameters:
      q - the priority queue to be wrapped in a synchronized priority queue.
      sync - an object that will be used to synchronize the access to the priority queue.
      Returns:
      a synchronized view of the specified priority queue.