Class UndoTree<T>


  • public class UndoTree<T>
    extends java.lang.Object
    Simple undo tree. Note that the first added state can't be undone
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      private class  UndoTree.Node  
    • Constructor Summary

      Constructors 
      Constructor Description
      UndoTree​(java.util.function.Consumer<T> s)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean canRedo()  
      boolean canUndo()  
      void clear()  
      void newState​(T state)  
      void redo()  
      void undo()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • UndoTree

        public UndoTree​(java.util.function.Consumer<T> s)
    • Method Detail

      • clear

        public void clear()
      • newState

        public void newState​(T state)
      • canUndo

        public boolean canUndo()
      • canRedo

        public boolean canRedo()
      • undo

        public void undo()
      • redo

        public void redo()