Class PriorityLinkedListImpl<E>
java.lang.Object
org.apache.activemq.artemis.utils.collections.PriorityLinkedListImpl<E>
- All Implemented Interfaces:
PriorityLinkedList<E>
A priority linked list implementation
It implements this by maintaining an individual LinkedBlockingDeque for each priority level.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPriorityLinkedListImpl(int priorities) PriorityLinkedListImpl(int priorities, Comparator<E> comparator) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidvoidclear()booleanisEmpty()Returnstrueif empty,falseotherwise; safe to be called concurrently.iterator()peek()just look at the first element on the listpoll()protected voidremoveWithID(String listID, long id) voidsetNodeStore(Supplier<NodeStore<E>> supplier) intsize()Returns the size of this list; safe to be called concurrently.
-
Field Details
-
levels
-
-
Constructor Details
-
PriorityLinkedListImpl
public PriorityLinkedListImpl(int priorities) -
PriorityLinkedListImpl
-
-
Method Details
-
removed
-
addHead
- Specified by:
addHeadin interfacePriorityLinkedList<E>
-
addTail
- Specified by:
addTailin interfacePriorityLinkedList<E>
-
addSorted
- Specified by:
addSortedin interfacePriorityLinkedList<E>
-
setNodeStore
- Specified by:
setNodeStorein interfacePriorityLinkedList<E>- See Also:
-
removeWithID
- Specified by:
removeWithIDin interfacePriorityLinkedList<E>
-
peek
Description copied from interface:PriorityLinkedListjust look at the first element on the list- Specified by:
peekin interfacePriorityLinkedList<E>
-
poll
- Specified by:
pollin interfacePriorityLinkedList<E>
-
clear
public void clear()- Specified by:
clearin interfacePriorityLinkedList<E>
-
size
public int size()Description copied from interface:PriorityLinkedListReturns the size of this list; safe to be called concurrently.- Specified by:
sizein interfacePriorityLinkedList<E>- Returns:
- the size of this list; safe to be called concurrently
-
isEmpty
public boolean isEmpty()Description copied from interface:PriorityLinkedListReturnstrueif empty,falseotherwise; safe to be called concurrently.- Specified by:
isEmptyin interfacePriorityLinkedList<E>- Returns:
trueif empty,falseotherwise; safe to be called concurrently
-
iterator
- Specified by:
iteratorin interfacePriorityLinkedList<E>
-