/** * Removes an item with the specified x-value and sends a * {@link SeriesChangeEvent} to all registered listeners. Note that when * a series permits multiple items with the same x-value, this method * could remove any one of the items with that x-value. * * @param x the x-value. * @return The item removed. */ public XYDataItem remove(Number x) { return remove(indexOf(x)); }
/** * Removes an item with the specified x-value and sends a * {@link SeriesChangeEvent} to all registered listeners. Note that when * a series permits multiple items with the same x-value, this method * could remove any one of the items with that x-value. * * @param x the x-value. * @return The item removed. */ public XYDataItem remove(Number x) { return remove(indexOf(x)); }
/** * Returns {@code true} if all the y-values for the specified x-value * are {@code null} and {@code false} otherwise. * * @param x the x-value. * * @return A boolean. */ protected boolean canPrune(Number x) { for (int s = 0; s < this.data.size(); s++) { XYSeries series = (XYSeries) this.data.get(s); if (series.getY(series.indexOf(x)) != null) { return false; } } return true; }
/** * Returns <code>true</code> if all the y-values for the specified x-value * are <code>null</code> and <code>false</code> otherwise. * * @param x the x-value. * * @return A boolean. */ protected boolean canPrune(Number x) { for (int s = 0; s < this.data.size(); s++) { XYSeries series = (XYSeries) this.data.get(s); if (series.getY(series.indexOf(x)) != null) { return false; } } return true; }
/** * Updates an item in the series. * * @param x the x-value ({@code null} not permitted). * @param y the y-value ({@code null} permitted). * * @throws SeriesException if there is no existing item with the specified * x-value. */ public void update(Number x, Number y) { int index = indexOf(x); if (index < 0) { throw new SeriesException("No observation for x = " + x); } updateByIndex(index, y); }
/** * Updates an item in the series. * * @param x the x-value (<code>null</code> not permitted). * @param y the y-value (<code>null</code> permitted). * * @throws SeriesException if there is no existing item with the specified * x-value. */ public void update(Number x, Number y) { int index = indexOf(x); if (index < 0) { throw new SeriesException("No observation for x = " + x); } else { updateByIndex(index, y); } }
int index = indexOf(item.getX()); if (index >= 0) { throw new SeriesException("X-value already exists.");
int index = indexOf(item.getX()); if (index >= 0) { throw new SeriesException("X-value already exists.");
/** * Clear the graph starting from the startTime. * @param startTime an x-value on the graph */ public void clearValues(int index, double startTime) { if (!lock) { XYSeries s = ((XYSeriesCollection) chart.getXYPlot().getDataset()).getSeries(index); int i = s.indexOf(startTime); if (i >= 0) { int total = s.getItemCount(); for (; i < total; total--) { s.remove(i); } } } }
int cindex = _dataSeries[0].indexOf(counter); int slices = periodSelectSlider.getValue(); int lb = cindex < slices ? 0 : cindex - slices;
int index = indexOf(item.getX()); if (index >= 0) { XYDataItem existing = (XYDataItem) this.data.get(index);
int index = indexOf(item.getX()); if (index >= 0) { XYDataItem existing = (XYDataItem) this.data.get(index);