@Test public void testEquals() { RelativeDateFormat df1 = new RelativeDateFormat(); RelativeDateFormat df2 = new RelativeDateFormat(); assertEquals(df1, df2); df1.setBaseMillis(123L); assertFalse(df1.equals(df2)); df2.setBaseMillis(123L); assertEquals(df1, df2); df1.setDayFormatter(new DecimalFormat("0%")); assertFalse(df1.equals(df2)); df2.setDayFormatter(new DecimalFormat("0%")); assertEquals(df1, df2); df1.setDaySuffix("D"); assertFalse(df1.equals(df2)); df2.setDaySuffix("D"); assertEquals(df1, df2); df1.setHourFormatter(new DecimalFormat("0%")); assertFalse(df1.equals(df2)); df2.setHourFormatter(new DecimalFormat("0%")); assertEquals(df1, df2); df1.setHourSuffix("H"); assertFalse(df1.equals(df2)); df2.setHourSuffix("H"); assertEquals(df1, df2); df1.setMinuteFormatter(new DecimalFormat("0%")); assertFalse(df1.equals(df2)); df2.setMinuteFormatter(new DecimalFormat("0%")); assertEquals(df1, df2); df1.setMinuteSuffix("M"); assertFalse(df1.equals(df2)); df2.setMinuteSuffix("M"); assertEquals(df1, df2); df1.setSecondSuffix("S"); assertFalse(df1.equals(df2)); df2.setSecondSuffix("S"); assertEquals(df1, df2); df1.setShowZeroDays(!df1.getShowZeroDays()); assertFalse(df1.equals(df2)); df2.setShowZeroDays(!df2.getShowZeroDays()); assertEquals(df1, df2); df1.setSecondFormatter(new DecimalFormat("0.0")); assertFalse(df1.equals(df2)); df2.setSecondFormatter(new DecimalFormat("0.0")); assertEquals(df1, df2); }
@Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof RelativeDateFormat)) { return false; } if (!super.equals(obj)) { return false; } RelativeDateFormat that = (RelativeDateFormat) obj; if (this.baseMillis != that.baseMillis) { return false; } if (this.showZeroDays != that.showZeroDays) { return false; } if (this.showZeroHours != that.showZeroHours) { return false; } if (!this.positivePrefix.equals(that.positivePrefix)) { return false; } if (!this.daySuffix.equals(that.daySuffix)) { return false; } if (!this.hourSuffix.equals(that.hourSuffix)) { return false; } if (!this.minuteSuffix.equals(that.minuteSuffix)) { return false; } if (!this.secondSuffix.equals(that.secondSuffix)) { return false; } if (!this.dayFormatter.equals(that.dayFormatter)) { return false; } if (!this.hourFormatter.equals(that.hourFormatter)) { return false; } if (!this.minuteFormatter.equals(that.minuteFormatter)) { return false; } if (!this.secondFormatter.equals(that.secondFormatter)) { return false; } return true; }
RelativeDateFormat extends DateFormat { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof RelativeDateFormat)) { return false; } if (!super.equals(obj)) { return false; } RelativeDateFormat that = (RelativeDateFormat) obj; if (this.baseMillis != that.baseMillis) { return false; } if (this.showZeroDays != that.showZeroDays) { return false; } if (this.showZeroHours != that.showZeroHours) { return false; } if (!this.positivePrefix.equals(that.positivePrefix)) { return false; } if (!this.daySuffix.equals(that.daySuffix)) { return false; } if (!this.hourSuffix.equals(that.hourSuffix)) { return false; } if (!this.minuteSuffix.equals(that.minuteSuffix)) { return false; } if (!this.secondSuffix.equals(that.secondSuffix)) { return false; } if (!this.dayFormatter.equals(that.dayFormatter)) { return false; } if (!this.hourFormatter.equals(that.hourFormatter)) { return false; } if (!this.minuteFormatter.equals(that.minuteFormatter)) { return false; } if (!this.secondFormatter.equals(that.secondFormatter)) { return false; } return true; } }
RelativeDateFormat extends DateFormat { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof RelativeDateFormat)) { return false; } if (!super.equals(obj)) { return false; } RelativeDateFormat that = (RelativeDateFormat) obj; if (this.baseMillis != that.baseMillis) { return false; } if (this.showZeroDays != that.showZeroDays) { return false; } if (this.showZeroHours != that.showZeroHours) { return false; } if (!this.positivePrefix.equals(that.positivePrefix)) { return false; } if (!this.daySuffix.equals(that.daySuffix)) { return false; } if (!this.hourSuffix.equals(that.hourSuffix)) { return false; } if (!this.minuteSuffix.equals(that.minuteSuffix)) { return false; } if (!this.secondSuffix.equals(that.secondSuffix)) { return false; } if (!this.dayFormatter.equals(that.dayFormatter)) { return false; } if (!this.hourFormatter.equals(that.hourFormatter)) { return false; } if (!this.minuteFormatter.equals(that.minuteFormatter)) { return false; } if (!this.secondFormatter.equals(that.secondFormatter)) { return false; } return true; } RelativeDateFormat();  RelativeDateFormat(Date time);  RelativeDateFormat(long baseMillis); }
RelativeDateFormat extends DateFormat { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof RelativeDateFormat)) { return false; } if (!super.equals(obj)) { return false; } RelativeDateFormat that = (RelativeDateFormat) obj; if (this.baseMillis != that.baseMillis) { return false; } if (this.showZeroDays != that.showZeroDays) { return false; } if (this.showZeroHours != that.showZeroHours) { return false; } if (!this.positivePrefix.equals(that.positivePrefix)) { return false; } if (!this.daySuffix.equals(that.daySuffix)) { return false; } if (!this.hourSuffix.equals(that.hourSuffix)) { return false; } if (!this.minuteSuffix.equals(that.minuteSuffix)) { return false; } if (!this.secondSuffix.equals(that.secondSuffix)) { return false; } if (!this.dayFormatter.equals(that.dayFormatter)) { return false; } if (!this.hourFormatter.equals(that.hourFormatter)) { return false; } if (!this.minuteFormatter.equals(that.minuteFormatter)) { return false; } if (!this.secondFormatter.equals(that.secondFormatter)) { return false; } return true; } RelativeDateFormat();  RelativeDateFormat(Date time);  RelativeDateFormat(long baseMillis); long getBaseMillis(); void setBaseMillis(long baseMillis); boolean getShowZeroDays(); void setShowZeroDays(boolean show); boolean getShowZeroHours(); void setShowZeroHours(boolean show); String getPositivePrefix(); void setPositivePrefix(String prefix); void setDayFormatter(NumberFormat formatter); String getDaySuffix(); void setDaySuffix(String suffix); void setHourFormatter(NumberFormat formatter); String getHourSuffix(); void setHourSuffix(String suffix); void setMinuteFormatter(NumberFormat formatter); String getMinuteSuffix(); void setMinuteSuffix(String suffix); String getSecondSuffix(); void setSecondSuffix(String suffix); void setSecondFormatter(NumberFormat formatter); @Override StringBuffer format(Date date, StringBuffer toAppendTo,
                               FieldPosition fieldPosition); @Override Date parse(String source, ParsePosition pos); @Override boolean equals(Object obj); @Override int hashCode(); @Override Object clone(); static void main(String[] args); }
