Grootheid.java 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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 mode;
  9. private double median;
  10. private double deviation;
  11. private double current;
  12. //constructor
  13. public Grootheid(){
  14. }
  15. //getters & setters
  16. public double getCurrent() {
  17. return current;
  18. }
  19. public void setCurrent(double current) {
  20. this.current = current;
  21. }
  22. public double getMax() {
  23. return max;
  24. }
  25. public void setMax(double max) {
  26. this.max= Math.round(max * 100.0) / 100.0;;
  27. }
  28. public double getMin() {
  29. return min;
  30. }
  31. public void setMin(double min) {
  32. this.min = Math.round(min * 100.0) / 100.0;;
  33. }
  34. public double getAvg() {
  35. return avg;
  36. }
  37. public void setAvg(double avg) {
  38. this.avg = Math.round(avg * 100.0) / 100.0;
  39. }
  40. public double getMode() {
  41. return mode;
  42. }
  43. public void setMode(double mode) {
  44. this.mode = Math.round(mode * 100.0) / 100.0;
  45. }
  46. public double getMedian() {
  47. return median;
  48. }
  49. public void setMedian(double median) {
  50. this.median = Math.round(median * 100.0) / 100.0;
  51. }
  52. public double getDeviation() {
  53. return deviation;
  54. }
  55. public void setDeviation(double deviation) {
  56. this.deviation = Math.round(deviation * 100.0) / 100.0;
  57. }
  58. //Methods
  59. public void calculateMaxMin(ArrayList<Double> array){
  60. setMax(StatisticsCalculator.max(array));
  61. setMin(StatisticsCalculator.min(array));
  62. }
  63. public void updateRecent(Measurement measurement1){
  64. }
  65. public void updatePeriod(ArrayList<Measurement> measurement2){
  66. }
  67. public void display(){
  68. GUIboard.writeUpperDigits(getCurrent());
  69. GUIboard.writeLeftDigits(getMax());
  70. GUIboard.writeRightDigits(getMin());
  71. }
  72. public void displayGraph()
  73. {
  74. }
  75. }