public class CommandInfo
extends java.lang.Object
| Constructor and Description |
|---|
CommandInfo(java.lang.String line)
Transform a line into its components
|
| Modifier and Type | Method and Description |
|---|---|
CommandInfo |
advance()
Replace the keyword with the first parameter in
params. |
boolean |
canAdvance()
Report if we can advance the command one (1) step.
|
Parameter |
extractParameter(ParameterInfo... expected)
Extract the parameters from the remaining arguments.
|
java.lang.String |
getKeyword()
The keyword for this command.
|
java.lang.String[] |
getParams()
A copy of the remaining parameters.
|
boolean |
isNextHelp()
Does the command ask to call for help?
|
public CommandInfo(java.lang.String line)
line - the line to readpublic Parameter extractParameter(ParameterInfo... expected)
expected - a series of parameters we can extract laterpublic CommandInfo advance()
params. Before
calling this method, check if you can with canAdvance().public boolean canAdvance()
public boolean isNextHelp()
public java.lang.String getKeyword()
public java.lang.String[] getParams()