Class AbstractAction

java.lang.Object
com.j3d.engine.react.actions.AbstractAction
All Implemented Interfaces:
Action<Void>, VoidAction
Direct Known Subclasses:
ConstructorAction

public abstract class AbstractAction extends Object implements VoidAction
AbstractAction is an abstract class that implements the Action interface with default behaviors.
  • Field Details

  • Constructor Details

    • AbstractAction

      public AbstractAction()
  • Method Details

    • run

      public Void run()
      Description copied from interface: Action
      Executes the action.
      Specified by:
      run in interface Action<Void>
      Returns:
      The result of the action.
    • undo

      public void undo()
      Description copied from interface: Action
      Undoes the action.
      Specified by:
      undo in interface Action<Void>
    • isReversible

      public boolean isReversible()
      Description copied from interface: Action
      Checks if the action is reversible.
      Specified by:
      isReversible in interface Action<Void>
      Returns:
      true if the action can be undone, false otherwise.
    • getDescription

      public String getDescription()
      Description copied from interface: Action
      Provides a description of the action. This description is printed to both the debug console and the history log (UI).
      Specified by:
      getDescription in interface Action<Void>
      Returns:
      A string describing the action.
    • getTime

      public LocalTime getTime()
      Description copied from interface: Action
      Returns the time at which the action was performed.
      Specified by:
      getTime in interface Action<Void>
      Returns:
      The time of the action.