@Test public void testEquals() { TimeSeries s1 = new TimeSeries("Time Series 1"); TimeSeries s2 = new TimeSeries("Time Series 2"); boolean b1 = s1.equals(s2); assertFalse("b1", b1); s2.setKey("Time Series 1"); boolean b2 = s1.equals(s2); assertTrue("b2", b2); RegularTimePeriod p1 = new Day(); RegularTimePeriod p2 = p1.next(); s1.add(p1, 100.0); s1.add(p2, 200.0); boolean b3 = s1.equals(s2); assertFalse("b3", b3); s2.add(p1, 100.0); s2.add(p2, 200.0); boolean b4 = s1.equals(s2); assertTrue("b4", b4); s1.setMaximumItemCount(100); boolean b5 = s1.equals(s2); assertFalse("b5", b5); s2.setMaximumItemCount(100); boolean b6 = s1.equals(s2); assertTrue("b6", b6); s1.setMaximumItemAge(100); boolean b7 = s1.equals(s2); assertFalse("b7", b7); s2.setMaximumItemAge(100); boolean b8 = s1.equals(s2); assertTrue("b8", b8); }
@Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof TimeSeries)) { return false; } TimeSeries that = (TimeSeries) obj; if (!ObjectUtilities.equal(getDomainDescription(), that.getDomainDescription())) { return false; } if (!ObjectUtilities.equal(getRangeDescription(), that.getRangeDescription())) { return false; } if (!ObjectUtilities.equal(this.timePeriodClass, that.timePeriodClass)) { return false; } if (getMaximumItemAge() != that.getMaximumItemAge()) { return false; } if (getMaximumItemCount() != that.getMaximumItemCount()) { return false; } int count = getItemCount(); if (count != that.getItemCount()) { return false; } if (!ObjectUtilities.equal(this.data, that.data)) { return false; } return super.equals(obj); }
TimeSeries extends Series implements Cloneable, Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof TimeSeries)) { return false; } TimeSeries that = (TimeSeries) obj; if (!ObjectUtilities.equal(getDomainDescription(), that.getDomainDescription())) { return false; } if (!ObjectUtilities.equal(getRangeDescription(), that.getRangeDescription())) { return false; } if (!ObjectUtilities.equal(this.timePeriodClass, that.timePeriodClass)) { return false; } if (getMaximumItemAge() != that.getMaximumItemAge()) { return false; } if (getMaximumItemCount() != that.getMaximumItemCount()) { return false; } int count = getItemCount(); if (count != that.getItemCount()) { return false; } if (!ObjectUtilities.equal(this.data, that.data)) { return false; } return super.equals(obj); } }
TimeSeries extends Series implements Cloneable, Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof TimeSeries)) { return false; } TimeSeries that = (TimeSeries) obj; if (!ObjectUtilities.equal(getDomainDescription(), that.getDomainDescription())) { return false; } if (!ObjectUtilities.equal(getRangeDescription(), that.getRangeDescription())) { return false; } if (!ObjectUtilities.equal(this.timePeriodClass, that.timePeriodClass)) { return false; } if (getMaximumItemAge() != that.getMaximumItemAge()) { return false; } if (getMaximumItemCount() != that.getMaximumItemCount()) { return false; } int count = getItemCount(); if (count != that.getItemCount()) { return false; } if (!ObjectUtilities.equal(this.data, that.data)) { return false; } return super.equals(obj); } TimeSeries(Comparable name);  TimeSeries(Comparable name, String domain, String range); }
TimeSeries extends Series implements Cloneable, Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof TimeSeries)) { return false; } TimeSeries that = (TimeSeries) obj; if (!ObjectUtilities.equal(getDomainDescription(), that.getDomainDescription())) { return false; } if (!ObjectUtilities.equal(getRangeDescription(), that.getRangeDescription())) { return false; } if (!ObjectUtilities.equal(this.timePeriodClass, that.timePeriodClass)) { return false; } if (getMaximumItemAge() != that.getMaximumItemAge()) { return false; } if (getMaximumItemCount() != that.getMaximumItemCount()) { return false; } int count = getItemCount(); if (count != that.getItemCount()) { return false; } if (!ObjectUtilities.equal(this.data, that.data)) { return false; } return super.equals(obj); } TimeSeries(Comparable name);  TimeSeries(Comparable name, String domain, String range); String getDomainDescription(); void setDomainDescription(String description); String getRangeDescription(); void setRangeDescription(String description); @Override int getItemCount(); List<TimeSeriesDataItem> getItems(); int getMaximumItemCount(); void setMaximumItemCount(int maximum); long getMaximumItemAge(); void setMaximumItemAge(long periods); Range findValueRange(); Range findValueRange(Range xRange, TimeZone timeZone); Range findValueRange(Range xRange, TimePeriodAnchor xAnchor, 
            TimeZone zone); double getMinY(); double getMaxY(); Class getTimePeriodClass(); TimeSeriesDataItem getDataItem(int index); TimeSeriesDataItem getDataItem(RegularTimePeriod period); RegularTimePeriod getTimePeriod(int index); RegularTimePeriod getNextTimePeriod(); Collection<RegularTimePeriod> getTimePeriods(); Collection<RegularTimePeriod> getTimePeriodsUniqueToOtherSeries(TimeSeries series); int getIndex(RegularTimePeriod period); Number getValue(int index); Number getValue(RegularTimePeriod period); void add(TimeSeriesDataItem item); void add(TimeSeriesDataItem item, boolean notify); void add(RegularTimePeriod period, double value); void add(RegularTimePeriod period, double value, boolean notify); void add(RegularTimePeriod period, Number value); void add(RegularTimePeriod period, Number value, boolean notify); void update(RegularTimePeriod period, double value); void update(RegularTimePeriod period, Number value); void update(int index, Number value); TimeSeries addAndOrUpdate(TimeSeries series); TimeSeriesDataItem addOrUpdate(RegularTimePeriod period,
                                          double value); TimeSeriesDataItem addOrUpdate(RegularTimePeriod period,
                                          Number value); TimeSeriesDataItem addOrUpdate(TimeSeriesDataItem item); void removeAgedItems(boolean notify); void removeAgedItems(long latest, boolean notify); void clear(); void delete(RegularTimePeriod period); void delete(int start, int end); void delete(int start, int end, boolean notify); @Override Object clone(); TimeSeries createCopy(int start, int end); TimeSeries createCopy(RegularTimePeriod start, RegularTimePeriod end); @Override boolean equals(Object obj); @Override int hashCode(); }
