Package at.jku.ssw.fp.sect04_4.cmd_nofp
Class DeleteTextCommand
- java.lang.Object
-
- at.jku.ssw.fp.sect04_4.cmd_nofp.DeleteTextCommand
-
-
Field Summary
Fields Modifier and Type Field Description private int
length
The length of the text to delete.private int
pos
The position where the text is deleted.private StringBuilder
text
The string builder where the text is deleted.private String
textDeleted
The deleted text.
-
Constructor Summary
Constructors Constructor Description DeleteTextCommand(StringBuilder text, int pos, int length)
Constructor setting string builder, position and length of the text to delete.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doCmd()
Executes the command.void
undoCmd()
Undoes the command.
-
-
-
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 deletedpos
- The position where the text should be deletedlength
- The length of the text to delete
-
-