diff options
author | Eduardo Pedroni <ep625@york.ac.uk> | 2014-05-01 13:05:27 +0100 |
---|---|---|
committer | Eduardo Pedroni <ep625@york.ac.uk> | 2014-05-01 13:05:27 +0100 |
commit | 36f4393bcc9e55afa2334baa33e603ce839741a1 (patch) | |
tree | d9a1d55d0d3553193a3fc11a92f11515762d202f /src/jcgp/backend/resources/parameters | |
parent | 4c8de2402f2878cde7587c7f3bbf4ffaea86efd4 (diff) |
Did more commenting, implemented reflection and statistics
Diffstat (limited to 'src/jcgp/backend/resources/parameters')
5 files changed, 0 insertions, 138 deletions
diff --git a/src/jcgp/backend/resources/parameters/BooleanParameter.java b/src/jcgp/backend/resources/parameters/BooleanParameter.java deleted file mode 100644 index cc74a64..0000000 --- a/src/jcgp/backend/resources/parameters/BooleanParameter.java +++ /dev/null @@ -1,23 +0,0 @@ -package jcgp.backend.resources.parameters; - -import javafx.beans.property.SimpleBooleanProperty; - -public abstract class BooleanParameter extends Parameter<Boolean> { - - public BooleanParameter(boolean value, String name, boolean monitor, boolean critical) { - super(name, monitor, critical); - this.valueProperty = new SimpleBooleanProperty(value); - } - - /** - * Simple BooleanParameter constructor, - * - * - * @param value - * @param name - */ - public BooleanParameter(boolean value, String name) { - super(name, false, false); - this.valueProperty = new SimpleBooleanProperty(value); - } -} diff --git a/src/jcgp/backend/resources/parameters/DoubleParameter.java b/src/jcgp/backend/resources/parameters/DoubleParameter.java deleted file mode 100644 index b109446..0000000 --- a/src/jcgp/backend/resources/parameters/DoubleParameter.java +++ /dev/null @@ -1,21 +0,0 @@ -package jcgp.backend.resources.parameters; - -import javafx.beans.property.SimpleDoubleProperty; - -public abstract class DoubleParameter extends Parameter<Number> { - - public DoubleParameter(double value, String name, boolean monitor, boolean critical) { - super(name, monitor, critical); - this.valueProperty = new SimpleDoubleProperty(value); - } - - public DoubleParameter(double value, String name) { - super(name, false, false); - this.valueProperty = new SimpleDoubleProperty(value); - } - - @Override - public Double get() { - return super.get().doubleValue(); - } -} diff --git a/src/jcgp/backend/resources/parameters/IntegerParameter.java b/src/jcgp/backend/resources/parameters/IntegerParameter.java deleted file mode 100644 index 7cf68bd..0000000 --- a/src/jcgp/backend/resources/parameters/IntegerParameter.java +++ /dev/null @@ -1,21 +0,0 @@ -package jcgp.backend.resources.parameters; - -import javafx.beans.property.SimpleIntegerProperty; - -public abstract class IntegerParameter extends Parameter<Number> { - - public IntegerParameter(int value, String name, boolean monitor, boolean critical) { - super(name, monitor, critical); - this.valueProperty = new SimpleIntegerProperty(value); - } - - public IntegerParameter(int value, String name) { - super(name, false, false); - this.valueProperty = new SimpleIntegerProperty(value); - } - - @Override - public Integer get() { - return super.get().intValue(); - } -} diff --git a/src/jcgp/backend/resources/parameters/Parameter.java b/src/jcgp/backend/resources/parameters/Parameter.java deleted file mode 100644 index 3990ae6..0000000 --- a/src/jcgp/backend/resources/parameters/Parameter.java +++ /dev/null @@ -1,57 +0,0 @@ -package jcgp.backend.resources.parameters; - -import javafx.beans.property.Property; -import javafx.beans.property.ReadOnlyProperty; - -public abstract class Parameter<T> { - - protected boolean monitor, critical, reset = false; - - protected ParameterStatus status = ParameterStatus.VALID; - - protected String name; - - protected Property<T> valueProperty; - - public Parameter(String name, boolean monitor, boolean critical) { - this.name = name; - this.monitor = monitor; - this.critical = critical; - } - - public boolean isMonitor() { - return monitor; - } - - public boolean isCritical() { - return critical; - } - - public boolean requiresReset() { - return critical || reset; - } - - public String getName() { - return name; - } - - public ParameterStatus getStatus() { - return status; - } - - public ReadOnlyProperty<T> valueProperty() { - return valueProperty; - } - - public T get() { - return valueProperty.getValue(); - } - - public void set(T newValue) { - if (!valueProperty.isBound()) { - valueProperty.setValue(newValue); - } - } - - public abstract void validate(T newValue); -} diff --git a/src/jcgp/backend/resources/parameters/ParameterStatus.java b/src/jcgp/backend/resources/parameters/ParameterStatus.java deleted file mode 100644 index 11da4c2..0000000 --- a/src/jcgp/backend/resources/parameters/ParameterStatus.java +++ /dev/null @@ -1,16 +0,0 @@ -package jcgp.backend.resources.parameters; - -public enum ParameterStatus { - INVALID, WARNING, WARNING_RESET, VALID; - - private String details; - - public void setDetails(String details) { - this.details = details; - } - - public String getDetails() { - return details; - } - -} |