TimeSeries extends Series implements Cloneable, Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof TimeSeries)) { return false; } TimeSeries that = (TimeSeries) obj; if (!ObjectUtilities.equal(getDomainDescription(), that.getDomainDescription())) { return false; } if (!ObjectUtilities.equal(getRangeDescription(), that.getRangeDescription())) { return false; } if (!ObjectUtilities.equal(this.timePeriodClass, that.timePeriodClass)) { return false; } if (getMaximumItemAge() != that.getMaximumItemAge()) { return false; } if (getMaximumItemCount() != that.getMaximumItemCount()) { return false; } int count = getItemCount(); if (count != that.getItemCount()) { return false; } if (!ObjectUtilities.equal(this.data, that.data)) { return false; } return super.equals(obj); } TimeSeries(Comparable name);  TimeSeries(Comparable name, String domain, String range); String getDomainDescription(); void setDomainDescription(String description); String getRangeDescription(); void setRangeDescription(String description); @Override int getItemCount(); List<TimeSeriesDataItem> getItems(); int getMaximumItemCount(); void setMaximumItemCount(int maximum); long getMaximumItemAge(); void setMaximumItemAge(long periods); Range findValueRange(); Range findValueRange(Range xRange, TimeZone timeZone); Range findValueRange(Range xRange, TimePeriodAnchor xAnchor, 
            TimeZone zone); double getMinY(); double getMaxY(); Class getTimePeriodClass(); TimeSeriesDataItem getDataItem(int index); TimeSeriesDataItem getDataItem(RegularTimePeriod period); RegularTimePeriod getTimePeriod(int index); RegularTimePeriod getNextTimePeriod(); Collection<RegularTimePeriod> getTimePeriods(); Collection<RegularTimePeriod> getTimePeriodsUniqueToOtherSeries(TimeSeries series); int getIndex(RegularTimePeriod period); Number getValue(int index); Number getValue(RegularTimePeriod period); void add(TimeSeriesDataItem item); void add(TimeSeriesDataItem item, boolean notify); void add(RegularTimePeriod period, double value); void add(RegularTimePeriod period, double value, boolean notify); void add(RegularTimePeriod period, Number value); void add(RegularTimePeriod period, Number value, boolean notify); void update(RegularTimePeriod period, double value); void update(RegularTimePeriod period, Number value); void update(int index, Number value); TimeSeries addAndOrUpdate(TimeSeries series); TimeSeriesDataItem addOrUpdate(RegularTimePeriod period,
                                          double value); TimeSeriesDataItem addOrUpdate(RegularTimePeriod period,
                                          Number value); TimeSeriesDataItem addOrUpdate(TimeSeriesDataItem item); void removeAgedItems(boolean notify); void removeAgedItems(long latest, boolean notify); void clear(); void delete(RegularTimePeriod period); void delete(int start, int end); void delete(int start, int end, boolean notify); @Override Object clone(); TimeSeries createCopy(int start, int end); TimeSeries createCopy(RegularTimePeriod start, RegularTimePeriod end); @Override boolean equals(Object obj); @Override int hashCode();  }