aboutsummaryrefslogtreecommitdiffstats
path: root/src/jcgp/backend/parameters/monitors/BooleanMonitor.java
blob: c7ccaf0a82d7a62a7273b8abd476c800b704673a (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
package jcgp.backend.parameters.monitors;

import jcgp.backend.parameters.BooleanParameter;

/**
 * This is a special type of {@code BooleanParameter} which 
 * cannot be modified in the GUI (if the GUI is in use).
 * 
 * @author Eduardo Pedroni
 *
 */
public class BooleanMonitor extends BooleanParameter {
	
	/**
	 * Creates a new instance of this class, assuming the monitor
	 * is not critical.
	 * 
	 * @param value the initial value for this monitor.
	 * @param name the name of this monitor, for GUI display.
	 */
	public BooleanMonitor(boolean value, String name) {
		super(value, name, true, false);
	}
	
	/**
	 * Creates a new instance of this class.
	 * 
	 * @param value the initial value for this monitor.
	 * @param name the name of this monitor, for GUI display.
	 * @param critical true if the monitor is critical.
	 */
	public BooleanMonitor(boolean value, String name, boolean critical) {
		super(value, name, true, critical);
	}

	@Override
	public void validate(Boolean newValue) {
		/*
		 *  Blank by default.
		 *  Instances should override this as necessary.
		 *  
		 */
	}
}