public class Command
extends java.lang.Object
Constructor and Description |
---|
Command(java.lang.String commandWord,
java.lang.String secondWord)
constructor for objects of type Command
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getCommandWord()
return the command word (the first word) of this command.
|
java.lang.String |
getSecondWord()
return the second word of this command.
|
boolean |
hasSecondWord()
checks whether the command has a second word
|
boolean |
isUnknown()
checks whether the command was understood
|
public Command(java.lang.String commandWord, java.lang.String secondWord)
commandWord
- the command wordsecondWord
- the second word of the commentpublic java.lang.String getCommandWord()
public java.lang.String getSecondWord()
public boolean isUnknown()
public boolean hasSecondWord()