Class EmptyPriorityQueue<T>

java.lang.Object
io.netty.util.internal.EmptyPriorityQueue<T>
All Implemented Interfaces:
PriorityQueue<T>, java.lang.Iterable<T>, java.util.Collection<T>, java.util.Queue<T>

public final class EmptyPriorityQueue<T> extends java.lang.Object implements PriorityQueue<T>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final PriorityQueue<java.lang.Object>
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    add(T t)
     
    boolean
    addAll(java.util.Collection<? extends T> c)
     
    void
     
    void
    Removes all of the elements from this PriorityQueue without calling PriorityQueueNode.priorityQueueIndex(DefaultPriorityQueue) or explicitly removing references to them to allow them to be garbage collected.
    boolean
    contains(java.lang.Object o)
     
    boolean
    containsAll(java.util.Collection<?> c)
     
    boolean
    Same as Collection.contains(Object) but typed using generics.
     
    boolean
    equals(java.lang.Object o)
     
    int
     
    static <V> EmptyPriorityQueue<V>
    Returns an unmodifiable empty PriorityQueue.
    boolean
     
    java.util.Iterator<T>
     
    boolean
    offer(T t)
     
     
     
    void
    Notify the queue that the priority for node has changed.
     
    boolean
    remove(java.lang.Object o)
     
    boolean
    removeAll(java.util.Collection<?> c)
     
    boolean
    removeTyped(T node)
    Same as Collection.remove(Object) but typed using generics.
    boolean
    retainAll(java.util.Collection<?> c)
     
    int
     
    java.lang.Object[]
     
    <T1> T1[]
    toArray(T1[] a)
     
    java.lang.String
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface java.util.Collection

    parallelStream, removeIf, spliterator, stream

    Methods inherited from interface java.lang.Iterable

    forEach
  • Field Details

    • INSTANCE

      private static final PriorityQueue<java.lang.Object> INSTANCE
  • Constructor Details

    • EmptyPriorityQueue

      private EmptyPriorityQueue()
  • Method Details

    • instance

      public static <V> EmptyPriorityQueue<V> instance()
      Returns an unmodifiable empty PriorityQueue.
    • removeTyped

      public boolean removeTyped(T node)
      Description copied from interface: PriorityQueue
      Same as Collection.remove(Object) but typed using generics.
      Specified by:
      removeTyped in interface PriorityQueue<T>
    • containsTyped

      public boolean containsTyped(T node)
      Description copied from interface: PriorityQueue
      Same as Collection.contains(Object) but typed using generics.
      Specified by:
      containsTyped in interface PriorityQueue<T>
    • priorityChanged

      public void priorityChanged(T node)
      Description copied from interface: PriorityQueue
      Notify the queue that the priority for node has changed. The queue will adjust to ensure the priority queue properties are maintained.
      Specified by:
      priorityChanged in interface PriorityQueue<T>
      Parameters:
      node - An object which is in this queue and the priority may have changed.
    • size

      public int size()
      Specified by:
      size in interface java.util.Collection<T>
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface java.util.Collection<T>
    • contains

      public boolean contains(java.lang.Object o)
      Specified by:
      contains in interface java.util.Collection<T>
    • iterator

      public java.util.Iterator<T> iterator()
      Specified by:
      iterator in interface java.util.Collection<T>
      Specified by:
      iterator in interface java.lang.Iterable<T>
    • toArray

      public java.lang.Object[] toArray()
      Specified by:
      toArray in interface java.util.Collection<T>
    • toArray

      public <T1> T1[] toArray(T1[] a)
      Specified by:
      toArray in interface java.util.Collection<T>
    • add

      public boolean add(T t)
      Specified by:
      add in interface java.util.Collection<T>
      Specified by:
      add in interface java.util.Queue<T>
    • remove

      public boolean remove(java.lang.Object o)
      Specified by:
      remove in interface java.util.Collection<T>
    • containsAll

      public boolean containsAll(java.util.Collection<?> c)
      Specified by:
      containsAll in interface java.util.Collection<T>
    • addAll

      public boolean addAll(java.util.Collection<? extends T> c)
      Specified by:
      addAll in interface java.util.Collection<T>
    • removeAll

      public boolean removeAll(java.util.Collection<?> c)
      Specified by:
      removeAll in interface java.util.Collection<T>
    • retainAll

      public boolean retainAll(java.util.Collection<?> c)
      Specified by:
      retainAll in interface java.util.Collection<T>
    • clear

      public void clear()
      Specified by:
      clear in interface java.util.Collection<T>
    • clearIgnoringIndexes

      public void clearIgnoringIndexes()
      Description copied from interface: PriorityQueue
      Removes all of the elements from this PriorityQueue without calling PriorityQueueNode.priorityQueueIndex(DefaultPriorityQueue) or explicitly removing references to them to allow them to be garbage collected. This should only be used when it is certain that the nodes will not be re-inserted into this or any other PriorityQueue and it is known that the PriorityQueue itself will be garbage collected after this call.
      Specified by:
      clearIgnoringIndexes in interface PriorityQueue<T>
    • equals

      public boolean equals(java.lang.Object o)
      Specified by:
      equals in interface java.util.Collection<T>
      Overrides:
      equals in class java.lang.Object
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface java.util.Collection<T>
      Overrides:
      hashCode in class java.lang.Object
    • offer

      public boolean offer(T t)
      Specified by:
      offer in interface java.util.Queue<T>
    • remove

      public T remove()
      Specified by:
      remove in interface java.util.Queue<T>
    • poll

      public T poll()
      Specified by:
      poll in interface java.util.Queue<T>
    • element

      public T element()
      Specified by:
      element in interface java.util.Queue<T>
    • peek

      public T peek()
      Specified by:
      peek in interface java.util.Queue<T>
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object