Merge remote-tracking branch 'origin/main' into main

This commit is contained in:
MikeZyeman 2021-11-11 15:28:39 +01:00
commit 5e3258c526
2 changed files with 15 additions and 7 deletions

View File

@ -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();
}

View File

@ -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<String> 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<String> index) {
for (String word : index) {
System.out.println(word);
}