@Test public void testSerialization() throws IOException, ClassNotFoundException { TaskSeries s1 = new TaskSeries("S"); s1.add(new Task("T1", new Date(1), new Date(2))); s1.add(new Task("T2", new Date(11), new Date(22))); TaskSeries s2 = new TaskSeries("S"); s2.add(new Task("T1", new Date(1), new Date(2))); s2.add(new Task("T2", new Date(11), new Date(22))); TaskSeriesCollection c1 = new TaskSeriesCollection(); c1.add(s1); c1.add(s2); ByteArrayOutputStream buffer = new ByteArrayOutputStream(); ObjectOutput out = new ObjectOutputStream(buffer); out.writeObject(c1); out.close(); ObjectInput in = new ObjectInputStream(new ByteArrayInputStream( buffer.toByteArray())); TaskSeriesCollection c2 = (TaskSeriesCollection) in.readObject(); in.close(); assertEquals(c1, c2); }
public void add(TaskSeries series) { if (series == null) { throw new IllegalArgumentException("Null 'series' argument."); } this.data.add(series); series.addChangeListener(this); for (Task task : series.getTasks()) { String key = task.getDescription(); int index = this.keys.indexOf(key); if (index < 0) { this.keys.add(key); } } fireDatasetChanged(); }
TaskSeriesCollection extends AbstractSeriesDataset implements GanttCategoryDataset, Cloneable, PublicCloneable,
                   Serializable { public void add(TaskSeries series) { if (series == null) { throw new IllegalArgumentException("Null 'series' argument."); } this.data.add(series); series.addChangeListener(this); for (Task task : series.getTasks()) { String key = task.getDescription(); int index = this.keys.indexOf(key); if (index < 0) { this.keys.add(key); } } fireDatasetChanged(); } }
TaskSeriesCollection extends AbstractSeriesDataset implements GanttCategoryDataset, Cloneable, PublicCloneable,
                   Serializable { public void add(TaskSeries series) { if (series == null) { throw new IllegalArgumentException("Null 'series' argument."); } this.data.add(series); series.addChangeListener(this); for (Task task : series.getTasks()) { String key = task.getDescription(); int index = this.keys.indexOf(key); if (index < 0) { this.keys.add(key); } } fireDatasetChanged(); } TaskSeriesCollection(); }
TaskSeriesCollection extends AbstractSeriesDataset implements GanttCategoryDataset, Cloneable, PublicCloneable,
                   Serializable { public void add(TaskSeries series) { if (series == null) { throw new IllegalArgumentException("Null 'series' argument."); } this.data.add(series); series.addChangeListener(this); for (Task task : series.getTasks()) { String key = task.getDescription(); int index = this.keys.indexOf(key); if (index < 0) { this.keys.add(key); } } fireDatasetChanged(); } TaskSeriesCollection(); TaskSeries getSeries(Comparable key); TaskSeries getSeries(int series); @Override int getSeriesCount(); @Override Comparable getSeriesKey(int series); @Override int getRowCount(); @Override List getRowKeys(); @Override int getColumnCount(); @Override List<Comparable> getColumnKeys(); @Override Comparable getColumnKey(int index); @Override int getColumnIndex(Comparable columnKey); @Override int getRowIndex(Comparable rowKey); @Override Comparable getRowKey(int index); void add(TaskSeries series); void remove(TaskSeries series); void remove(int series); void removeAll(); @Override Number getValue(Comparable rowKey, Comparable columnKey); @Override Number getValue(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 row, int column); @Override Number getPercentComplete(int row, int column); @Override Number getPercentComplete(Comparable rowKey, Comparable columnKey); @Override int getSubIntervalCount(int row, int column); @Override int getSubIntervalCount(Comparable rowKey, Comparable columnKey); @Override Number getStartValue(int row, int column, int subinterval); @Override Number getStartValue(Comparable rowKey, Comparable columnKey,
                                int subinterval); @Override Number getEndValue(int row, int column, int subinterval); @Override Number getEndValue(Comparable rowKey, Comparable columnKey,
                              int subinterval); @Override Number getPercentComplete(int row, int column, int subinterval); @Override Number getPercentComplete(Comparable rowKey, Comparable columnKey,
                                     int subinterval); @Override void seriesChanged(SeriesChangeEvent event); @Override boolean equals(Object obj); @Override Object clone(); }
TaskSeriesCollection extends AbstractSeriesDataset implements GanttCategoryDataset, Cloneable, PublicCloneable,
                   Serializable { public void add(TaskSeries series) { if (series == null) { throw new IllegalArgumentException("Null 'series' argument."); } this.data.add(series); series.addChangeListener(this); for (Task task : series.getTasks()) { String key = task.getDescription(); int index = this.keys.indexOf(key); if (index < 0) { this.keys.add(key); } } fireDatasetChanged(); } TaskSeriesCollection(); TaskSeries getSeries(Comparable key); TaskSeries getSeries(int series); @Override int getSeriesCount(); @Override Comparable getSeriesKey(int series); @Override int getRowCount(); @Override List getRowKeys(); @Override int getColumnCount(); @Override List<Comparable> getColumnKeys(); @Override Comparable getColumnKey(int index); @Override int getColumnIndex(Comparable columnKey); @Override int getRowIndex(Comparable rowKey); @Override Comparable getRowKey(int index); void add(TaskSeries series); void remove(TaskSeries series); void remove(int series); void removeAll(); @Override Number getValue(Comparable rowKey, Comparable columnKey); @Override Number getValue(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 row, int column); @Override Number getPercentComplete(int row, int column); @Override Number getPercentComplete(Comparable rowKey, Comparable columnKey); @Override int getSubIntervalCount(int row, int column); @Override int getSubIntervalCount(Comparable rowKey, Comparable columnKey); @Override Number getStartValue(int row, int column, int subinterval); @Override Number getStartValue(Comparable rowKey, Comparable columnKey,
                                int subinterval); @Override Number getEndValue(int row, int column, int subinterval); @Override Number getEndValue(Comparable rowKey, Comparable columnKey,
                              int subinterval); @Override Number getPercentComplete(int row, int column, int subinterval); @Override Number getPercentComplete(Comparable rowKey, Comparable columnKey,
                                     int subinterval); @Override void seriesChanged(SeriesChangeEvent event); @Override boolean equals(Object obj); @Override Object clone();  }