List of usage examples for org.jfree.data ComparableObjectItem setObject
protected void setObject(Object y)
From source file:org.jfree.data.ComparableObjectSeries.java
/** * Updates the value of an item in the series and sends a * {@link SeriesChangeEvent} to all registered listeners. * * @param index the item (zero based index). * @param y the new value (<code>null</code> permitted). *//*from w w w . j a v a 2s.com*/ protected void updateByIndex(int index, Object y) { ComparableObjectItem item = getDataItem(index); item.setObject(y); fireSeriesChanged(); }
From source file:org.jfree.data.ComparableObjectSeries.java
/** * Updates an item in the series./*from w w w .j av a 2 s . c o m*/ * * @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. */ protected void update(Comparable x, Object y) { int index = indexOf(x); if (index < 0) { throw new SeriesException("No observation for x = " + x); } else { ComparableObjectItem item = getDataItem(index); item.setObject(y); fireSeriesChanged(); } }