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

Type Parameters:
P -
All Superinterfaces:
java.lang.Comparable<INode<P>>, IAlgorithmNode<P>, INode<P>
All Known Implementing Classes:
ShadowNode

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

This interface is for use by an ISearchOperator to traverse the tree to find the node being sought. Some functions from IAlgorithmNode are redeclared here with return type ISearchingNode so as to avoid the need to cast in client code.

Author:
Josh Israel
See Also:
ISearchOperator

Method Summary
 ISearchingNode<P> getLeft()
           
 ISearchingNode<P> getParent()
           
 ISearchingNode<P> getRight()
           
 void markFound()
          This must be called on the node being sought in order to trigger the search animation.
 
Methods inherited from interface edu.princeton.cs.algs4.growingtree.interfaces.IAlgorithmNode
freeze, freeze, getPredecessor, getRoot, getSuccessor, rotateLeft, rotateRight
 
Methods inherited from interface edu.princeton.cs.algs4.growingtree.interfaces.INode
getLogger, getNodeProperties
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

getLeft

ISearchingNode<P> getLeft()
Specified by:
getLeft in interface IAlgorithmNode<P extends NodeProperties>

getRight

ISearchingNode<P> getRight()
Specified by:
getRight in interface IAlgorithmNode<P extends NodeProperties>

getParent

ISearchingNode<P> getParent()
Specified by:
getParent in interface IAlgorithmNode<P extends NodeProperties>

markFound

void markFound()
This must be called on the node being sought in order to trigger the search animation.