Package com.j3d.engine.interact.cmd
Command Line Interaction
The core is defined byCommandParser,
CommandsManager and Commands
The CommandParser parses all input from the
CommandPalette instance into CmdToken
instances for sub systems like the com.j3d.engine.interact.cmd.complete package to consume.
Otherwise, the parsed objects which are stored within the tokens are passed into the invoked
command once the user hits enter.
The Commands class contains the single instances to all
available commands, as Commands need only be instantiated once and reused multiple times.
The CommandsManager handles finding a command via it's alias
using a HashMap for O(1) lookup, and handles state vs stateless command flagging.
CmdToken encapsulates a single parsed element of a command,
holding its type and value, which can then be consumed by various subsystems or passed to the
command for execution.
Invoker represents the source from which a command was invoked.
Sub-packages
com.j3d.engine.interact.cmd.argscom.j3d.engine.interact.cmd.basecom.j3d.engine.interact.cmd.commandscom.j3d.engine.interact.cmd.complete
Other classes within this package
RunHistory tracks the history of executed commands, allowing
for recall and re-execution.
Wildcard is a special interface, which is used in Command definitions
to label that a TypedArg can take any type.
- Author:
- Lehlogonolo Poole
-
ClassDescriptionRepresents a token parsed from a command string.Defines the possible types a command token can represent.A parser for the command palette that handles tokenisation, argument parsing, command execution, and command history.A container class for all top-level commands.CommandsManager is responsible for creating and storing available command instances and providing lookup utilities for retrieving commands by their aliases.Represents the source or context from which a command was invoked.Manages the history of executed commands in the command palette.A marker interface representing a generic type.