本文整理了Java中org.jfree.data.xy.XYSeries.indexOf()
方法的一些代码示例,展示了XYSeries.indexOf()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XYSeries.indexOf()
方法的具体详情如下:
包路径:org.jfree.data.xy.XYSeries
类名称:XYSeries
方法名:indexOf
[英]Returns the index of the item with the specified x-value, or a negative index if the series does not contain an item with that x-value. Be aware that for an unsorted series, the index is found by iterating through all items in the series.
[中]
代码示例来源:origin: jfree/jfreechart
/**
* 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));
}
代码示例来源:origin: org.codehaus.jtstand/jtstand-chart
/**
* 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));
}
代码示例来源:origin: jfree/jfreechart
/**
* 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;
}
代码示例来源:origin: org.codehaus.jtstand/jtstand-chart
/**
* 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;
}
代码示例来源:origin: jfree/jfreechart
/**
* 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);
}
代码示例来源:origin: org.codehaus.jtstand/jtstand-chart
/**
* 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);
}
}
代码示例来源:origin: org.codehaus.jtstand/jtstand-chart
int index = indexOf(item.getX());
if (index >= 0) {
throw new SeriesException("X-value already exists.");
代码示例来源:origin: jfree/jfreechart
int index = indexOf(item.getX());
if (index >= 0) {
throw new SeriesException("X-value already exists.");
代码示例来源:origin: mikaelhg/openblocks
/**
* 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);
}
}
}
}
代码示例来源:origin: org.jboss.jbossts/jbossjta
int cindex = _dataSeries[0].indexOf(counter);
int slices = periodSelectSlider.getValue();
int lb = cindex < slices ? 0 : cindex - slices;
代码示例来源:origin: org.codehaus.jtstand/jtstand-chart
int index = indexOf(item.getX());
if (index >= 0) {
XYDataItem existing = (XYDataItem) this.data.get(index);
代码示例来源:origin: jfree/jfreechart
int index = indexOf(item.getX());
if (index >= 0) {
XYDataItem existing = (XYDataItem) this.data.get(index);
内容来源于网络,如有侵权,请联系作者删除!