Class DoubleLinkedList<T extends DoubleLinkedListNode>
java.lang.Object
org.apache.commons.jcs3.utils.struct.DoubleLinkedList<T>
This is a generic thread safe double linked list. It's very simple and all the operations are so
quick that course grained synchronization is more than acceptable.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a new node to the start of the link list.void
Adds a new node to the end of the link list.void
Dump the cache entries from first to list for debugging.getFirst()
Removes the specified node from the link list.getLast()
Returns the last node from the link list, if there are any nodes.void
Moves an existing node to the start of the link list.void
Moves an existing node to the end of the link list.boolean
Removes the specified node from the link list.void
Remove all of the elements from the linked list implementation.Removes the specified node from the link list.int
size()
Returns the size of the list.
-
Constructor Details
-
DoubleLinkedList
public DoubleLinkedList()Default constructor.
-
-
Method Details
-
addLast
Adds a new node to the end of the link list.- Parameters:
me
- The feature to be added to the Last
-
addFirst
Adds a new node to the start of the link list.- Parameters:
me
- The feature to be added to the First
-
getLast
Returns the last node from the link list, if there are any nodes.- Returns:
- The last node.
-
getFirst
Removes the specified node from the link list.- Returns:
- DoubleLinkedListNode, the first node.
-
makeFirst
Moves an existing node to the start of the link list.- Parameters:
ln
- The node to set as the head.
-
makeLast
Moves an existing node to the end of the link list.- Parameters:
ln
- The node to set as the head.
-
removeAll
Remove all of the elements from the linked list implementation. -
remove
Removes the specified node from the link list.- Parameters:
me
- Description of the Parameter- Returns:
- true if an element was removed.
-
removeLast
Removes the specified node from the link list.- Returns:
- The last node if there was one to remove.
-
size
Returns the size of the list.- Returns:
- int
-
debugDumpEntries
Dump the cache entries from first to list for debugging.
-