package ua.yandex.shad.tempseries;

public class TempSummaryStatistics {

    /**
     * Average temperature from array.
     */
    private final double avgTemp;

    /**
     * Deviation of temperatures from array.
     */
    private final double devTemp;

    /**
     * Minimal temperature from array.
     */
    private final double minTemp;

    /**
     * Maximal temperature from array.
     */
    private final double maxTemp;

    /**
     * Constructs object with fields based on data.
     */
    public TempSummaryStatistics(double avgTemp,
                                 double devTemp,
                                 double minTemp,
                                 double maxTemp) {
        this.avgTemp = avgTemp;
        this.devTemp = devTemp;
        this.minTemp = minTemp;
        this.maxTemp = maxTemp;
    }

    /**
     * Getter for 'avgTemp'
     */
    public double getAvgTemp() {
        return avgTemp;
    }

    /**
     * Getter for 'devTemp'
     */
    public double getDevTemp() {
        return devTemp;
    }

    /**
     * Getter for 'minTemp'
     */
    public double getMinTemp() {
        return minTemp;
    }

    /**
     * Getter for 'maxTemp'
     */
    public double getMaxTemp() {
        return maxTemp;
    }

    /**
     * Overriding Object's equals implementation.
     * Checks two TempSummaryStatistics on equality.
     *
     * @param other should be instance of TempSummaryStatistics to compare
     * @return true, if Statistics are equal
     *         false, otherwise
     */
    @Override
    public boolean equals(Object other) {
        if (other == null || other.getClass() != TempSummaryStatistics.class) {
            return false;
        }
        TempSummaryStatistics example = (TempSummaryStatistics)other;
        return (example.getAvgTemp() == getAvgTemp()
                && example.getDevTemp() == getDevTemp()
                && example.getMinTemp() == getMinTemp()
                && example.getMaxTemp() == getMaxTemp());
    }
}

@@ -67,16 +67,60 @@
 tics %7B%0A%0A
+    public static final double EPS = 5e-5;%0A%0A
     /**%0A
@@ -1697,35 +1697,23 @@
  != 
-TempSummaryStatistics.c
+this.getC
 lass
+()
 ) %7B%0A
@@ -1833,16 +1833,24 @@
  return 
+Math.abs
 (example
@@ -1859,26 +1859,25 @@
 etAvgTemp() 
-==
+-
  getAvgTemp(
@@ -1873,24 +1873,31 @@
 getAvgTemp()
+) %3C EPS
 %0A           
@@ -1896,32 +1896,41 @@
              && 
+Math.abs(
 example.getDevTe
@@ -1930,26 +1930,25 @@
 etDevTemp() 
-==
+-
  getDevTemp(
@@ -1944,24 +1944,31 @@
 getDevTemp()
+) %3C EPS
 %0A           
@@ -1967,32 +1967,41 @@
              && 
+Math.abs(
 example.getMinTe
@@ -2001,26 +2001,25 @@
 etMinTemp() 
-==
+-
  getMinTemp(
@@ -2019,16 +2019,23 @@
 inTemp()
+) %3C EPS
 %0A       
@@ -2046,16 +2046,25 @@
      && 
+Math.abs(
 example.
@@ -2076,18 +2076,17 @@
 xTemp() 
-==
+-
  getMaxT
@@ -2091,16 +2091,22 @@
 xTemp())
+ %3C EPS
 ;%0A    %7D%0A

Fix FireBug errors.