package edu.princeton.cs.algs4.growingtree.experiments; import edu.princeton.cs.algs4.growingtree.framework.NodeProperties; import edu.princeton.cs.algs4.growingtree.framework.ShadowNode; import edu.princeton.cs.algs4.growingtree.interfaces.IAlgorithmNode; import edu.princeton.cs.algs4.growingtree.interfaces.INode; /** * This class provides the ability to log events in a series * of operations. When added to a TreeVisualization * or TreeExperiment, it receives callbacks for * each event. * @author Josh Israel * * @param

*/ public interface IExperimentLogger

{ /** * event_id for logOther call for height changing */ public static final int HEIGHT_UPDATE = 0; /** * event_id for logOther call for size changing */ public static final int SIZE_UPDATE = 1; /** * Called on IInsertNode.insertLeft * and IInsertNode.insertRight * @param n Node that was just inserted */ public void logInsertion(ShadowNode

n); /** * Called on IAlgorithmNode.rotateLeft * and IAlgorithmNode.rotateRight PRIOR * to the actual rotation. * @param n Node is being rotated down the tree */ public void logRotation(ShadowNode

n); /** * Called on IDeletingNode.predecessorHibbardDelete * and IDeletingNode.successorHibbardDelete PRIOR * to the actual deletion. * @param n Node being deleted */ public void logDeletion(ShadowNode

n); /** * Called on ISearchingNode.markFound * @param n Node that has been found */ public void logSearchHit(ShadowNode

n); /** * Catch-all logging function for anything missed by the others. * Meant in part to be used by an actual operator if necessary. * @param n Node being logged * @param event_id Used to identify the event this call represents */ public void logOther(IAlgorithmNode

n, int event_id); }