Class CommandParser.Command
java.lang.Object
edu.uky.cs.nil.tt.CommandParser.Command
- Enclosing class:
CommandParser
A command is a type of operation that can be parsed by a
command parser and executed on a server.- Author:
- Stephen G. Ware
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCommand(String[] words, CommandParser.Operation operation) Constructs a new command (including its human-readable description and its regular expression) from a sequence of keywords.Command(String format, Pattern pattern, CommandParser.Operation operation) Constructs a new command from a description, regular expression, and operation to be executed when the command is parsed. -
Method Summary
-
Field Details
-
format
A human-readable description of the command's format -
pattern
A regular expression used to detect if this command is being invoked -
operation
The operation to execute if this command is parsed
-
-
Constructor Details
-
Command
Constructs a new command from a description, regular expression, and operation to be executed when the command is parsed.- Parameters:
format- a human-readable description of the command's formatpattern- a regular expression used to detect if the command is being invokedoperation- the operation to execute when this command is parsed
-
Command
Constructs a new command (including its human-readable description and its regular expression) from a sequence of keywords.- Parameters:
words- a sequence of key words used to invoke the commandoperation- the operation to execute when this command is parsed
-