/** * Returns the column of the specified item. * * @param itemIndex the index of the item. * * @return The column of the specified item. */ public int getItemColumn(int itemIndex) { //assert itemIndex >= 0 && itemIndex < getItemCount(); return itemIndex % getColumnsCount(); }
/** * Returns the column of the specified item. * * @param itemIndex the index of the item. * * @return The column of the specified item. */ public int getItemColumn(int itemIndex) { //assert itemIndex >= 0 && itemIndex < getItemCount(); return itemIndex % getColumnsCount(); }
/** * Returns the row of the specified item. * * @param itemIndex the index of the item. * * @return The row of the specified item. */ public int getItemRow(int itemIndex) { //assert itemIndex >= 0 && itemIndex < getItemCount(); return itemIndex / getColumnsCount(); }
/** * Returns the row of the specified item. * * @param itemIndex the index of the item. * * @return The row of the specified item. */ public int getItemRow(int itemIndex) { //assert itemIndex >= 0 && itemIndex < getItemCount(); return itemIndex / getColumnsCount(); }
/** * Returns the number of items in the series. * * @return The item count. */ @Override public int getItemCount() { return getRowCount() * getColumnsCount(); }
/** * Returns the number of items in the series. * * @return The item count. */ public int getItemCount() { return getRowCount() * getColumnsCount(); }
/** * Sets all matrix values to zero and sends a * {@link org.jfree.data.general.SeriesChangeEvent} to all registered * listeners. */ public void zeroAll() { int rows = getRowCount(); int columns = getColumnsCount(); for (int row = 0; row < rows; row++) { for (int column = 0; column < columns; column++) { this.data[row][column] = 0.0; } } fireSeriesChanged(); }
/** * Sets all matrix values to zero and sends a * {@link org.jfree.data.general.SeriesChangeEvent} to all registered * listeners. */ public void zeroAll() { int rows = getRowCount(); int columns = getColumnsCount(); for (int row = 0; row < rows; row++) { for (int column = 0; column < columns; column++) { this.data[row][column] = 0.0; } } fireSeriesChanged(); }
/** * Tests this object instance for equality with an arbitrary object. * * @param obj the object (<code>null</code> permitted). * * @return A boolean. */ public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof MatrixSeries)) { return false; } MatrixSeries that = (MatrixSeries) obj; if (!(getRowCount() == that.getRowCount())) { return false; } if (!(getColumnsCount() == that.getColumnsCount())) { return false; } for (int r = 0; r < getRowCount(); r++) { for (int c = 0; c < getColumnsCount(); c++) { if (get(r, c) != that.get(r, c)) { return false; } } } return super.equals(obj); }
return false; if (!(getColumnsCount() == that.getColumnsCount())) { return false; for (int c = 0; c < getColumnsCount(); c++) { if (get(r, c) != that.get(r, c)) { return false;