Package io.netty.util.internal
Class EmptyPriorityQueue<T>
java.lang.Object
io.netty.util.internal.EmptyPriorityQueue<T>
- All Implemented Interfaces:
PriorityQueue<T>
,Iterable<T>
,Collection<T>
,Queue<T>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
addAll
(Collection<? extends T> c) void
clear()
void
Removes all of the elements from thisPriorityQueue
without callingPriorityQueueNode.priorityQueueIndex(DefaultPriorityQueue)
or explicitly removing references to them to allow them to be garbage collected.boolean
boolean
containsAll
(Collection<?> c) boolean
containsTyped
(T node) Same asCollection.contains(Object)
but typed using generics.element()
boolean
int
hashCode()
static <V> EmptyPriorityQueue
<V> instance()
Returns an unmodifiable emptyPriorityQueue
.boolean
isEmpty()
iterator()
boolean
peek()
poll()
void
priorityChanged
(T node) Notify the queue that the priority fornode
has changed.remove()
boolean
boolean
removeAll
(Collection<?> c) boolean
removeTyped
(T node) Same asCollection.remove(Object)
but typed using generics.boolean
retainAll
(Collection<?> c) int
size()
Object[]
toArray()
<T1> T1[]
toArray
(T1[] a) toString()
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, toArray
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
EmptyPriorityQueue
private EmptyPriorityQueue()
-
-
Method Details
-
instance
Returns an unmodifiable emptyPriorityQueue
. -
removeTyped
Description copied from interface:PriorityQueue
Same asCollection.remove(Object)
but typed using generics.- Specified by:
removeTyped
in interfacePriorityQueue<T>
-
containsTyped
Description copied from interface:PriorityQueue
Same asCollection.contains(Object)
but typed using generics.- Specified by:
containsTyped
in interfacePriorityQueue<T>
-
priorityChanged
Description copied from interface:PriorityQueue
Notify the queue that the priority fornode
has changed. The queue will adjust to ensure the priority queue properties are maintained.- Specified by:
priorityChanged
in interfacePriorityQueue<T>
- Parameters:
node
- An object which is in this queue and the priority may have changed.
-
size
public int size()- Specified by:
size
in interfaceCollection<T>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceCollection<T>
-
contains
- Specified by:
contains
in interfaceCollection<T>
-
iterator
-
toArray
- Specified by:
toArray
in interfaceCollection<T>
-
toArray
public <T1> T1[] toArray(T1[] a) - Specified by:
toArray
in interfaceCollection<T>
-
add
-
remove
- Specified by:
remove
in interfaceCollection<T>
-
containsAll
- Specified by:
containsAll
in interfaceCollection<T>
-
addAll
- Specified by:
addAll
in interfaceCollection<T>
-
removeAll
- Specified by:
removeAll
in interfaceCollection<T>
-
retainAll
- Specified by:
retainAll
in interfaceCollection<T>
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<T>
-
clearIgnoringIndexes
public void clearIgnoringIndexes()Description copied from interface:PriorityQueue
Removes all of the elements from thisPriorityQueue
without callingPriorityQueueNode.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 otherPriorityQueue
and it is known that thePriorityQueue
itself will be garbage collected after this call.- Specified by:
clearIgnoringIndexes
in interfacePriorityQueue<T>
-
equals
- Specified by:
equals
in interfaceCollection<T>
- Overrides:
equals
in classObject
-
hashCode
public int hashCode()- Specified by:
hashCode
in interfaceCollection<T>
- Overrides:
hashCode
in classObject
-
offer
-
remove
-
poll
-
element
-
peek
-
toString
-