package jcgp.backend.resources.parameters; import javafx.beans.property.SimpleDoubleProperty; public abstract class DoubleParameter extends Parameter { protected SimpleDoubleProperty value; public DoubleParameter(double value, String name, boolean monitor, boolean critical) { super(name, monitor, critical); this.value = new SimpleDoubleProperty(value); } public DoubleParameter(double value, String name) { super(name, false, false); this.value = new SimpleDoubleProperty(value); } public double get() { return value.get(); } public void set(double newValue) { if (!value.isBound()) { value.set(newValue); } } @Override public SimpleDoubleProperty valueProperty() { return value; } public abstract void validate(double newValue); }