Package org.apache.hadoop.hbase.util
Class AvlUtil.AvlIterableList
java.lang.Object
org.apache.hadoop.hbase.util.AvlUtil.AvlIterableList
- Enclosing class:
- AvlUtil
Helper class that allows to create and manipulate a linked list of AvlLinkedNodes
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <TNode extends AvlUtil.AvlLinkedNode>
TNodeappend(TNode head, TNode node) Append a node to the treestatic <TNode extends AvlUtil.AvlLinkedNode>
TNodeappendList(TNode head, TNode otherHead) Append a list of nodes to the treestatic <TNode extends AvlUtil.AvlLinkedNode>
booleanisLinked(TNode node) Return true if the node is linked to a list, false otherwisestatic <TNode extends AvlUtil.AvlLinkedNode>
TNodeprepend(TNode head, TNode node) Prepend a node to the treestatic <TNode extends AvlUtil.AvlLinkedNode>
TNodeprepend(TNode head, TNode base, TNode node) Prepend a node to the tree before a specific nodestatic <TNode extends AvlUtil.AvlLinkedNode>
TNodereadNext(TNode node) Return the successor of the current nodestatic <TNode extends AvlUtil.AvlLinkedNode>
TNodereadPrev(TNode node) Return the predecessor of the current nodestatic <TNode extends AvlUtil.AvlLinkedNode>
TNoderemove(TNode head, TNode node) Remove a node from the tree
-
Constructor Details
-
AvlIterableList
public AvlIterableList()
-
-
Method Details
-
readNext
Return the successor of the current node- Parameters:
node- the current node- Returns:
- the successor of the current node
-
readPrev
Return the predecessor of the current node- Parameters:
node- the current node- Returns:
- the predecessor of the current node
-
prepend
Prepend a node to the tree- Parameters:
head- the head of the linked listnode- the node to add to the front of the list- Returns:
- the new head of the list
-
append
Append a node to the tree- Parameters:
head- the head of the linked listnode- the node to add to the tail of the list- Returns:
- the new head of the list
-
appendList
Append a list of nodes to the tree- Parameters:
head- the head of the current linked listotherHead- the head of the list to append to the current list- Returns:
- the new head of the current list
-
remove
Remove a node from the tree- Parameters:
head- the head of the linked listnode- the node to remove from the list- Returns:
- the new head of the list
-
prepend
public static <TNode extends AvlUtil.AvlLinkedNode> TNode prepend(TNode head, TNode base, TNode node) Prepend a node to the tree before a specific node- Parameters:
head- the head of the linked listbase- the node which we want to add thenodebefore itnode- the node which we want to add it before thebasenode
-
isLinked
Return true if the node is linked to a list, false otherwise
-