From b0622643d4bdd758e299adbbeeff8cf1f5b709bd Mon Sep 17 00:00:00 2001 From: schrom01 Date: Thu, 11 Nov 2021 14:42:44 +0100 Subject: [PATCH] changes in TextLogik.java --- src/TextLogik.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/TextLogik.java b/src/TextLogik.java index 09e006b..74e5ffa 100644 --- a/src/TextLogik.java +++ b/src/TextLogik.java @@ -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;