|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.xpn.xwiki.plugin.charts.source.DefaultDataSource
public class DefaultDataSource
Field Summary | |
---|---|
protected java.lang.Number[][] |
data
|
protected java.lang.String[] |
headerColumn
|
protected java.lang.String[] |
headerRow
|
Constructor Summary | |
---|---|
DefaultDataSource()
This no-arg constructor creates an empty data source with no headers. |
|
DefaultDataSource(java.lang.Number[][] data)
This constructor creates a data source with no headers |
|
DefaultDataSource(java.lang.Number[][] data,
java.lang.String[] headerRow,
java.lang.String[] headerColumn)
This constructor creates a data source with the given data and headers |
Method Summary | |
---|---|
private void |
checkColumnIndex(int columnIndex)
|
private void |
checkHeaderColumn()
|
private void |
checkHeaderRow()
|
private void |
checkRowIndex(int rowIndex)
|
java.lang.Number[][] |
getAllCells()
|
java.lang.Number |
getCell(int rowIndex,
int colIndex)
|
java.lang.Number[] |
getColumn(int colIndex)
|
int |
getColumnCount()
The number of columns of this data source |
java.lang.String[] |
getHeaderColumn()
|
java.lang.String |
getHeaderColumnValue(int rowIndex)
|
java.lang.String[] |
getHeaderRow()
|
java.lang.String |
getHeaderRowValue(int columnIndex)
|
java.lang.Number[] |
getRow(int rowIndex)
|
int |
getRowCount()
The number of rows of this data source |
boolean |
hasHeaderColumn()
|
boolean |
hasHeaderRow()
|
void |
setCell(int rowIndex,
int colIndex,
java.lang.Number content)
Sets the value of a single cell |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.Number[][] data
protected java.lang.String[] headerRow
protected java.lang.String[] headerColumn
Constructor Detail |
---|
public DefaultDataSource()
public DefaultDataSource(java.lang.Number[][] data)
data
- A matrix containing the values of the data sourcepublic DefaultDataSource(java.lang.Number[][] data, java.lang.String[] headerRow, java.lang.String[] headerColumn)
data
- A matrix containing the values of the data sourceheaderRow
- The header row with headerRow.length == data[x].length, for x=0,data.length-1headerColumn
- The header column with headerColumn.length == data.length
java.lang.IllegalArgumentException
- Thrown when the conditions above are not satisfiedMethod Detail |
---|
public int getRowCount()
getRowCount
in interface DataSource
public int getColumnCount()
getColumnCount
in interface DataSource
public java.lang.Number getCell(int rowIndex, int colIndex) throws DataSourceException
getCell
in interface DataSource
RowIndexOutOfBoundsException
ColumnIndexOutOfBoundsException
DataSourceException
public void setCell(int rowIndex, int colIndex, java.lang.Number content) throws DataSourceException
RowIndexOutOfBoundsException
ColumnIndexOutOfBoundsException
DataSourceException
public java.lang.Number[] getRow(int rowIndex) throws DataSourceException
getRow
in interface DataSource
RowIndexOutOfBoundsException
DataSourceException
public java.lang.Number[] getColumn(int colIndex) throws DataSourceException
getColumn
in interface DataSource
ColumnIndexOutOfBoundsException
DataSourceException
public java.lang.Number[][] getAllCells() throws DataSourceException
getAllCells
in interface DataSource
DataSourceException
public boolean hasHeaderRow() throws DataSourceException
hasHeaderRow
in interface DataSource
DataSourceException
public boolean hasHeaderColumn() throws DataSourceException
hasHeaderColumn
in interface DataSource
DataSourceException
public java.lang.String getHeaderRowValue(int columnIndex) throws DataSourceException
getHeaderRowValue
in interface DataSource
NoHeaderRowException
ColumnIndexOutOfBoundsException
DataSourceException
public java.lang.String[] getHeaderRow() throws DataSourceException
getHeaderRow
in interface DataSource
NoHeaderRowException
DataSourceException
public java.lang.String getHeaderColumnValue(int rowIndex) throws DataSourceException
getHeaderColumnValue
in interface DataSource
NoHeaderColumnException
RowIndexOutOfBoundsException
DataSourceException
public java.lang.String[] getHeaderColumn() throws DataSourceException
getHeaderColumn
in interface DataSource
NoHeaderColumnException
DataSourceException
private void checkRowIndex(int rowIndex) throws RowIndexOutOfBoundsException
RowIndexOutOfBoundsException
private void checkColumnIndex(int columnIndex) throws ColumnIndexOutOfBoundsException
ColumnIndexOutOfBoundsException
private void checkHeaderRow() throws DataSourceException
DataSourceException
private void checkHeaderColumn() throws DataSourceException
DataSourceException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |