Package it.unimi.dsi.fastutil.longs
Class LongPriorityQueues.SynchronizedPriorityQueue
java.lang.Object
it.unimi.dsi.fastutil.longs.LongPriorityQueues.SynchronizedPriorityQueue
- All Implemented Interfaces:
LongPriorityQueue,it.unimi.dsi.fastutil.PriorityQueue<Long>
- Enclosing class:
LongPriorityQueues
public static class LongPriorityQueues.SynchronizedPriorityQueue
extends Object
implements LongPriorityQueue
A synchronized wrapper class for priority queues.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotected -
Method Summary
Modifier and TypeMethodDescriptionvoidchanged()voidclear()it.unimi.dsi.fastutil.longs.LongComparatorReturns the comparator associated with this priority queue, or null if it uses its elements' natural ordering.dequeue()Deprecated.longDequeues the first element from the queue.voidenqueue(long x) Enqueues a new element.voidDeprecated.booleanfirst()Deprecated.longReturns the first element of the queue.inthashCode()booleanisEmpty()last()Deprecated.longlastLong()Returns the last element of the queue, that is, the element the would be dequeued last (optional operation).intsize()
-
Field Details
-
q
-
sync
-
-
Constructor Details
-
SynchronizedPriorityQueue
-
SynchronizedPriorityQueue
-
-
Method Details
-
enqueue
public void enqueue(long x) Description copied from interface:LongPriorityQueueEnqueues a new element.- Specified by:
enqueuein interfaceLongPriorityQueue- Parameters:
x- the element to enqueue.- See Also:
-
dequeueLong
public long dequeueLong()Description copied from interface:LongPriorityQueueDequeues the first element from the queue.- Specified by:
dequeueLongin interfaceLongPriorityQueue- Returns:
- the dequeued element.
- See Also:
-
firstLong
public long firstLong()Description copied from interface:LongPriorityQueueReturns the first element of the queue.- Specified by:
firstLongin interfaceLongPriorityQueue- Returns:
- the first element.
- See Also:
-
lastLong
public long lastLong()Description copied from interface:LongPriorityQueueReturns the last element of the queue, that is, the element the would be dequeued last (optional operation).This default implementation just throws an
UnsupportedOperationException.- Specified by:
lastLongin interfaceLongPriorityQueue- Returns:
- the last element.
- See Also:
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceit.unimi.dsi.fastutil.PriorityQueue<Long>
-
size
public int size()- Specified by:
sizein interfaceit.unimi.dsi.fastutil.PriorityQueue<Long>
-
clear
public void clear()- Specified by:
clearin interfaceit.unimi.dsi.fastutil.PriorityQueue<Long>
-
changed
public void changed()- Specified by:
changedin interfaceit.unimi.dsi.fastutil.PriorityQueue<Long>
-
comparator
public it.unimi.dsi.fastutil.longs.LongComparator comparator()Description copied from interface:LongPriorityQueueReturns the comparator associated with this priority queue, or null if it uses its elements' natural ordering.- Specified by:
comparatorin interfaceLongPriorityQueue- Specified by:
comparatorin interfaceit.unimi.dsi.fastutil.PriorityQueue<Long>- Returns:
- the comparator associated with this priority queue.
- See Also:
-
enqueue
Deprecated.Description copied from interface:LongPriorityQueueThis default implementation delegates to the corresponding type-specific method.
- Specified by:
enqueuein interfaceLongPriorityQueue- Specified by:
enqueuein interfaceit.unimi.dsi.fastutil.PriorityQueue<Long>
-
dequeue
Deprecated.Description copied from interface:LongPriorityQueueThis default implementation delegates to the corresponding type-specific method.
- Specified by:
dequeuein interfaceLongPriorityQueue- Specified by:
dequeuein interfaceit.unimi.dsi.fastutil.PriorityQueue<Long>
-
first
Deprecated.Description copied from interface:LongPriorityQueueThis default implementation delegates to the corresponding type-specific method.
- Specified by:
firstin interfaceLongPriorityQueue- Specified by:
firstin interfaceit.unimi.dsi.fastutil.PriorityQueue<Long>
-
last
Deprecated.Description copied from interface:LongPriorityQueueThis default implementation delegates to the corresponding type-specific method.
- Specified by:
lastin interfaceLongPriorityQueue- Specified by:
lastin interfaceit.unimi.dsi.fastutil.PriorityQueue<Long>
-
hashCode
public int hashCode() -
equals
-