Package com.tangosol.util
Class AbstractSparseArray.Node<V>
- java.lang.Object
- 
- com.tangosol.util.AbstractSparseArray.Node<V>
 
- 
- All Implemented Interfaces:
- Serializable,- Cloneable
 - Direct Known Subclasses:
- PrimitiveSparseArray.PrimitiveNode,- SparseArray.ObjectNode
 - Enclosing class:
- AbstractSparseArray<V>
 
 protected abstract static class AbstractSparseArray.Node<V> extends Object implements Cloneable, Serializable An AVL tree node. This class is used only within the AbstractSparseArray class and its derivations.- See Also:
- Serialized Form
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected intbalanceThe AVL balance factor of the sub-tree.protected longkeyThe key of the node.protected AbstractSparseArray.Node<V>leftThe left child of this node.protected AbstractSparseArray.Node<V>parentThe parent of this node.protected AbstractSparseArray.Node<V>rightThe right child of this node.
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedNode()
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidadopt(AbstractSparseArray.Node<V> child, boolean fLeft)Adopt a child nodeAbstractSparseArray.Node<V>clone()Make a shallow copy of the node and its sub-nodes.abstract VgetValue()Get the value associated with the node.protected booleanisLeaf()Determine if this node is a part of a 2-3-4 leaf node (i.e. at least one null child).protected booleanisLinked()Return true iff the node is linked to other nodes.protected voidprint()Print the tree structure.abstract VsetValue(V oValue)Set the value associated with the node.StringtoString()Provide a string representation of this node's value.protected intvalidate()Validate the tree rooted at node is a proper AVL tree.
 
- 
- 
- 
Field Detail- 
keyprotected long key The key of the node. The key, once set, is considered immutable.
 - 
parentprotected AbstractSparseArray.Node<V> parent The parent of this node.
 - 
leftprotected AbstractSparseArray.Node<V> left The left child of this node.
 - 
rightprotected AbstractSparseArray.Node<V> right The right child of this node.
 - 
balanceprotected int balance The AVL balance factor of the sub-tree.
 
- 
 - 
Method Detail- 
adoptprotected void adopt(AbstractSparseArray.Node<V> child, boolean fLeft) Adopt a child node- Parameters:
- child- the child to adopt
- fLeft- the position of the child
 
 - 
getValuepublic abstract V getValue() Get the value associated with the node.- Returns:
- the value associated with the node.
 
 - 
setValuepublic abstract V setValue(V oValue) Set the value associated with the node.- Parameters:
- oValue- the value associated with the node
- Returns:
- the old value associated with the node
 
 - 
toStringpublic String toString() Provide a string representation of this node's value.
 - 
clonepublic AbstractSparseArray.Node<V> clone() Make a shallow copy of the node and its sub-nodes.
 - 
isLeafprotected boolean isLeaf() Determine if this node is a part of a 2-3-4 leaf node (i.e. at least one null child).- Returns:
- true if this node is a leaf
 
 - 
isLinkedprotected boolean isLinked() Return true iff the node is linked to other nodes.- Returns:
- true iff the node has a parent or children
 
 - 
printprotected void print() Print the tree structure.
 - 
validateprotected int validate() Validate the tree rooted at node is a proper AVL tree.- Returns:
- the height of the node within the tree
 
 
- 
 
-