Grootheid.java 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. package weerstation;
  2. import java.util.ArrayList;
  3. public class Grootheid
  4. {
  5. // instance variables - replace the example below with your own
  6. private double avg;
  7. private double max;
  8. private double min;
  9. private double mode;
  10. private double median;
  11. private double deviation;
  12. private double current;
  13. //constructor
  14. public Grootheid(){
  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= Math.round(max * 100.0) / 100.0;;
  28. }
  29. public double getMin() {
  30. return min;
  31. }
  32. public void setMin(double min) {
  33. this.min = Math.round(min * 100.0) / 100.0;;
  34. }
  35. public double getAvg() {
  36. return avg;
  37. }
  38. public void setAvg(double avg) {
  39. this.avg = Math.round(avg * 100.0) / 100.0;
  40. }
  41. public double getMode() {
  42. return mode;
  43. }
  44. public void setMode(double mode) {
  45. this.mode = Math.round(mode * 100.0) / 100.0;
  46. }
  47. public double getMedian() {
  48. return median;
  49. }
  50. public void setMedian(double median) {
  51. this.median = Math.round(median * 100.0) / 100.0;
  52. }
  53. public double getDeviation() {
  54. return deviation;
  55. }
  56. public void setDeviation(double deviation) {
  57. this.deviation = Math.round(deviation * 100.0) / 100.0;
  58. }
  59. //Methods
  60. public void calculateMaxMin(ArrayList<Double> array){
  61. setMax(StatisticsCalculator.max(array));
  62. setMin(StatisticsCalculator.min(array));
  63. }
  64. public void updateRecent(Measurement measurement1){
  65. }
  66. public void updatePeriod(ArrayList<Measurement> measurement2){
  67. }
  68. public void display(){
  69. GUIboard.writeUpperDigits(getCurrent());
  70. GUIboard.writeLeftDigits(getMax());
  71. GUIboard.writeRightDigits(getMin());
  72. }
  73. public void displayGraph()
  74. {
  75. }
  76. }