Class ShortPriorityQueues.SynchronizedPriorityQueue

java.lang.Object
it.unimi.dsi.fastutil.shorts.ShortPriorityQueues.SynchronizedPriorityQueue
All Implemented Interfaces:
it.unimi.dsi.fastutil.PriorityQueue<Short>, ShortPriorityQueue
Enclosing class:
ShortPriorityQueues

public static class ShortPriorityQueues.SynchronizedPriorityQueue extends Object implements ShortPriorityQueue
A synchronized wrapper class for priority queues.
  • Field Details

  • Constructor Details

  • Method Details

    • enqueue

      public void enqueue(short x)
      Description copied from interface: ShortPriorityQueue
      Enqueues a new element.
      Specified by:
      enqueue in interface ShortPriorityQueue
      Parameters:
      x - the element to enqueue.
      See Also:
      • PriorityQueue.enqueue(Object)
    • dequeueShort

      public short dequeueShort()
      Description copied from interface: ShortPriorityQueue
      Dequeues the first element from the queue.
      Specified by:
      dequeueShort in interface ShortPriorityQueue
      Returns:
      the dequeued element.
      See Also:
    • firstShort

      public short firstShort()
      Description copied from interface: ShortPriorityQueue
      Returns the first element of the queue.
      Specified by:
      firstShort in interface ShortPriorityQueue
      Returns:
      the first element.
      See Also:
    • lastShort

      public short lastShort()
      Description copied from interface: ShortPriorityQueue
      Returns 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:
      lastShort in interface ShortPriorityQueue
      Returns:
      the last element.
      See Also:
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface it.unimi.dsi.fastutil.PriorityQueue<Short>
    • size

      public int size()
      Specified by:
      size in interface it.unimi.dsi.fastutil.PriorityQueue<Short>
    • clear

      public void clear()
      Specified by:
      clear in interface it.unimi.dsi.fastutil.PriorityQueue<Short>
    • changed

      public void changed()
      Specified by:
      changed in interface it.unimi.dsi.fastutil.PriorityQueue<Short>
    • comparator

      public it.unimi.dsi.fastutil.shorts.ShortComparator comparator()
      Description copied from interface: ShortPriorityQueue
      Returns the comparator associated with this priority queue, or null if it uses its elements' natural ordering.
      Specified by:
      comparator in interface it.unimi.dsi.fastutil.PriorityQueue<Short>
      Specified by:
      comparator in interface ShortPriorityQueue
      Returns:
      the comparator associated with this priority queue.
      See Also:
      • PriorityQueue.comparator()
    • enqueue

      @Deprecated public void enqueue(Short x)
      Deprecated.
      Description copied from interface: ShortPriorityQueue

      This default implementation delegates to the corresponding type-specific method.

      Specified by:
      enqueue in interface it.unimi.dsi.fastutil.PriorityQueue<Short>
      Specified by:
      enqueue in interface ShortPriorityQueue
    • dequeue

      @Deprecated public Short dequeue()
      Deprecated.
      Description copied from interface: ShortPriorityQueue

      This default implementation delegates to the corresponding type-specific method.

      Specified by:
      dequeue in interface it.unimi.dsi.fastutil.PriorityQueue<Short>
      Specified by:
      dequeue in interface ShortPriorityQueue
    • first

      @Deprecated public Short first()
      Deprecated.
      Description copied from interface: ShortPriorityQueue

      This default implementation delegates to the corresponding type-specific method.

      Specified by:
      first in interface it.unimi.dsi.fastutil.PriorityQueue<Short>
      Specified by:
      first in interface ShortPriorityQueue
    • last

      @Deprecated public Short last()
      Deprecated.
      Description copied from interface: ShortPriorityQueue

      This default implementation delegates to the corresponding type-specific method.

      Specified by:
      last in interface it.unimi.dsi.fastutil.PriorityQueue<Short>
      Specified by:
      last in interface ShortPriorityQueue
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object