changes in TextLogik.java

This commit is contained in:
schrom01
2021-11-11 14:42:44 +01:00
parent 2890840817
commit b0622643d4
+10 -3
View File
@@ -18,10 +18,10 @@ public class TextLogik {
switch (command[0]) {
case "ADD":
if (command.length == 1) {
text.add(TextInput.getTextInput());
checkIfSuccess(text.add(TextInput.getTextInput()));
} else if (isNumeric(command[1])) {
int line = Integer.parseInt(command[1]);
text.add(line, TextInput.getTextInput());
checkIfSuccess(text.add(line, TextInput.getTextInput()));
} else {
textOutput.errorInvalidCommand();
}
@@ -38,7 +38,14 @@ public class TextLogik {
}
break;
case "DUMMY":
text.dummy();
if (command.length == 1) {
checkIfSuccess(text.dummy());
} else if (isNumeric(command[1])) {
int line = Integer.parseInt(command[1]);
checkIfSuccess(text.dummy(line));
} else {
textOutput.errorInvalidCommand();
}
break;
case "EXIT":
break;