diff options
| author | bculkin2442 <bjculkin@mix.wvu.edu> | 2017-03-26 11:30:43 -0400 |
|---|---|---|
| committer | bculkin2442 <bjculkin@mix.wvu.edu> | 2017-03-26 11:30:43 -0400 |
| commit | 98cdf435d4974f4cca8f7b4eb4026da2c88cbc4c (patch) | |
| tree | ce5edea29a4da719affe61afda30a50afae15e87 /BJC-Utils2/src/main/java/bjc/utils/cli/ICommandMode.java | |
| parent | b53c1ef47c438fb1144b961d1939c37a4bfe9120 (diff) | |
Update
Diffstat (limited to 'BJC-Utils2/src/main/java/bjc/utils/cli/ICommandMode.java')
| -rw-r--r-- | BJC-Utils2/src/main/java/bjc/utils/cli/ICommandMode.java | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/BJC-Utils2/src/main/java/bjc/utils/cli/ICommandMode.java b/BJC-Utils2/src/main/java/bjc/utils/cli/ICommandMode.java deleted file mode 100644 index 431a8cf..0000000 --- a/BJC-Utils2/src/main/java/bjc/utils/cli/ICommandMode.java +++ /dev/null @@ -1,72 +0,0 @@ -package bjc.utils.cli; - -/** - * A mode for determining the commands that are valid to enter, and then - * handling those commands - * - * @author ben - * - */ -public interface ICommandMode extends Comparable<ICommandMode> { - /** - * Check to see if this mode can handle the specified command - * - * @param command - * The command to check - * @return Whether or not this mode can handle the command. It is - * assumed not by default - */ - default boolean canHandle(String command) { - return false; - }; - - /** - * Get the custom prompt for this mode - * - * @return the custom prompt for this mode - * - * @throws UnsupportedOperationException - * if this mode doesn't support a custom prompt - */ - default String getCustomPrompt() { - throw new UnsupportedOperationException("This mode doesn't support a custom prompt"); - } - - /** - * Get the name of this command mode - * - * @return The name of this command mode, which is the empty string by - * default - */ - public default String getName() { - return ""; - } - - /** - * Check if this mode uses a custom prompt - * - * @return Whether or not this mode uses a custom prompt - */ - default boolean isCustomPromptEnabled() { - return false; - } - - /** - * Process a command in this mode - * - * @param command - * The command to process - * @param args - * A list of arguments to the command - * @return The command mode to use for the next command. Defaults to - * returning this, and doing nothing else - */ - default ICommandMode process(String command, String[] args) { - return this; - } - - @Override - default int compareTo(ICommandMode o) { - return getName().compareTo(o.getName()); - } -} |
