@Test public void testAdd() { TimePeriodValues tpv = new TimePeriodValues("Test"); MySeriesChangeListener listener = new MySeriesChangeListener(); tpv.addChangeListener(listener); tpv.add(new TimePeriodValue(new SimpleTimePeriod(new Date(1L), new Date(3L)), 99.0)); assertEquals(99.0, tpv.getValue(0).doubleValue(), EPSILON); assertEquals(tpv, listener.getLastEvent().getSource()); try { tpv.add(null); fail("IllegalArgumentException should have been thrown on null parameter"); } catch (IllegalArgumentException e) { assertEquals("Null item not allowed.", e.getMessage()); } }
public void add(TimePeriodValue item) { if (item == null) { throw new IllegalArgumentException("Null item not allowed."); } this.data.add(item); updateBounds(item.getPeriod(), this.data.size() - 1); fireSeriesChanged(); }
TimePeriodValues extends Series implements Serializable { public void add(TimePeriodValue item) { if (item == null) { throw new IllegalArgumentException("Null item not allowed."); } this.data.add(item); updateBounds(item.getPeriod(), this.data.size() - 1); fireSeriesChanged(); } }
TimePeriodValues extends Series implements Serializable { public void add(TimePeriodValue item) { if (item == null) { throw new IllegalArgumentException("Null item not allowed."); } this.data.add(item); updateBounds(item.getPeriod(), this.data.size() - 1); fireSeriesChanged(); } TimePeriodValues(String name);  TimePeriodValues(String name, String domain, String range); }
TimePeriodValues extends Series implements Serializable { public void add(TimePeriodValue item) { if (item == null) { throw new IllegalArgumentException("Null item not allowed."); } this.data.add(item); updateBounds(item.getPeriod(), this.data.size() - 1); fireSeriesChanged(); } TimePeriodValues(String name);  TimePeriodValues(String name, String domain, String range); String getDomainDescription(); void setDomainDescription(String description); String getRangeDescription(); void setRangeDescription(String description); @Override int getItemCount(); TimePeriodValue getDataItem(int index); TimePeriod getTimePeriod(int index); Number getValue(int index); void add(TimePeriodValue item); void add(TimePeriod period, double value); void add(TimePeriod period, Number value); void update(int index, Number value); void delete(int start, int end); @Override boolean equals(Object obj); @Override int hashCode(); @Override Object clone(); TimePeriodValues createCopy(int start, int end); int getMinStartIndex(); int getMaxStartIndex(); int getMinMiddleIndex(); int getMaxMiddleIndex(); int getMinEndIndex(); int getMaxEndIndex(); }
TimePeriodValues extends Series implements Serializable { public void add(TimePeriodValue item) { if (item == null) { throw new IllegalArgumentException("Null item not allowed."); } this.data.add(item); updateBounds(item.getPeriod(), this.data.size() - 1); fireSeriesChanged(); } TimePeriodValues(String name);  TimePeriodValues(String name, String domain, String range); String getDomainDescription(); void setDomainDescription(String description); String getRangeDescription(); void setRangeDescription(String description); @Override int getItemCount(); TimePeriodValue getDataItem(int index); TimePeriod getTimePeriod(int index); Number getValue(int index); void add(TimePeriodValue item); void add(TimePeriod period, double value); void add(TimePeriod period, Number value); void update(int index, Number value); void delete(int start, int end); @Override boolean equals(Object obj); @Override int hashCode(); @Override Object clone(); TimePeriodValues createCopy(int start, int end); int getMinStartIndex(); int getMaxStartIndex(); int getMinMiddleIndex(); int getMaxMiddleIndex(); int getMinEndIndex(); int getMaxEndIndex();  }