RelativeDateFormat extends DateFormat { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof RelativeDateFormat)) { return false; } if (!super.equals(obj)) { return false; } RelativeDateFormat that = (RelativeDateFormat) obj; if (this.baseMillis != that.baseMillis) { return false; } if (this.showZeroDays != that.showZeroDays) { return false; } if (this.showZeroHours != that.showZeroHours) { return false; } if (!this.positivePrefix.equals(that.positivePrefix)) { return false; } if (!this.daySuffix.equals(that.daySuffix)) { return false; } if (!this.hourSuffix.equals(that.hourSuffix)) { return false; } if (!this.minuteSuffix.equals(that.minuteSuffix)) { return false; } if (!this.secondSuffix.equals(that.secondSuffix)) { return false; } if (!this.dayFormatter.equals(that.dayFormatter)) { return false; } if (!this.hourFormatter.equals(that.hourFormatter)) { return false; } if (!this.minuteFormatter.equals(that.minuteFormatter)) { return false; } if (!this.secondFormatter.equals(that.secondFormatter)) { return false; } return true; } RelativeDateFormat();  RelativeDateFormat(Date time);  RelativeDateFormat(long baseMillis); long getBaseMillis(); void setBaseMillis(long baseMillis); boolean getShowZeroDays(); void setShowZeroDays(boolean show); boolean getShowZeroHours(); void setShowZeroHours(boolean show); String getPositivePrefix(); void setPositivePrefix(String prefix); void setDayFormatter(NumberFormat formatter); String getDaySuffix(); void setDaySuffix(String suffix); void setHourFormatter(NumberFormat formatter); String getHourSuffix(); void setHourSuffix(String suffix); void setMinuteFormatter(NumberFormat formatter); String getMinuteSuffix(); void setMinuteSuffix(String suffix); String getSecondSuffix(); void setSecondSuffix(String suffix); void setSecondFormatter(NumberFormat formatter); @Override StringBuffer format(Date date, StringBuffer toAppendTo,
                               FieldPosition fieldPosition); @Override Date parse(String source, ParsePosition pos); @Override boolean equals(Object obj); @Override int hashCode(); @Override Object clone(); static void main(String[] args);  }