Class PriorityLinkedListImpl<E>
- java.lang.Object
-
- org.apache.activemq.artemis.utils.collections.PriorityLinkedListImpl<E>
-
- All Implemented Interfaces:
PriorityLinkedList<E>
public class PriorityLinkedListImpl<E> extends Object implements PriorityLinkedList<E>
A priority linked list implementationIt implements this by maintaining an individual LinkedBlockingDeque for each priority level.
-
-
Field Summary
Fields Modifier and Type Field Description protected LinkedListImpl<E>[]levels
-
Constructor Summary
Constructors Constructor Description PriorityLinkedListImpl(int priorities)PriorityLinkedListImpl(int priorities, Comparator<E> comparator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddHead(E e, int priority)voidaddSorted(E e, int priority)voidaddTail(E e, int priority)voidclear()booleanisEmpty()Returnstrueif empty,falseotherwise.
It is safe to be called concurrently.LinkedListIterator<E>iterator()Epeek()just look at the first element on the listEpoll()EremoveWithID(String listID, long id)voidsetNodeStore(NodeStore<E> supplier)intsize()Returns the size of this list.
It is safe to be called concurrently.
-
-
-
Field Detail
-
levels
protected final LinkedListImpl<E>[] levels
-
-
Constructor Detail
-
PriorityLinkedListImpl
public PriorityLinkedListImpl(int priorities)
-
PriorityLinkedListImpl
public PriorityLinkedListImpl(int priorities, Comparator<E> comparator)
-
-
Method Detail
-
addHead
public void addHead(E e, int priority)
- Specified by:
addHeadin interfacePriorityLinkedList<E>
-
addTail
public void addTail(E e, int priority)
- Specified by:
addTailin interfacePriorityLinkedList<E>
-
addSorted
public void addSorted(E e, int priority)
- Specified by:
addSortedin interfacePriorityLinkedList<E>
-
setNodeStore
public void setNodeStore(NodeStore<E> supplier)
- Specified by:
setNodeStorein interfacePriorityLinkedList<E>- See Also:
LinkedList.setNodeStore(NodeStore)
-
removeWithID
public E removeWithID(String listID, long id)
- Specified by:
removeWithIDin interfacePriorityLinkedList<E>
-
peek
public E peek()
Description copied from interface:PriorityLinkedListjust look at the first element on the list- Specified by:
peekin interfacePriorityLinkedList<E>
-
poll
public 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.
It is safe to be called concurrently.- Specified by:
sizein interfacePriorityLinkedList<E>
-
isEmpty
public boolean isEmpty()
Description copied from interface:PriorityLinkedListReturnstrueif empty,falseotherwise.
It is safe to be called concurrently.- Specified by:
isEmptyin interfacePriorityLinkedList<E>
-
iterator
public LinkedListIterator<E> iterator()
- Specified by:
iteratorin interfacePriorityLinkedList<E>
-
-