-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCommand.java
83 lines (73 loc) · 1.56 KB
/
Command.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/**
* Write a description of class Command here. Command is a SuperClass
* with many subclasses of Commands.
*
* @author Jerrett Fowler
* @version 1.0 (July 2013)
*/
public abstract class Command
{
public String secondWord;
public String thirdWord;
public Command()
{
secondWord = null;
thirdWord = null;
}
/**
* Set secondWord
*
* @param secondWord a sample parameter for a method
* @return void no return
*/
public void setSecondWord(String secondWord)
{
this.secondWord = secondWord;
}
/**
* Return second word
*/
public String getSecondWord()
{
return secondWord;
}
/**
* Return true if the command has a second word
*/
public boolean hasSecondWord()
{
return (secondWord != null);
}
/**
* Set thirdWord
*
* @param thirdWord a sample parameter for a method
* @return void no return
*/
public void setThirdWord(String thirdWord)
{
this.thirdWord = thirdWord;
}
/**
* Return third word
*/
public String getThirdWord()
{
return thirdWord;
}
/**
* Return true if the command has a third word
*/
public boolean hasThirdWord()
{
return (thirdWord != null);
}
/**
* Return true if conditions are met
*/
public abstract boolean execute(Object o);
/**
* Return String of name of command
*/
public abstract String getName();
}