Package org.daiitech.naftah
Enum Class Naftah.NaftahCommand.ShellCommand.ReplCommand
java.lang.Object
java.lang.Enum<Naftah.NaftahCommand.ShellCommand.ReplCommand>
org.daiitech.naftah.Naftah.NaftahCommand.ShellCommand.ReplCommand
- All Implemented Interfaces:
Serializable,Comparable<Naftah.NaftahCommand.ShellCommand.ReplCommand>,Constable
- Enclosing class:
- Naftah.NaftahCommand.ShellCommand
private static enum Naftah.NaftahCommand.ShellCommand.ReplCommand
extends Enum<Naftah.NaftahCommand.ShellCommand.ReplCommand>
Enum representing the REPL-specific commands supported in the Naftah interactive shell.
Each command may have multiple aliases, supporting both English and Arabic inputs.
Commands can be matched against user input using matches(String).
Common REPL commands include:
EXIT– terminate the REPL sessionHELP– display help informationRESET– reset the REPL sessionVARS– list variablesFUNCTIONS– list functionsIMPLEMENTATIONS– list implementationsIMPORTS– show imported modulesSAVE– save the current session stateHISTORY,CURRENT_SESSION_HISTORY,SANITIZE_HISTORY,PURGE_HISTORY– manage command historyDROP– drop variables or definitions
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateReplCommand(Set<String> aliases) Constructs a repl command with the given set of aliases. -
Method Summary
Modifier and TypeMethodDescriptionReturns all aliases for this REPL command.Returns a set of all aliases for all REPL commands.(package private) booleanChecks if the input string matches any alias of this REPL command.Returns the enum constant of this class with the specified name.values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
EXIT
-
HELP
-
RESET
-
VARS
-
FUNCTIONS
-
IMPLEMENTATIONS
-
IMPORTS
-
SAVE
-
HISTORY
-
CURRENT_SESSION_HISTORY
-
SANITIZE_HISTORY
-
PURGE_HISTORY
-
DROP
-
-
Field Details
-
aliases
-
-
Constructor Details
-
ReplCommand
Constructs a repl command with the given set of aliases.- Parameters:
aliases- the set of aliases for this command (English and Arabic)
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
matches
Checks if the input string matches any alias of this REPL command.- Parameters:
input- the user input to check- Returns:
trueif the input matches one of the command aliases,falseotherwise
-
getAliases
Returns all aliases for this REPL command.- Returns:
- a set of aliases for this command
-
getAllAliases
Returns a set of all aliases for all REPL commands.- Returns:
- a set of all REPL command aliases
-