/** * Returns the j 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 j index value for the specified matrix item. * * @see org.jfree.data.xy.XYDataset#getXValue(int, int) */ @Override public Number getX(int seriesIndex, int itemIndex) { MatrixSeries series = (MatrixSeries) this.seriesList.get(seriesIndex); int x = series.getItemColumn(itemIndex); return new Integer(x); // I know it's bad to create object. better idea? }
/** * Returns the j 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 j index value for the specified matrix item. * * @see org.jfree.data.xy.XYDataset#getXValue(int, int) */ public Number getX(int seriesIndex, int itemIndex) { MatrixSeries series = (MatrixSeries) this.seriesList.get(seriesIndex); int x = series.getItemColumn(itemIndex); return new Integer(x); // 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</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; }
/** * 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; }