Package it.unimi.dsi.fastutil.shorts
Class ShortPriorityQueues.SynchronizedPriorityQueue
java.lang.Object
it.unimi.dsi.fastutil.shorts.ShortPriorityQueues.SynchronizedPriorityQueue
- All Implemented Interfaces:
it.unimi.dsi.fastutil.PriorityQueue<java.lang.Short>,ShortPriorityQueue
- Enclosing class:
- ShortPriorityQueues
public static class ShortPriorityQueues.SynchronizedPriorityQueue extends java.lang.Object implements ShortPriorityQueue
A synchronized wrapper class for priority queues.
-
Method Summary
Modifier and Type Method Description voidchanged()voidclear()ShortComparatorcomparator()Returns the comparator associated with this priority queue, or null if it uses its elements' natural ordering.java.lang.Shortdequeue()Deprecated.shortdequeueShort()Dequeues the first element from the queue.voidenqueue(short x)Enqueues a new element.voidenqueue(java.lang.Short x)Deprecated.booleanequals(java.lang.Object o)java.lang.Shortfirst()Deprecated.shortfirstShort()Returns the first element of the queue.inthashCode()booleanisEmpty()java.lang.Shortlast()Deprecated.shortlastShort()Returns the last element of the queue, that is, the element the would be dequeued last (optional operation).intsize()Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
-
Method Details
-
enqueue
public void enqueue(short x)Description copied from interface:ShortPriorityQueueEnqueues a new element.- Specified by:
enqueuein interfaceShortPriorityQueue- Parameters:
x- the element to enqueue.- See Also:
PriorityQueue.enqueue(Object)
-
dequeueShort
public short dequeueShort()Description copied from interface:ShortPriorityQueueDequeues the first element from the queue.- Specified by:
dequeueShortin interfaceShortPriorityQueue- Returns:
- the dequeued element.
- See Also:
ShortPriorityQueue.dequeue()
-
firstShort
public short firstShort()Description copied from interface:ShortPriorityQueueReturns the first element of the queue.- Specified by:
firstShortin interfaceShortPriorityQueue- Returns:
- the first element.
- See Also:
ShortPriorityQueue.first()
-
lastShort
public short lastShort()Description copied from interface:ShortPriorityQueueReturns 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:
lastShortin interfaceShortPriorityQueue- Returns:
- the last element.
- See Also:
ShortPriorityQueue.last()
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceit.unimi.dsi.fastutil.PriorityQueue<java.lang.Short>
-
size
public int size()- Specified by:
sizein interfaceit.unimi.dsi.fastutil.PriorityQueue<java.lang.Short>
-
clear
public void clear()- Specified by:
clearin interfaceit.unimi.dsi.fastutil.PriorityQueue<java.lang.Short>
-
changed
public void changed()- Specified by:
changedin interfaceit.unimi.dsi.fastutil.PriorityQueue<java.lang.Short>
-
comparator
Description copied from interface:ShortPriorityQueueReturns the comparator associated with this priority queue, or null if it uses its elements' natural ordering.- Specified by:
comparatorin interfaceit.unimi.dsi.fastutil.PriorityQueue<java.lang.Short>- Specified by:
comparatorin interfaceShortPriorityQueue- Returns:
- the comparator associated with this priority queue.
- See Also:
PriorityQueue.comparator()
-
enqueue
@Deprecated public void enqueue(java.lang.Short x)Deprecated.Description copied from interface:ShortPriorityQueueThis default implementation delegates to the corresponding type-specific method.
- Specified by:
enqueuein interfaceit.unimi.dsi.fastutil.PriorityQueue<java.lang.Short>- Specified by:
enqueuein interfaceShortPriorityQueue
-
dequeue
@Deprecated public java.lang.Short dequeue()Deprecated.Description copied from interface:ShortPriorityQueueThis default implementation delegates to the corresponding type-specific method.
- Specified by:
dequeuein interfaceit.unimi.dsi.fastutil.PriorityQueue<java.lang.Short>- Specified by:
dequeuein interfaceShortPriorityQueue
-
first
@Deprecated public java.lang.Short first()Deprecated.Description copied from interface:ShortPriorityQueueThis default implementation delegates to the corresponding type-specific method.
- Specified by:
firstin interfaceit.unimi.dsi.fastutil.PriorityQueue<java.lang.Short>- Specified by:
firstin interfaceShortPriorityQueue
-
last
@Deprecated public java.lang.Short last()Deprecated.Description copied from interface:ShortPriorityQueueThis default implementation delegates to the corresponding type-specific method.
- Specified by:
lastin interfaceit.unimi.dsi.fastutil.PriorityQueue<java.lang.Short>- Specified by:
lastin interfaceShortPriorityQueue
-
hashCode
public int hashCode()- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)- Overrides:
equalsin classjava.lang.Object
-