/** * Returns the y-value for one item within a series. This maps to the * {@link #getWindForce(int, int)} method and is implemented because * {@code WindDataset} is an extension of {@link XYDataset}. * * @param series the series (zero-based index). * @param item the item (zero-based index). * * @return The y-value for the item within the series. */ @Override public Number getY(int series, int item) { return getWindForce(series, item); }
/** * Constructs a dataset based on the specified data array. * * @param data the data ({@code null} not permitted). * * @throws NullPointerException if {@code data} is {@code null}. */ public DefaultWindDataset(Object[][][] data) { this(seriesNameListFromDataArray(data), data); }
/** * Returns the key for a series. * * @param series the series (zero-based index). * * @return The series key. */ @Override public Comparable getSeriesKey(int series) { if (series < 0 || series >= getSeriesCount()) { throw new IllegalArgumentException("Invalid series index: " + series); } return (Comparable) this.seriesKeys.get(series); }
/** * transfer a XYZModel into JFreeChart WindDataset. * @since 3.5.0 */ private WindDataset XYZModelToWindDataset(XYZModel model) { final Collection allseries = model.getSeries(); final int ssize = allseries.size(); final Object[][][] wobjs = new Object[ssize][][]; int k = 0; for (final Iterator it = allseries.iterator(); it.hasNext();++k) { final Comparable seriesKey = (Comparable) it.next(); final int size = model.getDataCount(seriesKey); final Object[][] data = new Object[size][3]; wobjs[k] = data; for(int j = 0; j < size; ++j) { data[j][0] = model.getX(seriesKey, j); data[j][1] = model.getY(seriesKey, j); data[j][2] = model.getZ(seriesKey, j); } } return new DefaultWindDataset((List)allseries, wobjs); }
/** * Returns the key for a series. * * @param series the series (zero-based index). * * @return The series key. */ public Comparable getSeriesKey(int series) { if (series < 0 || series >= getSeriesCount()) { throw new IllegalArgumentException("Invalid series index: " + series); } return (Comparable) this.seriesKeys.get(series); }
/** * Returns the number of items in a series. * * @param series the series (zero-based index). * * @return The item count. */ public int getItemCount(int series) { if (series < 0 || series >= getSeriesCount()) { throw new IllegalArgumentException("Invalid series index: " + series); } List oneSeriesData = (List) this.allSeriesData.get(series); return oneSeriesData.size(); }
/** * Constructs a dataset based on the specified data array. * * @param data the data (<code>null</code> not permitted). * * @throws NullPointerException if <code>data</code> is <code>null</code>. */ public DefaultWindDataset(Object[][][] data) { this(seriesNameListFromDataArray(data), data); }
/** * Returns the y-value for one item within a series. This maps to the * {@link #getWindForce(int, int)} method and is implemented because * <code>WindDataset</code> is an extension of {@link XYDataset}. * * @param series the series (zero-based index). * @param item the item (zero-based index). * * @return The y-value for the item within the series. */ public Number getY(int series, int item) { return getWindForce(series, item); }
/** * Returns the number of items in a series. * * @param series the series (zero-based index). * * @return The item count. */ @Override public int getItemCount(int series) { if (series < 0 || series >= getSeriesCount()) { throw new IllegalArgumentException("Invalid series index: " + series); } List oneSeriesData = (List) this.allSeriesData.get(series); return oneSeriesData.size(); }