Package org.daiitech.naftah
Enum Class Naftah.NaftahCommand.ManualCommand.ManCommand
java.lang.Object
java.lang.Enum<Naftah.NaftahCommand.ManualCommand.ManCommand>
org.daiitech.naftah.Naftah.NaftahCommand.ManualCommand.ManCommand
- All Implemented Interfaces:
Serializable,Comparable<Naftah.NaftahCommand.ManualCommand.ManCommand>,Constable
- Enclosing class:
- Naftah.NaftahCommand.ManualCommand
private static enum Naftah.NaftahCommand.ManualCommand.ManCommand
extends Enum<Naftah.NaftahCommand.ManualCommand.ManCommand>
Enum representing all manual subcommands supported in Naftah.
Each subcommand may have multiple aliases, supporting both English and Arabic inputs.
The subcommands can be matched against user input using matches(String).
Common manual subcommands include:
USAGE– display general usage/help instructionsLIST_TOPICS– list all available documentation topicsCLASSES– list all Java classesACCESSIBLE_CLASSES– list accessible Java classesINSTANTIABLE_CLASSES– list Java classes that can be instantiatedBUILTIN_FUNCTIONS– list built-in Naftah functionsJVM_FUNCTIONS– list Java (JVM) functionsEXIT– exit the manual or REPL sessionHISTORY,CURRENT_SESSION_HISTORY,SANITIZE_HISTORY,PURGE_HISTORY– manage command history (view, sanitize, or purge)
Usage example:
if (ManCommand.USAGE.matches(input)) {
// display help instructions
}
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateManCommand(Set<String> aliases) Constructs a manual command with the given set of aliases. -
Method Summary
Modifier and TypeMethodDescriptionReturns the set of aliases for this manual command.Returns a set of all aliases for all manual commands.(package private) booleanChecks if the input string matches any alias of this manual 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
-
USAGE
-
LIST_TOPICS
-
CLASSES
-
ACCESSIBLE_CLASSES
-
INSTANTIABLE_CLASSES
-
BUILTIN_FUNCTIONS
-
JVM_FUNCTIONS
-
EXIT
-
HISTORY
-
CURRENT_SESSION_HISTORY
-
SANITIZE_HISTORY
-
PURGE_HISTORY
-
-
Field Details
-
aliases
-
-
Constructor Details
-
ManCommand
Constructs a manual 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 manual command.- Parameters:
input- the input string to check- Returns:
trueif the input matches any alias,falseotherwise
-
getAliases
Returns the set of aliases for this manual command.- Returns:
- the set of aliases
-
getAllAliases
Returns a set of all aliases for all manual commands.- Returns:
- a
Setcontaining all aliases
-