edu.princeton.cs.algs4.growingtree.experiments
Class RotationHeightLogger<P extends NodeProperties>

java.lang.Object
  extended by edu.princeton.cs.algs4.growingtree.experiments.RotationHeightLogger<P>
All Implemented Interfaces:
IExperimentLogger<P>

public class RotationHeightLogger<P extends NodeProperties>
extends java.lang.Object
implements IExperimentLogger<P>


Field Summary
 
Fields inherited from interface edu.princeton.cs.algs4.growingtree.experiments.IExperimentLogger
HEIGHT_UPDATE, SIZE_UPDATE
 
Constructor Summary
RotationHeightLogger()
           
 
Method Summary
 void logDeletion(ShadowNode<P> n)
          Called on IDeletingNode.predecessorHibbardDelete and IDeletingNode.successorHibbardDelete PRIOR to the actual deletion.
 void logInsertion(ShadowNode<P> n)
          Called on IInsertNode.insertLeft and IInsertNode.insertRight
 void logOther(IAlgorithmNode<P> n, int eventId)
          Catch-all logging function for anything missed by the others.
 void logRotation(ShadowNode<P> n)
          Called on IAlgorithmNode.rotateLeft and IAlgorithmNode.rotateRight PRIOR to the actual rotation.
 void logSearchHit(ShadowNode<P> n)
          Called on ISearchingNode.markFound
 void printCounts()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RotationHeightLogger

public RotationHeightLogger()
Method Detail

printCounts

public void printCounts()

logDeletion

public void logDeletion(ShadowNode<P> n)
Description copied from interface: IExperimentLogger
Called on IDeletingNode.predecessorHibbardDelete and IDeletingNode.successorHibbardDelete PRIOR to the actual deletion.

Specified by:
logDeletion in interface IExperimentLogger<P extends NodeProperties>
Parameters:
n - Node being deleted

logInsertion

public void logInsertion(ShadowNode<P> n)
Description copied from interface: IExperimentLogger
Called on IInsertNode.insertLeft and IInsertNode.insertRight

Specified by:
logInsertion in interface IExperimentLogger<P extends NodeProperties>
Parameters:
n - Node that was just inserted

logRotation

public void logRotation(ShadowNode<P> n)
Description copied from interface: IExperimentLogger
Called on IAlgorithmNode.rotateLeft and IAlgorithmNode.rotateRight PRIOR to the actual rotation.

Specified by:
logRotation in interface IExperimentLogger<P extends NodeProperties>
Parameters:
n - Node is being rotated down the tree

logSearchHit

public void logSearchHit(ShadowNode<P> n)
Description copied from interface: IExperimentLogger
Called on ISearchingNode.markFound

Specified by:
logSearchHit in interface IExperimentLogger<P extends NodeProperties>
Parameters:
n - Node that has been found

logOther

public void logOther(IAlgorithmNode<P> n,
                     int eventId)
Description copied from interface: IExperimentLogger
Catch-all logging function for anything missed by the others. Meant in part to be used by an actual operator if necessary.

Specified by:
logOther in interface IExperimentLogger<P extends NodeProperties>
Parameters:
n - Node being logged
eventId - Used to identify the event this call represents