From 230ff7f470b053f1f60eb3b3a2e5d505bdfcaeca Mon Sep 17 00:00:00 2001 From: Leonardo Brandenberger Date: Thu, 11 Nov 2021 15:10:58 +0100 Subject: [PATCH] added Javadocs to new methods --- src/TextLogik.java | 4 ++-- src/TextOutput.java | 18 +++++++++++++----- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/TextLogik.java b/src/TextLogik.java index 38a6aea..a6123d8 100644 --- a/src/TextLogik.java +++ b/src/TextLogik.java @@ -60,7 +60,7 @@ public class TextLogik { break; case "INDEX": - textOutput.IndexOutput(text.index()); + textOutput.indexOutput(text.index()); break; case "PRINT": @@ -98,7 +98,7 @@ public class TextLogik { private void checkIfSuccess(boolean method) { if(method) { - textOutput.UserInfoOutput("Command was successfully"); + textOutput.userInfoOutput("Command was successfully"); }else { textOutput.errorInvalidParagraph(); } diff --git a/src/TextOutput.java b/src/TextOutput.java index c60cbbc..890794d 100644 --- a/src/TextOutput.java +++ b/src/TextOutput.java @@ -108,6 +108,8 @@ public class TextOutput { /** * Method which sets the Variable formatRaw to true. + * + * @return true to indicate that it was successful. */ public boolean formatRaw() { formatRaw = true; @@ -118,7 +120,8 @@ public class TextOutput { * Method to set the formatRaw to false and also set the length of the desired paragraph length in order to limit * the paragraph length when printing the text. * - * @param length the maximum length of each paragraph that is allowed to be displayed when printing the text. + * @param length the paragraph length when printing the text. + * @return returns true if successful and false if and invalid length has been submitted. */ public boolean formatFix(int length) { if(length > 0) { @@ -132,15 +135,20 @@ public class TextOutput { } /** - * Methode um die Benutzerinformationen auszugeben. + * Method which outputs user information. * - * @param info Benutzerinformationen + * @param info User information received as a String. */ - public void UserInfoOutput(String info) { + public void userInfoOutput(String info) { System.out.println(info); } - public void IndexOutput(ArrayList index) { + /** + * Outputs the index that contains words with corresponding paragraphs. + * + * @param index ArrayList with words and in which part they have + */ + public void indexOutput(ArrayList index) { for (String word : index) { System.out.println(word); }