jdsl.core.ref
Class NodeBinaryTree.NBTSuperNode

java.lang.Object
  |
  +--jdsl.core.ref.HashtableDecorable
        |
        +--jdsl.core.ref.NodeBinaryTree.NBTNode
              |
              +--jdsl.core.ref.NodeBinaryTree.NBTSuperNode
All Implemented Interfaces:
Accessor, Decorable, Position, java.io.Serializable
Enclosing class:
NodeBinaryTree

protected static class NodeBinaryTree.NBTSuperNode
extends NodeBinaryTree.NBTNode

This is the supernode. There is one instance per tree, useful mainly so that container() calls can recur polymorphically up the tree Protected so subclasses can access it

See Also:
Serialized Form

Constructor Summary
protected NodeBinaryTree.NBTSuperNode(NodeBinaryTree t, NodeBinaryTree.NBTNode root)
          Constructs the super node with its tree and root
 
Method Summary
protected  NodeBinaryTree container()
          O(1) time
 java.lang.Object element()
          Should never be called
protected  void expand()
          Should never be called
protected  boolean isInternal()
          Should never be called
protected  boolean isSuperNode()
          Used to determine if this node is the super node (overridden)
protected  boolean isValid()
          Should never be called
protected  NodeBinaryTree.NBTNode left()
          Should never be called
protected  void makeUncontained()
          Should never be called
protected  NodeBinaryTree.NBTNode otherChild(NodeBinaryTree.NBTNode child)
          Should never be called
protected  NodeBinaryTree.NBTNode parent()
          Should never be called
protected  void removeSelfAndAbove()
          Should never be called
protected  java.lang.Object replaceElement(java.lang.Object x)
          Should never be called
protected  void replaceSelf(NodeBinaryTree.NBTNode x)
          Should never be called
protected  NodeBinaryTree.NBTNode right()
          Should never be called
protected  void setChild(NodeBinaryTree.NBTNode currchild, NodeBinaryTree.NBTNode newchild)
          O(1) time Sets this node's root; any other use of this method is invalid
protected  void setLeft()
          Should never be called
protected  void setParent()
          Should never be called
protected  void setRight()
          Should never be called
protected  void setRoot(NodeBinaryTree.NBTNode root)
          O(1) time Sets this node's root
protected  void swapWithNode(NodeBinaryTree.NBTNode x)
          Should never be called
 
Methods inherited from class jdsl.core.ref.NodeBinaryTree.NBTNode
isLeftChild, setContainer, setLeft, setParent, setRight, toString
 
Methods inherited from class jdsl.core.ref.HashtableDecorable
capacity, destroy, get, has, hash, rehash, set, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jdsl.core.api.Decorable
destroy, get, has, set
 

Constructor Detail

NodeBinaryTree.NBTSuperNode

protected NodeBinaryTree.NBTSuperNode(NodeBinaryTree t,
                                      NodeBinaryTree.NBTNode root)
Constructs the super node with its tree and root
Method Detail

setRoot

protected void setRoot(NodeBinaryTree.NBTNode root)
O(1) time Sets this node's root
Parameters:
root - The new root

setChild

protected void setChild(NodeBinaryTree.NBTNode currchild,
                        NodeBinaryTree.NBTNode newchild)
O(1) time Sets this node's root; any other use of this method is invalid
Overrides:
setChild in class NodeBinaryTree.NBTNode
Parameters:
currchild - The node to replace; hopefully the root
newchild - The new root

container

protected NodeBinaryTree container()
Description copied from class: NodeBinaryTree.NBTNode
O(1) time
Overrides:
container in class NodeBinaryTree.NBTNode
Returns:
this node's container

element

public java.lang.Object element()
Should never be called
Overrides:
element in class NodeBinaryTree.NBTNode
Following copied from interface: jdsl.core.api.Accessor
Returns:
the element currently stored at this accessor

isValid

protected boolean isValid()
Should never be called

parent

protected NodeBinaryTree.NBTNode parent()
Should never be called
Overrides:
parent in class NodeBinaryTree.NBTNode
Following copied from class: jdsl.core.ref.NodeBinaryTree.NBTNode
Returns:
this node's parent.

left

protected NodeBinaryTree.NBTNode left()
Should never be called
Overrides:
left in class NodeBinaryTree.NBTNode
Following copied from class: jdsl.core.ref.NodeBinaryTree.NBTNode
Returns:
this node's left child.

right

protected NodeBinaryTree.NBTNode right()
Should never be called
Overrides:
right in class NodeBinaryTree.NBTNode
Following copied from class: jdsl.core.ref.NodeBinaryTree.NBTNode
Returns:
this node's right child.

otherChild

protected NodeBinaryTree.NBTNode otherChild(NodeBinaryTree.NBTNode child)
Should never be called
Overrides:
otherChild in class NodeBinaryTree.NBTNode
Following copied from class: jdsl.core.ref.NodeBinaryTree.NBTNode
Parameters:
one - of my children
Returns:
my other child (asserts if the parameter isn't my child)

isInternal

protected boolean isInternal()
Should never be called
Overrides:
isInternal in class NodeBinaryTree.NBTNode
Following copied from class: jdsl.core.ref.NodeBinaryTree.NBTNode
Returns:
Whether or not this node is internal

setLeft

protected void setLeft()
Should never be called

setRight

protected void setRight()
Should never be called

setParent

protected void setParent()
Should never be called

makeUncontained

protected void makeUncontained()
Should never be called
Overrides:
makeUncontained in class NodeBinaryTree.NBTNode

expand

protected void expand()
Should never be called
Overrides:
expand in class NodeBinaryTree.NBTNode

removeSelfAndAbove

protected void removeSelfAndAbove()
Should never be called
Overrides:
removeSelfAndAbove in class NodeBinaryTree.NBTNode

replaceSelf

protected void replaceSelf(NodeBinaryTree.NBTNode x)
Should never be called
Overrides:
replaceSelf in class NodeBinaryTree.NBTNode
Following copied from class: jdsl.core.ref.NodeBinaryTree.NBTNode
Parameters:
newSubtree - the node to replace me with

swapWithNode

protected void swapWithNode(NodeBinaryTree.NBTNode x)
Should never be called

replaceElement

protected java.lang.Object replaceElement(java.lang.Object x)
Should never be called
Overrides:
replaceElement in class NodeBinaryTree.NBTNode
Following copied from class: jdsl.core.ref.NodeBinaryTree.NBTNode
Parameters:
newElement - my new element
Returns:
The element I used to contain

isSuperNode

protected boolean isSuperNode()
Used to determine if this node is the super node (overridden)
Overrides:
isSuperNode in class NodeBinaryTree.NBTNode