Grootheid.java 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. import java.util.ArrayList;
  2. public class Grootheid
  3. {
  4. // instance variables - replace the example below with your own
  5. private double avg;
  6. private double max;
  7. private double min;
  8. private double current;
  9. //constructor
  10. public Grootheid(){
  11. avg = 0;
  12. max = 0;
  13. min = 0;
  14. current = 0;
  15. }
  16. //getters & setters
  17. public double getCurrent() {
  18. return current;
  19. }
  20. public void setCurrent(double current) {
  21. this.current = current;
  22. }
  23. public double getMax() {
  24. return max;
  25. }
  26. public void setMax(double max) {
  27. this.max= max;
  28. }
  29. public double getMin() {
  30. return min;
  31. }
  32. public void setMin(double min) {
  33. this.min = min;
  34. }
  35. public double getAvg() {
  36. return avg;
  37. }
  38. public void setAvg(double avg) {
  39. this.avg = avg;
  40. }
  41. //Methods
  42. public void calculateMaxMinAvg(ArrayList<Double> array){
  43. setMax( StatisticsCalculator.max(array) );
  44. setMin( StatisticsCalculator.min(array) );
  45. setAvg( StatisticsCalculator.avg(array) );
  46. }
  47. public void updateRecent(Measurement measurement1){
  48. }
  49. public void update24Hour(ArrayList<Measurement> measurement2){
  50. }
  51. public void display(){
  52. GUIboard.writeUpperDigits(getCurrent());
  53. GUIboard.writeLeftDigits(getMax());
  54. GUIboard.writeRightDigits(getMin());
  55. }
  56. public void displayGraph()
  57. {
  58. }
  59. }