@Test public void testEquals() { Range r1 = new Range(0.0, 1.0); Range r2 = new Range(0.0, 1.0); assertEquals(r1, r2); assertEquals(r2, r1); r1 = new Range(0.0, 1.0); r2 = new Range(0.5, 1.0); assertFalse(r1.equals(r2)); r1 = new Range(0.0, 1.0); r2 = new Range(0.0, 2.0); assertFalse(r1.equals(r2)); assertFalse(r1.equals(new Double(0.0))); }
@Override public boolean equals(Object obj) { if (!(obj instanceof Range)) { return false; } Range range = (Range) obj; if (!(this.lower == range.lower)) { return false; } if (!(this.upper == range.upper)) { return false; } return true; }
Range implements Serializable { @Override public boolean equals(Object obj) { if (!(obj instanceof Range)) { return false; } Range range = (Range) obj; if (!(this.lower == range.lower)) { return false; } if (!(this.upper == range.upper)) { return false; } return true; } }
Range implements Serializable { @Override public boolean equals(Object obj) { if (!(obj instanceof Range)) { return false; } Range range = (Range) obj; if (!(this.lower == range.lower)) { return false; } if (!(this.upper == range.upper)) { return false; } return true; } Range(double lower, double upper); }
Range implements Serializable { @Override public boolean equals(Object obj) { if (!(obj instanceof Range)) { return false; } Range range = (Range) obj; if (!(this.lower == range.lower)) { return false; } if (!(this.upper == range.upper)) { return false; } return true; } Range(double lower, double upper); double getLowerBound(); double getUpperBound(); double getLength(); double getCentralValue(); boolean contains(double value); boolean intersects(double b0, double b1); boolean intersects(Range range); double constrain(double value); static Range combine(Range range1, Range range2); static Range combineIgnoringNaN(Range range1, Range range2); static Range expandToInclude(Range range, double value); static Range expand(Range range,
                               double lowerMargin, double upperMargin); static Range shift(Range base, double delta); static Range shift(Range base, double delta,
                              boolean allowZeroCrossing); static Range scale(Range base, double factor); @Override boolean equals(Object obj); boolean isNaNRange(); @Override int hashCode(); @Override String toString(); }
Range implements Serializable { @Override public boolean equals(Object obj) { if (!(obj instanceof Range)) { return false; } Range range = (Range) obj; if (!(this.lower == range.lower)) { return false; } if (!(this.upper == range.upper)) { return false; } return true; } Range(double lower, double upper); double getLowerBound(); double getUpperBound(); double getLength(); double getCentralValue(); boolean contains(double value); boolean intersects(double b0, double b1); boolean intersects(Range range); double constrain(double value); static Range combine(Range range1, Range range2); static Range combineIgnoringNaN(Range range1, Range range2); static Range expandToInclude(Range range, double value); static Range expand(Range range,
                               double lowerMargin, double upperMargin); static Range shift(Range base, double delta); static Range shift(Range base, double delta,
                              boolean allowZeroCrossing); static Range scale(Range base, double factor); @Override boolean equals(Object obj); boolean isNaNRange(); @Override int hashCode(); @Override String toString();  }