@Test public void equalTest() { TimeRange r1 = new TimeRange(5, 8); TimeRange r2 = new TimeRange(5, 8); assertTrue(r1.equals(r2)); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } TimeRange that = (TimeRange) o; return (this.min == that.min && this.max == that.max); }
TimeRange implements Comparable<TimeRange> { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } TimeRange that = (TimeRange) o; return (this.min == that.min && this.max == that.max); } }
TimeRange implements Comparable<TimeRange> { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } TimeRange that = (TimeRange) o; return (this.min == that.min && this.max == that.max); } TimeRange(long min, long max); }
TimeRange implements Comparable<TimeRange> { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } TimeRange that = (TimeRange) o; return (this.min == that.min && this.max == that.max); } TimeRange(long min, long max); @Override int compareTo(TimeRange r); void setMin(long min); void setMax(long max); boolean contains(TimeRange r); boolean contains(long min, long max); boolean contains(long time); void set(long min, long max); long getMin(); long getMax(); boolean intersects(TimeRange r); @Override boolean equals(Object o); @Override int hashCode(); boolean overlaps(TimeRange rhs); @Override String toString(); void setLeftClose(boolean leftClose); void setRightClose(boolean rightClose); boolean getLeftClose(); boolean getRightClose(); static List<TimeRange> sortAndMerge(List<TimeRange> unionCandidates); @SuppressWarnings("squid:S3776") // Suppress high Cognitive Complexity warning List<TimeRange> getRemains(List<TimeRange> timeRangesPrev); IExpression getExpression(); }
TimeRange implements Comparable<TimeRange> { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } TimeRange that = (TimeRange) o; return (this.min == that.min && this.max == that.max); } TimeRange(long min, long max); @Override int compareTo(TimeRange r); void setMin(long min); void setMax(long max); boolean contains(TimeRange r); boolean contains(long min, long max); boolean contains(long time); void set(long min, long max); long getMin(); long getMax(); boolean intersects(TimeRange r); @Override boolean equals(Object o); @Override int hashCode(); boolean overlaps(TimeRange rhs); @Override String toString(); void setLeftClose(boolean leftClose); void setRightClose(boolean rightClose); boolean getLeftClose(); boolean getRightClose(); static List<TimeRange> sortAndMerge(List<TimeRange> unionCandidates); @SuppressWarnings("squid:S3776") // Suppress high Cognitive Complexity warning List<TimeRange> getRemains(List<TimeRange> timeRangesPrev); IExpression getExpression();  }