Added documentation to class TextLogik.

This commit is contained in:
amadoste 2021-11-10 13:14:32 +01:00
parent 580eedd3c6
commit 2aa7fb3822
1 changed files with 11 additions and 0 deletions

View File

@ -4,6 +4,11 @@ public class TextLogik {
private final Text text; private final Text text;
private final TextOutput textOutput; private final TextOutput textOutput;
/**
* Initiates a new instance of the class TextLogik.
* Contains command instructions for the class Text.
* Defined the different cases and appointed to specific commands.
*/
public TextLogik() { public TextLogik() {
text = new Text(); text = new Text();
textOutput = new TextOutput(); textOutput = new TextOutput();
@ -79,6 +84,12 @@ public class TextLogik {
} while (!"EXIT".equals(command[0])); } while (!"EXIT".equals(command[0]));
} }
/**
* Method to check if a command is numeric.
*
* @param str command that should be a number.
* @return true if the given str matches.
*/
private boolean isNumeric(String str) { private boolean isNumeric(String str) {
return str.matches("\\d+"); return str.matches("\\d+");
} }