Class DeleteTextCommand

  • All Implemented Interfaces:
    Command

    public class DeleteTextCommand
    extends Object
    implements Command
    Command to delete a text.
    Author:
    Herbert Prähofer
    • Field Detail

      • text

        private final StringBuilder text
        The string builder where the text is deleted.
      • pos

        private final int pos
        The position where the text is deleted.
      • length

        private final int length
        The length of the text to delete.
      • textDeleted

        private final String textDeleted
        The deleted text.
    • Constructor Detail

      • DeleteTextCommand

        public DeleteTextCommand​(StringBuilder text,
                                 int pos,
                                 int length)
        Constructor setting string builder, position and length of the text to delete.
        Parameters:
        text - The string builder where the text should be deleted
        pos - The position where the text should be deleted
        length - The length of the text to delete
    • Method Detail

      • doCmd

        public void doCmd()
        Executes the command.
        Specified by:
        doCmd in interface Command
      • undoCmd

        public void undoCmd()
        Undoes the command.
        Specified by:
        undoCmd in interface Command