public class Command
extends java.lang.Object
Constructor and Description |
---|
Command(CommandWord firstWord,
java.lang.String secondWord)
Create a command object.
|
Modifier and Type | Method and Description |
---|---|
CommandWord |
getCommandWord()
Return the command word (the first word) of this command.
|
java.lang.String |
getSecondWord()
See "Returns" comment.
|
boolean |
hasSecondWord()
See "Returns" comment.
|
boolean |
isUnknown()
See "Returns" comment.
|
public Command(CommandWord firstWord, java.lang.String secondWord)
firstWord
- The first word of the command. Null if the command
was not recognised.secondWord
- The second word of the command.public CommandWord getCommandWord()
public java.lang.String getSecondWord()
public boolean isUnknown()
public boolean hasSecondWord()