Class LinkedListImpl<E>
- java.lang.Object
-
- org.apache.activemq.artemis.utils.collections.LinkedListImpl<E>
-
- All Implemented Interfaces:
LinkedList<E>
public class LinkedListImpl<E> extends Object implements LinkedList<E>
A linked list implementation which allows multiple iterators to exist at the same time on the queue, and which see any elements added or removed from the queue either directly or via iterators.This class is not thread safe.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLinkedListImpl.Node<E>
-
Constructor Summary
Constructors Constructor Description LinkedListImpl()LinkedListImpl(Comparator<E> comparator)LinkedListImpl(Comparator<E> comparator, NodeStore<E> supplier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddHead(E e)voidaddSorted(E e)protected booleanaddSortedScan(E e)voidaddTail(E e)voidclear()voidclearID()voidforEach(Consumer<E> consumer)Eget(int position)LinkedListIterator<E>iterator()intnumIters()Epeek()Epoll()EremoveWithID(String listID, long id)you need to callLinkedList.setNodeStore(NodeStore)before you are able to call this method.protected booleanscanLeft(LinkedListImpl.Node<E> position, E e)protected booleanscanRight(LinkedListImpl.Node<E> position, E e)voidsetNodeStore(NodeStore<E> supplier)this makes possibl to useLinkedList.removeWithID(String, long)intsize()StringtoString()
-
-
-
Constructor Detail
-
LinkedListImpl
public LinkedListImpl()
-
LinkedListImpl
public LinkedListImpl(Comparator<E> comparator)
-
LinkedListImpl
public LinkedListImpl(Comparator<E> comparator, NodeStore<E> supplier)
-
-
Method Detail
-
clearID
public void clearID()
- Specified by:
clearIDin interfaceLinkedList<E>
-
setNodeStore
public void setNodeStore(NodeStore<E> supplier)
Description copied from interface:LinkedListthis makes possibl to useLinkedList.removeWithID(String, long)- Specified by:
setNodeStorein interfaceLinkedList<E>
-
addHead
public void addHead(E e)
- Specified by:
addHeadin interfaceLinkedList<E>
-
peek
public E peek()
- Specified by:
peekin interfaceLinkedList<E>
-
get
public E get(int position)
- Specified by:
getin interfaceLinkedList<E>
-
removeWithID
public E removeWithID(String listID, long id)
Description copied from interface:LinkedListyou need to callLinkedList.setNodeStore(NodeStore)before you are able to call this method.- Specified by:
removeWithIDin interfaceLinkedList<E>
-
forEach
public void forEach(Consumer<E> consumer)
- Specified by:
forEachin interfaceLinkedList<E>
-
addTail
public void addTail(E e)
- Specified by:
addTailin interfaceLinkedList<E>
-
addSorted
public void addSorted(E e)
-
scanRight
protected boolean scanRight(LinkedListImpl.Node<E> position, E e)
-
scanLeft
protected boolean scanLeft(LinkedListImpl.Node<E> position, E e)
-
addSortedScan
protected boolean addSortedScan(E e)
-
poll
public E poll()
- Specified by:
pollin interfaceLinkedList<E>
-
clear
public void clear()
- Specified by:
clearin interfaceLinkedList<E>
-
size
public int size()
- Specified by:
sizein interfaceLinkedList<E>
-
iterator
public LinkedListIterator<E> iterator()
- Specified by:
iteratorin interfaceLinkedList<E>
-
numIters
public int numIters()
-
-