blob: 558f57fcc21349af2253f186bed9ace8c3c5dd6d (
plain)
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
|
package jcgp.backend.parameters;
/**
* Enum type containing all possible states for parameters.
* <br>
* <ul>
* <li>INVALID: the new parameter value is not valid,
* and the experiment will not be allowed to run.</li>
* <li>WARNING: the new parameter value is technically valid,
* though it might lead to undesirable behaviour.</li>
* <li>WARNING_RESET: the new parameter value is technically valid
* but will require a reset.</li>
* <li>VALID: the new value is valid.</li>
* </ul>
* <br><br>
* The above definitions are final in the sense that they outline
* how parameters are treated by the program depending on their
* status (e.g. if any parameters are set to WARNING_RESET, a reset
* will automatically be performed when the experiment is run).
* <br>
* In addition to the status itself, this class includes a field
* to contain details about the current status. If a GUI is in use,
* the contents of the field should be displayed to the user, as well
* as some visual indication of the status itself. Both the status
* and the message should be updated by each parameter when {@code validate()}
* is called.
*
* @see Parameter
* @author Eduardo Pedroni
*
*/
public enum ParameterStatus {
INVALID, WARNING, WARNING_RESET, VALID;
private String details;
/**
* Sets a new string containing details about the current status.
* This should be displayed by the GUI, if one is in use.
*
* @param details an explanation of the current status.
*/
public void setDetails(String details) {
this.details = details;
}
/**
* @return the string containing details about the current status.
*/
public String getDetails() {
return details;
}
}
|