Skip navigation links

Oracle® Coherence Java API Reference
Release 3.6.0.0

E15725-01


com.tangosol.util
Class AbstractSparseArray.Node

java.lang.Object
  extended by com.tangosol.util.AbstractSparseArray.Node

All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
PrimitiveSparseArray.PrimitiveNode, SparseArray.ObjectNode
Enclosing class:
AbstractSparseArray

protected abstract static class AbstractSparseArray.Node
extends Object
implements Cloneable, Serializable

An AVL tree node. This class is used only within the AbstractSparseArray class and its derivations.


Field Summary
protected  int balance
          The AVL balance factor of the sub-tree.
protected  long key
          The key of the node.
protected  AbstractSparseArray.Node left
          The left child of this node.
protected  AbstractSparseArray.Node parent
          The parent of this node.
protected  AbstractSparseArray.Node right
          The right child of this node.

 

Constructor Summary
protected AbstractSparseArray.Node()
           

 

Method Summary
protected  void adopt(AbstractSparseArray.Node child, boolean fLeft)
          Adopt a child node
 Object clone()
          Make a shallow copy of the node and its sub-nodes.
abstract  Object getValue()
          Get the value associated with the node.
protected  boolean isLeaf()
          Determine if this node is a part of a 2-3-4 leaf node (i.e. at least one null child).
protected  boolean isLinked()
          Return true iff the node is linked to other nodes.
protected  void print()
          Print the tree structure.
abstract  Object setValue(Object oValue)
          Set the value associated with the node.
 String toString()
          Provide a string representation of this node's value.
protected  int validate()
          Validate the tree rooted at node is a proper AVL tree.

 

Field Detail

key

protected long key
The key of the node. The key, once set, is considered immutable.

parent

protected AbstractSparseArray.Node parent
The parent of this node.

left

protected AbstractSparseArray.Node left
The left child of this node.

right

protected AbstractSparseArray.Node right
The right child of this node.

balance

protected int balance
The AVL balance factor of the sub-tree.

Constructor Detail

AbstractSparseArray.Node

protected AbstractSparseArray.Node()

Method Detail

adopt

protected void adopt(AbstractSparseArray.Node child,
                     boolean fLeft)
Adopt a child node
Parameters:
child - the child to adopt
fLeft - the position of the child

getValue

public abstract Object getValue()
Get the value associated with the node.
Returns:
the value associated with the node.

setValue

public abstract Object setValue(Object oValue)
Set the value associated with the node.
Parameters:
oValue - the value assocaited with the node
Returns:
the old value associated with the node

toString

public String toString()
Provide a string representation of this node's value.

clone

public Object clone()
Make a shallow copy of the node and its sub-nodes.

isLeaf

protected 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

isLinked

protected boolean isLinked()
Return true iff the node is linked to other nodes.
Returns:
true iff the node has a parent or children

print

protected void print()
Print the tree structure.

validate

protected int validate()
Validate the tree rooted at node is a proper AVL tree.
Returns:
the height of the node within the tree

Skip navigation links

Oracle® Coherence Java API Reference
Release 3.6.0.0

E15725-01


Copyright © 2000, 2010, Oracle and/or its affiliates. All rights reserved.