Package com.j3d.engine.interact.cmd


package com.j3d.engine.interact.cmd
Package that holds all classes related to command-line interaction and processing. This includes parsing commands, executing them, and managing command history.

Command Line Interaction

The core is defined by CommandParser, 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

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