diff --git a/docs/Äquivalenzklassen.md b/docs/Äquivalenzklassen.md index 15d6ca6..83f7ba7 100644 --- a/docs/Äquivalenzklassen.md +++ b/docs/Äquivalenzklassen.md @@ -1,4 +1,4 @@ -#Äquivalenzklassen +#Equivalent ### Text.java Index method diff --git a/src/TextLogik.java b/src/TextLogik.java index 102e0b8..09e006b 100644 --- a/src/TextLogik.java +++ b/src/TextLogik.java @@ -1,5 +1,3 @@ -import java.util.ArrayList; - public class TextLogik { private final Text text; private final TextOutput textOutput; @@ -19,12 +17,10 @@ public class TextLogik { switch (command[0]) { case "ADD": - if (command.length == 1) { text.add(TextInput.getTextInput()); } else if (isNumeric(command[1])) { int line = Integer.parseInt(command[1]); - text.add(line, TextInput.getTextInput()); } else { textOutput.errorInvalidCommand(); @@ -57,7 +53,7 @@ public class TextLogik { break; case "INDEX": - ArrayList Index = text.index(); + textOutput.IndexOutput(text.index()); break; case "PRINT": @@ -94,4 +90,12 @@ public class TextLogik { return str.matches("\\d+"); } + private void checkIfSuccess(boolean method) { + if(method) { + textOutput.UserInfoOutput("Command was successfully"); + }else { + textOutput.errorInvalidParagraph(); + } + } + }