added return boolean to method formatFix and formatRaw.

This commit is contained in:
Leonardo Brandenberger 2021-11-11 15:02:57 +01:00
parent 7ed50f6d9f
commit 117420c815
1 changed files with 12 additions and 5 deletions

View File

@ -5,7 +5,7 @@ import java.util.ArrayList;
*/ */
public class TextOutput { public class TextOutput {
private boolean formatRaw; private boolean formatRaw;
private int columnWidth = 10; private int columnWidth = 20;
/** /**
* Method which checks in which way the paragraphs should be displayed. And then calls the corresponding * Method which checks in which way the paragraphs should be displayed. And then calls the corresponding
@ -109,8 +109,9 @@ public class TextOutput {
/** /**
* Method which sets the Variable formatRaw to true. * Method which sets the Variable formatRaw to true.
*/ */
public void formatRaw() { public boolean formatRaw() {
formatRaw = true; formatRaw = true;
return true;
} }
/** /**
@ -119,9 +120,15 @@ public class TextOutput {
* *
* @param length the maximum length of each paragraph that is allowed to be displayed when printing the text. * @param length the maximum length of each paragraph that is allowed to be displayed when printing the text.
*/ */
public void formatFix(int length) { public boolean formatFix(int length) {
if(length > 0) {
formatRaw = false; formatRaw = false;
columnWidth = length; columnWidth = length;
return true;
}
else {
return false;
}
} }
/** /**