Merge remote-tracking branch 'origin/main'

This commit is contained in:
schrom01 2021-11-10 13:56:08 +01:00
commit 77cabcf39a
1 changed files with 11 additions and 0 deletions

View File

@ -4,6 +4,11 @@ public class TextLogik {
private final Text text;
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() {
text = new Text();
textOutput = new TextOutput();
@ -79,6 +84,12 @@ public class TextLogik {
} 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) {
return str.matches("\\d+");
}