Files
weerstation/OutsideHum.java
T
Kenneth van Ewijk a0c37c1a23 Converted everything to work with polymorphism
Added "Grootheid" to act as a parent to all children classes, it allows
the main "Weerstation" to update them all better and with cleaner code.
2014-10-11 17:46:31 +02:00

33 lines
829 B
Java

import java.util.ArrayList;
public class OutsideHum extends Grootheid{
//constructor
public OutsideHum(Measurement measurement1, ArrayList<Measurement> measurement2){
updateRecent(measurement1);
update24Hour(measurement2);
}
public void updateRecent(Measurement measurement1){
setCurrent(measurement1.getOutsideHum());
}
public void update24Hour(ArrayList<Measurement> measurement2){
ArrayList<Double> list = new ArrayList<Double>();
for(Measurement ms : measurement2)
{
list.add(ms.getOutsideHum());
}
calculateMaxMinAvg(list);
}
public void display(){
super.display();
GUIboard.writePageToMatrix("Luchtv. Buiten", "Gemiddelde: " + getAvg(), "");
}
}