Class LinkedNode<T extends LinkedNode<T>>
java.lang.Object
org.apache.activemq.store.kahadb.disk.util.LinkedNode<T>
- Direct Known Subclasses:
DataFile,Journal.WriteCommand,Sequence
Provides a base class for you to extend when you want object to maintain a
doubly linked list to other objects without using a collection class.
- Author:
- chirino
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetList()getNext()booleanbooleanisLinked()booleanvoidlinkAfter(LinkedNodeList<T> rightList) voidvoidlinkBefore(LinkedNodeList<T> leftList) voidlinkBefore(T node) voidlinkToHead(LinkedNodeList<T> target) voidlinkToTail(LinkedNodeList<T> target) Splits the list into 2 lists.Splits the list into 2 lists.booleanunlink()Removes this node out of the linked list it is chained in.
-
Field Details
-
list
-
next
-
prev
-
-
Constructor Details
-
LinkedNode
public LinkedNode()
-
-
Method Details
-
getHeadNode
-
getTailNode
-
getNext
-
getPrevious
-
getNextCircular
-
getPreviousCircular
-
isHeadNode
public boolean isHeadNode() -
isTailNode
public boolean isTailNode() -
linkAfter
- Parameters:
node- the node to link after this node.
-
linkAfter
- Parameters:
rightList- the node to link after this node.
-
linkBefore
- Parameters:
node- the node to link after this node.
-
linkBefore
- Parameters:
leftList- the node to link after this node.
-
linkToTail
-
linkToHead
-
unlink
public boolean unlink()Removes this node out of the linked list it is chained in. -
splitAfter
Splits the list into 2 lists. This node becomes the tail of this list. Then 2nd list is returned.- Returns:
- An empty list if this is a tail node.
-
splitBefore
Splits the list into 2 lists. This node becomes the head of this list. Then 2nd list is returned.- Returns:
- An empty list if this is a head node.
-
isLinked
public boolean isLinked() -
getList
-