add DataPoint
This commit is contained in:
parent
2c702c5b12
commit
e0d0894040
23
src/main/java/ch/hevs/isi/core/BooleanDataPoint.java
Normal file
23
src/main/java/ch/hevs/isi/core/BooleanDataPoint.java
Normal file
@ -0,0 +1,23 @@
|
||||
package ch.hevs.isi.core;
|
||||
|
||||
public class BooleanDataPoint extends DataPoint{
|
||||
private boolean value;
|
||||
|
||||
public BooleanDataPoint(String label, boolean isOutput) {
|
||||
super(label, isOutput);
|
||||
}
|
||||
public void setValue(boolean value){
|
||||
this.value = value;
|
||||
}
|
||||
public boolean getValue(){
|
||||
return this.value;
|
||||
}
|
||||
|
||||
public String toString(){
|
||||
String s = null;
|
||||
s += this.getLabel();
|
||||
s += ": ";
|
||||
s += this.getValue();
|
||||
return s;
|
||||
}
|
||||
}
|
34
src/main/java/ch/hevs/isi/core/DataPoint.java
Normal file
34
src/main/java/ch/hevs/isi/core/DataPoint.java
Normal file
@ -0,0 +1,34 @@
|
||||
package ch.hevs.isi.core;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class DataPoint {
|
||||
private Map<String, DataPoint> dataPointMap;
|
||||
private String label;
|
||||
private boolean isOutput;
|
||||
protected DataPoint(String label, boolean isOutput){
|
||||
this.label = label;
|
||||
this.isOutput = isOutput;
|
||||
}
|
||||
protected void update(boolean isNewValue){
|
||||
|
||||
}
|
||||
public DataPoint getDataPointFromLabel(String label){
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Just get the label of this DataPoint
|
||||
* @return the label in a string
|
||||
*/
|
||||
public String getLabel(){
|
||||
return this.label;
|
||||
}
|
||||
public boolean isOutput(){
|
||||
return this.isOutput;
|
||||
}
|
||||
|
||||
}
|
||||
|
24
src/main/java/ch/hevs/isi/core/FloatDataPoint.java
Normal file
24
src/main/java/ch/hevs/isi/core/FloatDataPoint.java
Normal file
@ -0,0 +1,24 @@
|
||||
package ch.hevs.isi.core;
|
||||
|
||||
public class FloatDataPoint extends DataPoint{
|
||||
private float value;
|
||||
public FloatDataPoint(String label, boolean isOutput) {
|
||||
super(label, isOutput);
|
||||
}
|
||||
public void setValue(float value){
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public float getValue(){
|
||||
return this.value;
|
||||
}
|
||||
|
||||
public String toString(){
|
||||
String s = null;
|
||||
s += this.getLabel();
|
||||
s += ": ";
|
||||
s += this.getValue();
|
||||
return s;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user