AlgorithmStage.java 859 B

12345678910111213141516171819202122232425262728293031323334353637
  1. package animation;
  2. import bk.BlockCalc;
  3. /**
  4. * Represents a specific stage of the algorithm.
  5. * Example calculating the blocks, see {@link BlockCalc}.
  6. *
  7. * @author kolja
  8. *
  9. */
  10. public interface AlgorithmStage {
  11. /**
  12. * Indicates whether the whole stage is finished.
  13. * @author kolja
  14. *
  15. */
  16. public static enum StageStatus
  17. {
  18. UNFINISHED,
  19. FINISHED
  20. }
  21. /**
  22. * perform one atomic step of the algorithm
  23. * @return whether the whole stage is finished.
  24. * For example if all steps are reverted, then {@code FINISHED} is returned.
  25. */
  26. public StageStatus forwardStep();
  27. /**
  28. * undo one atomic step of the algorithm
  29. * @return whether the whole stage is finished in backwards direction.
  30. * For example if all steps are reverted, then {@code FINISHED} is returned.
  31. */
  32. public StageStatus backwardStep();
  33. }