/** * Deletes data from start until end index (end inclusive) and sends a * {@link SeriesChangeEvent} to all registered listeners. * * @param start the index of the first period to delete. * @param end the index of the last period to delete. */ public void delete(int start, int end) { for (int i = 0; i <= (end - start); i++) { this.data.remove(start); } recalculateBounds(); fireSeriesChanged(); }
/** * Deletes data from start until end index (end inclusive) and sends a * {@link SeriesChangeEvent} to all registered listeners. * * @param start the index of the first period to delete. * @param end the index of the last period to delete. */ public void delete(int start, int end) { for (int i = 0; i <= (end - start); i++) { this.data.remove(start); } recalculateBounds(); fireSeriesChanged(); }
/** * Adds a data item to the series and sends a {@link SeriesChangeEvent} to * all registered listeners. * * @param item the item (<code>null</code> not permitted). */ 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(); }
/** * Adds a data item to the series and sends a {@link SeriesChangeEvent} to * all registered listeners. * * @param item the item ({@code null} not permitted). */ public void add(TimePeriodValue item) { Args.nullNotPermitted(item, "item"); this.data.add(item); updateBounds(item.getPeriod(), this.data.size() - 1); fireSeriesChanged(); }
/** * Updates (changes) the value of a data item and sends a * {@link SeriesChangeEvent} to all registered listeners. * * @param index the index of the data item to update. * @param value the new value ({@code null} not permitted). */ public void update(int index, Number value) { TimePeriodValue item = getDataItem(index); item.setValue(value); fireSeriesChanged(); }
/** * Updates (changes) the value of a data item and sends a * {@link SeriesChangeEvent} to all registered listeners. * * @param index the index of the data item to update. * @param value the new value (<code>null</code> not permitted). */ public void update(int index, Number value) { TimePeriodValue item = getDataItem(index); item.setValue(value); fireSeriesChanged(); }