added return boolean to method formatFix and formatRaw.
This commit is contained in:
+12
-5
@@ -5,7 +5,7 @@ import java.util.ArrayList;
|
||||
*/
|
||||
public class TextOutput {
|
||||
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
|
||||
@@ -109,8 +109,9 @@ public class TextOutput {
|
||||
/**
|
||||
* Method which sets the Variable formatRaw to true.
|
||||
*/
|
||||
public void formatRaw() {
|
||||
public boolean formatRaw() {
|
||||
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.
|
||||
*/
|
||||
public void formatFix(int length) {
|
||||
formatRaw = false;
|
||||
columnWidth = length;
|
||||
public boolean formatFix(int length) {
|
||||
if(length > 0) {
|
||||
formatRaw = false;
|
||||
columnWidth = length;
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user