Package at.jku.ssw.fp.sect04_4.cmd_nofp
Class AddTextCommand
- java.lang.Object
-
- at.jku.ssw.fp.sect04_4.cmd_nofp.AddTextCommand
-
-
Field Summary
Fields Modifier and Type Field Description private int
pos
The position where the text is added.private StringBuilder
text
The string builder where the text is added.private String
textToAdd
The text to add.
-
Constructor Summary
Constructors Constructor Description AddTextCommand(StringBuilder text, int pos, String textToAdd)
Constructor setting string builder, position and text.
-
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 added.
-
pos
private final int pos
The position where the text is added.
-
textToAdd
private final String textToAdd
The text to add.
-
-
Constructor Detail
-
AddTextCommand
public AddTextCommand(StringBuilder text, int pos, String textToAdd)
Constructor setting string builder, position and text.- Parameters:
text
- The string builder where the text should be addedpos
- The position where the text should be addedtextToAdd
- The text to add
-
-