| Modifier and Type | Class and Description |
|---|---|
protected class |
DoublyLinkedList.DoublyLinkedListIterator
Iterator used for iterating the doubly linked list
Only used for iterating the list when retrieving the topK or bottomK values
|
| Constructor and Description |
|---|
DoublyLinkedList() |
| Modifier and Type | Method and Description |
|---|---|
void |
addAfterLast(ListNode<T> node)
Add a node after the last node in the list
|
ListNode<T> |
addAfterLast(T value)
Add a node with value after the last node in the list
|
void |
addAfterNode(ListNode<T> node,
ListNode<T> newNode)
Add a node after the node specified
|
ListNode<T> |
addAfterNode(ListNode<T> node,
T value)
Add a node with value after the node specified
|
void |
addBeforeFirst(ListNode<T> node)
Add a node before the first node in the list
|
ListNode<T> |
addBeforeFirst(T value)
Add a node with value before the first node in the list
|
T |
first()
Return the value of the head of the doubly linked list
|
ListNode<T> |
head()
Return the head of the doubly linked list
|
boolean |
isEmpty()
Return a boolean indicating whether the list is empty
|
Iterator<T> |
iterator()
Return an iterator that can be used to iterate the doubly linked list
|
T |
last()
Return the value of the tail of the doubly linked list
|
void |
remove(ListNode<T> node)
Remove the specified node from the list
|
int |
size()
Return the size of the doubly linked list
|
ListNode<T> |
tail()
Return the tail of the doubly linked list
|
public ListNode<T> addAfterLast(T value)
value - The value of the node to be added as the last node of the listpublic void addAfterLast(ListNode<T> node)
node - The node to be added as the last node of the listpublic ListNode<T> addBeforeFirst(T value)
value - The value of the node to be added as the first node of the listpublic void addBeforeFirst(ListNode<T> node)
node - The node to be added as the first node of the listpublic ListNode<T> addAfterNode(ListNode<T> node, T value)
node - The node after which the new node should be addedvalue - The value of the node to be addedpublic void addAfterNode(ListNode<T> node, ListNode<T> newNode)
node - The node after which the new node should be addednewNode - The node to be addedpublic void remove(ListNode<T> node)
node - The node to be removedpublic int size()
public T first()
public T last()
public ListNode<T> head()
public ListNode<T> tail()
public boolean isEmpty()
Copyright © 2017 WSO2. All rights reserved.