edu.princeton.cs.algs4.growingtree.interfaces
Interface IAlgorithmNode<P extends NodeProperties>

Type Parameters:
P - The NodeProperties class (or subclass) that these nodes are parameterized by.
All Superinterfaces:
java.lang.Comparable<INode<P>>, INode<P>
All Known Subinterfaces:
IDeletingNode<P>, IInsertingNode<P>, ISearchingNode<P>
All Known Implementing Classes:
ShadowNode

public interface IAlgorithmNode<P extends NodeProperties>
extends INode<P>

This interface declares the functions for traversing and manipulating trees that are accessible to all operators.

Author:
Josh Israel
See Also:
NodeProperties

Method Summary
 void freeze()
           
 void freeze(double delay)
          Freezes the animation briefly and displays the current state of the tree.
 IAlgorithmNode<P> getLeft()
           
 IAlgorithmNode<P> getParent()
           
 IAlgorithmNode<P> getPredecessor()
           
 IAlgorithmNode<P> getRight()
           
 IAlgorithmNode<P> getRoot()
           
 IAlgorithmNode<P> getSuccessor()
           
 IAlgorithmNode<P> rotateLeft()
          Rotates the left child up.
 IAlgorithmNode<P> rotateRight()
          Rotates the right child up.
 
Methods inherited from interface edu.princeton.cs.algs4.growingtree.interfaces.INode
getLogger, getNodeProperties
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

getParent

IAlgorithmNode<P> getParent()

getRoot

IAlgorithmNode<P> getRoot()

getLeft

IAlgorithmNode<P> getLeft()

getRight

IAlgorithmNode<P> getRight()

getSuccessor

IAlgorithmNode<P> getSuccessor()

getPredecessor

IAlgorithmNode<P> getPredecessor()

freeze

void freeze(double delay)
Freezes the animation briefly and displays the current state of the tree. This allows states between events like rotations to be displayed.


freeze

void freeze()

rotateLeft

IAlgorithmNode<P> rotateLeft()
Rotates the left child up.

Returns:
The new parent of the node (the former left child).

rotateRight

IAlgorithmNode<P> rotateRight()
Rotates the right child up.

Returns:
The new parent of the node (the former right child).