1
0

add DataPoint

This commit is contained in:
Rémi Heredero 2023-05-05 13:51:58 +02:00
parent 2c702c5b12
commit e0d0894040
3 changed files with 81 additions and 0 deletions

View 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;
}
}

View 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;
}
}

View 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;
}
}