Package it.unimi.dsi.fastutil
Class PriorityQueues
java.lang.Object
it.unimi.dsi.fastutil.PriorityQueues
A class providing static methods and objects that do useful things with priority queues.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
An immutable class representing the empty priority queue.static class
A synchronized wrapper class for priority queues. -
Field Summary
Modifier and TypeFieldDescriptionstatic final PriorityQueues.EmptyPriorityQueue
An empty indirect priority queue (immutable). -
Method Summary
Modifier and TypeMethodDescriptionstatic <K> PriorityQueue
<K> 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, Object sync) Returns a synchronized priority queue backed by the specified priority queue, using an assigned object to synchronize.
-
Field Details
-
EMPTY_QUEUE
An empty indirect priority queue (immutable).
-
-
Method Details
-
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
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
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.
-