org.apache.batik.util
public class DoublyLinkedList extends Object
Nested Class Summary | |
---|---|
static class | DoublyLinkedList.Node
Basic doubly linked list node interface. |
Constructor Summary | |
---|---|
DoublyLinkedList() |
Method Summary | |
---|---|
void | add(int index, DoublyLinkedList.Node nde) |
void | add(DoublyLinkedList.Node nde)
Adds nde to the head of the list.
|
void | empty()
Removes all elements from the list. |
DoublyLinkedList.Node | getHead()
Get the current head element |
int | getSize()
Returns the number of elements currently in the list. |
DoublyLinkedList.Node | getTail()
Get the current tail element |
DoublyLinkedList.Node | pop()
Removes 'head' from list and returns it. |
void | push(DoublyLinkedList.Node nde)
Adds nde to tail of list |
void | remove(DoublyLinkedList.Node nde)
Removes nde from the list it is part of (should be this
one, otherwise results are undefined). |
void | touch(DoublyLinkedList.Node nde)
Moves nde to the head of the list (equivilent to
remove(nde); add(nde); but faster. |
void | unpop(DoublyLinkedList.Node nde)
Adds nde to head of list |
DoublyLinkedList.Node | unpush()
Removes 'tail' from list and returns it. |
Parameters: nde the node to add to the list.
Returns: The current 'first' element in list.
Returns: The current 'last' element in list.
Returns: current head element, next element becomes head.
Parameters: nde node to remove.
Returns: current tail element.