@Test public void testEquals() { TaskSeries s1 = new TaskSeries("Series"); s1.add(new Task("Task 1", new Date(0L), new Date(1L))); s1.add(new Task("Task 2", new Date(10L), new Date(11L))); s1.add(new Task("Task 3", new Date(20L), new Date(21L))); TaskSeriesCollection u1 = new TaskSeriesCollection(); u1.add(s1); SlidingGanttCategoryDataset d1 = new SlidingGanttCategoryDataset( u1, 0, 5); TaskSeries s2 = new TaskSeries("Series"); s2.add(new Task("Task 1", new Date(0L), new Date(1L))); s2.add(new Task("Task 2", new Date(10L), new Date(11L))); s2.add(new Task("Task 3", new Date(20L), new Date(21L))); TaskSeriesCollection u2 = new TaskSeriesCollection(); u2.add(s2); SlidingGanttCategoryDataset d2 = new SlidingGanttCategoryDataset( u2, 0, 5); assertEquals(d1, d2); d1.setFirstCategoryIndex(1); assertFalse(d1.equals(d2)); d2.setFirstCategoryIndex(1); assertEquals(d1, d2); d1.setMaximumCategoryCount(99); assertFalse(d1.equals(d2)); d2.setMaximumCategoryCount(99); assertEquals(d1, d2); s1.add(new Task("Task 2", new Date(10L), new Date(11L))); assertFalse(d1.equals(d2)); s2.add(new Task("Task 2", new Date(10L), new Date(11L))); assertEquals(d1, d2); }
@Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof SlidingGanttCategoryDataset)) { return false; } SlidingGanttCategoryDataset that = (SlidingGanttCategoryDataset) obj; if (this.firstCategoryIndex != that.firstCategoryIndex) { return false; } if (this.maximumCategoryCount != that.maximumCategoryCount) { return false; } if (!this.underlying.equals(that.underlying)) { return false; } return true; }
SlidingGanttCategoryDataset extends AbstractDataset implements GanttCategoryDataset { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof SlidingGanttCategoryDataset)) { return false; } SlidingGanttCategoryDataset that = (SlidingGanttCategoryDataset) obj; if (this.firstCategoryIndex != that.firstCategoryIndex) { return false; } if (this.maximumCategoryCount != that.maximumCategoryCount) { return false; } if (!this.underlying.equals(that.underlying)) { return false; } return true; } }
SlidingGanttCategoryDataset extends AbstractDataset implements GanttCategoryDataset { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof SlidingGanttCategoryDataset)) { return false; } SlidingGanttCategoryDataset that = (SlidingGanttCategoryDataset) obj; if (this.firstCategoryIndex != that.firstCategoryIndex) { return false; } if (this.maximumCategoryCount != that.maximumCategoryCount) { return false; } if (!this.underlying.equals(that.underlying)) { return false; } return true; } SlidingGanttCategoryDataset(GanttCategoryDataset underlying,
            int firstColumn, int maxColumns); }
SlidingGanttCategoryDataset extends AbstractDataset implements GanttCategoryDataset { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof SlidingGanttCategoryDataset)) { return false; } SlidingGanttCategoryDataset that = (SlidingGanttCategoryDataset) obj; if (this.firstCategoryIndex != that.firstCategoryIndex) { return false; } if (this.maximumCategoryCount != that.maximumCategoryCount) { return false; } if (!this.underlying.equals(that.underlying)) { return false; } return true; } SlidingGanttCategoryDataset(GanttCategoryDataset underlying,
            int firstColumn, int maxColumns); GanttCategoryDataset getUnderlyingDataset(); int getFirstCategoryIndex(); void setFirstCategoryIndex(int first); int getMaximumCategoryCount(); void setMaximumCategoryCount(int max); @Override int getColumnIndex(Comparable key); @Override Comparable getColumnKey(int column); @Override List<Comparable> getColumnKeys(); @Override int getRowIndex(Comparable key); @Override Comparable getRowKey(int row); @Override List<Comparable> getRowKeys(); @Override Number getValue(Comparable rowKey, Comparable columnKey); @Override int getColumnCount(); @Override int getRowCount(); @Override Number getValue(int row, int column); @Override Number getPercentComplete(Comparable rowKey, Comparable columnKey); @Override Number getPercentComplete(Comparable rowKey, Comparable columnKey,
            int subinterval); @Override Number getEndValue(Comparable rowKey, Comparable columnKey,
            int subinterval); @Override Number getEndValue(int row, int column, int subinterval); @Override Number getPercentComplete(int series, int category); @Override Number getPercentComplete(int row, int column, int subinterval); @Override Number getStartValue(Comparable rowKey, Comparable columnKey,
            int subinterval); @Override Number getStartValue(int row, int column, int subinterval); @Override int getSubIntervalCount(Comparable rowKey, Comparable columnKey); @Override int getSubIntervalCount(int row, int column); @Override Number getStartValue(Comparable rowKey, Comparable columnKey); @Override Number getStartValue(int row, int column); @Override Number getEndValue(Comparable rowKey, Comparable columnKey); @Override Number getEndValue(int series, int category); @Override boolean equals(Object obj); @Override Object clone(); }
SlidingGanttCategoryDataset extends AbstractDataset implements GanttCategoryDataset { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof SlidingGanttCategoryDataset)) { return false; } SlidingGanttCategoryDataset that = (SlidingGanttCategoryDataset) obj; if (this.firstCategoryIndex != that.firstCategoryIndex) { return false; } if (this.maximumCategoryCount != that.maximumCategoryCount) { return false; } if (!this.underlying.equals(that.underlying)) { return false; } return true; } SlidingGanttCategoryDataset(GanttCategoryDataset underlying,
            int firstColumn, int maxColumns); GanttCategoryDataset getUnderlyingDataset(); int getFirstCategoryIndex(); void setFirstCategoryIndex(int first); int getMaximumCategoryCount(); void setMaximumCategoryCount(int max); @Override int getColumnIndex(Comparable key); @Override Comparable getColumnKey(int column); @Override List<Comparable> getColumnKeys(); @Override int getRowIndex(Comparable key); @Override Comparable getRowKey(int row); @Override List<Comparable> getRowKeys(); @Override Number getValue(Comparable rowKey, Comparable columnKey); @Override int getColumnCount(); @Override int getRowCount(); @Override Number getValue(int row, int column); @Override Number getPercentComplete(Comparable rowKey, Comparable columnKey); @Override Number getPercentComplete(Comparable rowKey, Comparable columnKey,
            int subinterval); @Override Number getEndValue(Comparable rowKey, Comparable columnKey,
            int subinterval); @Override Number getEndValue(int row, int column, int subinterval); @Override Number getPercentComplete(int series, int category); @Override Number getPercentComplete(int row, int column, int subinterval); @Override Number getStartValue(Comparable rowKey, Comparable columnKey,
            int subinterval); @Override Number getStartValue(int row, int column, int subinterval); @Override int getSubIntervalCount(Comparable rowKey, Comparable columnKey); @Override int getSubIntervalCount(int row, int column); @Override Number getStartValue(Comparable rowKey, Comparable columnKey); @Override Number getStartValue(int row, int column); @Override Number getEndValue(Comparable rowKey, Comparable columnKey); @Override Number getEndValue(int series, int category); @Override boolean equals(Object obj); @Override Object clone();  }