Class LongPriorityQueues.SynchronizedPriorityQueue

java.lang.Object
it.unimi.dsi.fastutil.longs.LongPriorityQueues.SynchronizedPriorityQueue
All Implemented Interfaces:
LongPriorityQueue, PriorityQueue<java.lang.Long>
Enclosing class:
LongPriorityQueues

public static class LongPriorityQueues.SynchronizedPriorityQueue
extends java.lang.Object
implements LongPriorityQueue
A synchronized wrapper class for priority queues.
  • Method Summary

    Modifier and Type Method Description
    void changed()
    Notifies the queue that the first element has changed (optional operation).
    void clear()
    Removes all elements from this queue.
    LongComparator comparator()
    Returns the comparator associated with this priority queue, or null if it uses its elements' natural ordering.
    java.lang.Long dequeue()
    Deprecated.
    long dequeueLong()
    Dequeues the first element from the queue.
    void enqueue​(long x)
    Enqueues a new element.
    void enqueue​(java.lang.Long x)
    Deprecated.
    boolean equals​(java.lang.Object o)  
    java.lang.Long first()
    Deprecated.
    long firstLong()
    Returns the first element of the queue.
    int hashCode()  
    boolean isEmpty()
    Checks whether this queue is empty.
    java.lang.Long last()
    Deprecated.
    long lastLong()
    Returns the last element of the queue, that is, the element the would be dequeued last (optional operation).
    int size()
    Returns the number of elements in this queue.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • enqueue

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

      public long dequeueLong()
      Description copied from interface: LongPriorityQueue
      Dequeues the first element from the queue.
      Specified by:
      dequeueLong in interface LongPriorityQueue
      Returns:
      the dequeued element.
      See Also:
      LongPriorityQueue.dequeue()
    • firstLong

      public long firstLong()
      Description copied from interface: LongPriorityQueue
      Returns the first element of the queue.
      Specified by:
      firstLong in interface LongPriorityQueue
      Returns:
      the first element.
      See Also:
      LongPriorityQueue.first()
    • lastLong

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

      public boolean isEmpty()
      Description copied from interface: PriorityQueue
      Checks whether this queue is empty.

      This default implementation checks whether PriorityQueue.size() is zero.

      Specified by:
      isEmpty in interface PriorityQueue<java.lang.Long>
      Returns:
      true if this queue is empty.
    • size

      public int size()
      Description copied from interface: PriorityQueue
      Returns the number of elements in this queue.
      Specified by:
      size in interface PriorityQueue<java.lang.Long>
      Returns:
      the number of elements in this queue.
    • clear

      public void clear()
      Description copied from interface: PriorityQueue
      Removes all elements from this queue.
      Specified by:
      clear in interface PriorityQueue<java.lang.Long>
    • changed

      public void changed()
      Description copied from interface: PriorityQueue
      Notifies the queue that the first element has changed (optional operation).

      This default implementation just throws an UnsupportedOperationException.

      Specified by:
      changed in interface PriorityQueue<java.lang.Long>
    • comparator

      public LongComparator comparator()
      Description copied from interface: LongPriorityQueue
      Returns the comparator associated with this priority queue, or null if it uses its elements' natural ordering.
      Specified by:
      comparator in interface LongPriorityQueue
      Specified by:
      comparator in interface PriorityQueue<java.lang.Long>
      Returns:
      the comparator associated with this priority queue.
      See Also:
      PriorityQueue.comparator()
    • enqueue

      @Deprecated public void enqueue​(java.lang.Long x)
      Deprecated.
      Description copied from interface: LongPriorityQueue
      Enqueues a new element.

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

      Specified by:
      enqueue in interface LongPriorityQueue
      Specified by:
      enqueue in interface PriorityQueue<java.lang.Long>
      Parameters:
      x - the element to enqueue.
    • dequeue

      @Deprecated public java.lang.Long dequeue()
      Deprecated.
      Description copied from interface: LongPriorityQueue
      Dequeues the first element from the queue.

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

      Specified by:
      dequeue in interface LongPriorityQueue
      Specified by:
      dequeue in interface PriorityQueue<java.lang.Long>
      Returns:
      the dequeued element.
    • first

      @Deprecated public java.lang.Long first()
      Deprecated.
      Description copied from interface: LongPriorityQueue
      Returns the first element of the queue.

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

      Specified by:
      first in interface LongPriorityQueue
      Specified by:
      first in interface PriorityQueue<java.lang.Long>
      Returns:
      the first element.
    • last

      @Deprecated public java.lang.Long last()
      Deprecated.
      Description copied from interface: LongPriorityQueue
      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.

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

      Specified by:
      last in interface LongPriorityQueue
      Specified by:
      last in interface PriorityQueue<java.lang.Long>
      Returns:
      the last element.
    • hashCode

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

      public boolean equals​(java.lang.Object o)
      Overrides:
      equals in class java.lang.Object