package animation; import javax.swing.JTree; import bk.BlockCalc; /** * Represents a specific stage of the algorithm. * Example calculating the blocks, see {@link BlockCalc}. * * @author kolja * */ public interface AlgorithmStage { /** * Indicates whether the whole stage is finished. * @author kolja * */ public static enum StageStatus { UNFINISHED, FINISHED } /** * perform one atomic step of the algorithm * @return whether the whole stage is finished. * For example if all steps are reverted, then {@code FINISHED} is returned. */ public StageStatus forwardStep(); public StageStatus forwardStepOver(); public StageStatus forwardStepOut(); /** * undo one atomic step of the algorithm * @return whether the whole stage is finished in backwards direction. * For example if all steps are reverted, then {@code FINISHED} is returned. */ public StageStatus backwardStep(); public StageStatus backwardStepOver(); public StageStatus backwardStepOut(); public PseudoCodeNode createPseudocodeTree( JTree tree ); }