|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object nz.ac.waikato.jdsl.core.ref.HashtableDecorable nz.ac.waikato.jdsl.core.ref.NodeBinaryTree.NBTNode nz.ac.waikato.jdsl.core.ref.NodeBinaryTree.NBTSuperNode
protected static class NodeBinaryTree.NBTSuperNode
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
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 nz.ac.waikato.jdsl.core.ref.NodeBinaryTree.NBTNode |
---|
isLeftChild, setContainer, setLeft, setParent, setRight, toString |
Methods inherited from class nz.ac.waikato.jdsl.core.ref.HashtableDecorable |
---|
attributes, 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 nz.ac.waikato.jdsl.core.api.Decorable |
---|
attributes, destroy, get, has, set |
Constructor Detail |
---|
protected NodeBinaryTree.NBTSuperNode(NodeBinaryTree t, NodeBinaryTree.NBTNode root)
Method Detail |
---|
protected void setRoot(NodeBinaryTree.NBTNode root)
root
- The new rootprotected void setChild(NodeBinaryTree.NBTNode currchild, NodeBinaryTree.NBTNode newchild)
setChild
in class NodeBinaryTree.NBTNode
currchild
- The node to replace; hopefully the rootnewchild
- The new rootprotected NodeBinaryTree container()
NodeBinaryTree.NBTNode
container
in class NodeBinaryTree.NBTNode
public java.lang.Object element()
element
in interface Accessor
element
in class NodeBinaryTree.NBTNode
protected boolean isValid()
protected NodeBinaryTree.NBTNode parent()
parent
in class NodeBinaryTree.NBTNode
protected NodeBinaryTree.NBTNode left()
left
in class NodeBinaryTree.NBTNode
protected NodeBinaryTree.NBTNode right()
right
in class NodeBinaryTree.NBTNode
protected NodeBinaryTree.NBTNode otherChild(NodeBinaryTree.NBTNode child)
otherChild
in class NodeBinaryTree.NBTNode
child
- of my children
protected boolean isInternal()
isInternal
in class NodeBinaryTree.NBTNode
protected void setLeft()
protected void setRight()
protected void setParent()
protected void makeUncontained()
makeUncontained
in class NodeBinaryTree.NBTNode
protected void expand()
expand
in class NodeBinaryTree.NBTNode
protected void removeSelfAndAbove()
removeSelfAndAbove
in class NodeBinaryTree.NBTNode
protected void replaceSelf(NodeBinaryTree.NBTNode x)
replaceSelf
in class NodeBinaryTree.NBTNode
x
- the node to replace me withprotected void swapWithNode(NodeBinaryTree.NBTNode x)
protected java.lang.Object replaceElement(java.lang.Object x)
replaceElement
in class NodeBinaryTree.NBTNode
x
- my new element
protected boolean isSuperNode()
isSuperNode
in class NodeBinaryTree.NBTNode
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |