From 36f4393bcc9e55afa2334baa33e603ce839741a1 Mon Sep 17 00:00:00 2001 From: Eduardo Pedroni Date: Thu, 1 May 2014 13:05:27 +0100 Subject: Did more commenting, implemented reflection and statistics --- .../resources/parameters/BooleanParameter.java | 23 --------- .../resources/parameters/DoubleParameter.java | 21 -------- .../resources/parameters/IntegerParameter.java | 21 -------- .../backend/resources/parameters/Parameter.java | 57 ---------------------- .../resources/parameters/ParameterStatus.java | 16 ------ 5 files changed, 138 deletions(-) delete mode 100644 src/jcgp/backend/resources/parameters/BooleanParameter.java delete mode 100644 src/jcgp/backend/resources/parameters/DoubleParameter.java delete mode 100644 src/jcgp/backend/resources/parameters/IntegerParameter.java delete mode 100644 src/jcgp/backend/resources/parameters/Parameter.java delete mode 100644 src/jcgp/backend/resources/parameters/ParameterStatus.java (limited to 'src/jcgp/backend/resources/parameters') 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 { - - 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 { - - 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 { - - 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 { - - protected boolean monitor, critical, reset = false; - - protected ParameterStatus status = ParameterStatus.VALID; - - protected String name; - - protected Property 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 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; - } - -} -- cgit v1.2.3