aboutsummaryrefslogtreecommitdiffstats
path: root/src/jcgp/parameters/BooleanParameter.java
blob: 0f339a1cfc79c43305507d8c2fd285f697bd8b57 (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
package jcgp.parameters;

import javafx.beans.property.SimpleBooleanProperty;

public class BooleanParameter extends Parameter {
			
	public BooleanParameter(boolean value, String name) {
		super(name);
		this.value = new SimpleBooleanProperty(value);
	}
	
	public BooleanParameter(boolean value, String name, boolean managed, boolean hidden) {
		super(name, managed, hidden);
		this.value = new SimpleBooleanProperty(value);
	}
	
	@Override
	public Boolean getValue() {
		return ((SimpleBooleanProperty) this.value).get();
	}
	
	@Override
	public SimpleBooleanProperty valueProperty() {
		return (SimpleBooleanProperty) value;
	}

	@Override
	public void setValue(Object value) {
		((SimpleBooleanProperty) this.value).set((boolean) value);
	}
	
}