-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCommand.java
More file actions
executable file
·50 lines (45 loc) · 1.26 KB
/
Command.java
File metadata and controls
executable file
·50 lines (45 loc) · 1.26 KB
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
/**
* Classe definissant le concept de 'commandes'
* @author Clément Chomicki
*/
public class Command
{
private CommandWord aCommandWord;
private String aSecondWord;
/**
* Constructeur de la classe
* @param pCommandW le mot-commande
* @param pSecondW le second mot
*/
public Command (final CommandWord pCommandW, final String pSecondW )
{
this.aCommandWord = pCommandW;
this.aSecondWord = pSecondW;
}
/**
* Accesseur du mot-commande
* @return le mot-commande
*/
public CommandWord getCommandWord () { return this.aCommandWord; }
/**
* Accesseur du second mot
* @return le second mot
*/
public String getSecondWord () { return this.aSecondWord; }
/**
* Fonction booleene verifiant si la commande presente un second mot
* @return true si et seulement si le second mot n'est pas null.
*/
public boolean hasSecondWord ()
{
return this.aSecondWord != null;
}
/**
* Fonction booleene verifiant si la commande presente un mot-commande
* @return true si et seulement si le mot commande est null.
*/
public boolean isUnknown ()
{
return this.aCommandWord == CommandWord.UNKNOWN;
}
} // Command