aboutsummaryrefslogtreecommitdiffstats
path: root/src/jcgp/parameters/Parameter.java
blob: fcff9fdcdd454fa873a3f2b36129da57420bbb7e (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
55
56
57
58
package jcgp.parameters;

import javafx.beans.property.Property;
public abstract class Parameter {
	
	protected boolean managed = false;
	protected boolean hidden = false;
	
	protected boolean originalManaged = false;
	protected boolean originalHidden = false;
	
	protected Property<?> value;
	
	protected String name;
	
	public Parameter(String name, boolean managed, boolean hidden) {
		this.name = name;
		this.managed = originalManaged = managed;
		this.hidden = originalHidden = hidden;
	}
	
	public Parameter(String name) {
		this.name = name;
	}
	
	public void setManaged(boolean value) {
		managed = value;
	}
	
	public boolean isManaged() {
		return managed;
	}
	
	public void setHidden(boolean value) {
		hidden = value;
	}
	
	public boolean isHidden() {
		return hidden;
	}
	
	public String getName() {
		return name;
	}
	
	public abstract Object getValue();
	
	public abstract void setValue(Object value);
	
	public Property<?> valueProperty() {
		return value;
	}

	public void reset() {
		hidden = originalHidden;
		managed = originalManaged;
	}
}