/** * Returns the i index value of the specified Mij matrix item in the * specified matrix series. * * @param seriesIndex zero-based series index. * @param itemIndex zero-based item index. * * @return The i index value for the specified matrix item. * * @see org.jfree.data.xy.XYDataset#getYValue(int, int) */ public Number getY(int seriesIndex, int itemIndex) { MatrixSeries series = (MatrixSeries) this.seriesList.get(seriesIndex); int y = series.getItemRow(itemIndex); return new Integer(y); // I know it's bad to create object. better idea? }
/** * Returns the i index value of the specified Mij matrix item in the * specified matrix series. * * @param seriesIndex zero-based series index. * @param itemIndex zero-based item index. * * @return The i index value for the specified matrix item. * * @see org.jfree.data.xy.XYDataset#getYValue(int, int) */ @Override public Number getY(int seriesIndex, int itemIndex) { MatrixSeries series = (MatrixSeries) this.seriesList.get(seriesIndex); int y = series.getItemRow(itemIndex); return new Integer(y); // I know it's bad to create object. better idea? }
/** * Return the matrix item at the specified index. Note that this method * creates a new {@code double} instance every time it is called. * * @param itemIndex item index. * * @return The matrix item at the specified index. * * @see #get(int, int) */ public Number getItem(int itemIndex) { int i = getItemRow(itemIndex); int j = getItemColumn(itemIndex); Number n = new Double(get(i, j)); return n; }
/** * Return the matrix item at the specified index. Note that this method * creates a new <code>Double</code> instance every time it is called. * * @param itemIndex item index. * * @return The matrix item at the specified index. * * @see #get(int, int) */ public Number getItem(int itemIndex) { int i = getItemRow(itemIndex); int j = getItemColumn(itemIndex); Number n = new Double(get(i, j)); return n; }