org.xwiki.chart.model
Class DefaultChartModel

java.lang.Object
  extended by org.xwiki.chart.model.DefaultChartModel
All Implemented Interfaces:
ChartModel

public class DefaultChartModel
extends java.lang.Object
implements ChartModel

Default implementation of ChartModel.

Since:
2.0M1
Version:
$Id$

Constructor Summary
DefaultChartModel(java.lang.Number[][] data)
          Constructs a new DefaultChartModel with the provided data.
DefaultChartModel(java.lang.Number[][] data, java.lang.String[] rowHeaders, java.lang.String[] columnHeaders)
          Constructs a new DefaultChartModel with the provided data and row / column headers.
 
Method Summary
 java.lang.Number getCellValue(int rowIndex, int columnIndex)
          Returns the specified cell value.
 int getColumnCount()
          Number of data columns.
 java.lang.String getColumnHeader(int columnIndex)
          Returns the label for the specified data column.
 int getRowCount()
          Number of data rows.
 java.lang.String getRowHeader(int rowIndex)
          Returns the label for the specified data row.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultChartModel

public DefaultChartModel(java.lang.Number[][] data)
Constructs a new DefaultChartModel with the provided data.

Parameters:
data - chart data.

DefaultChartModel

public DefaultChartModel(java.lang.Number[][] data,
                         java.lang.String[] rowHeaders,
                         java.lang.String[] columnHeaders)
Constructs a new DefaultChartModel with the provided data and row / column headers.

Parameters:
data - chart data.
rowHeaders - row headers.
columnHeaders - column headers.
Method Detail

getRowCount

public int getRowCount()
Number of data rows.

Specified by:
getRowCount in interface ChartModel
Returns:
number of data rows present in this model.

getColumnCount

public int getColumnCount()
Number of data columns.

Specified by:
getColumnCount in interface ChartModel
Returns:
number of data columns present in this model.

getCellValue

public java.lang.Number getCellValue(int rowIndex,
                                     int columnIndex)
Returns the specified cell value.

Specified by:
getCellValue in interface ChartModel
Parameters:
rowIndex - row index.
columnIndex - column index.
Returns:
cell value.

getRowHeader

public java.lang.String getRowHeader(int rowIndex)
Returns the label for the specified data row.

Specified by:
getRowHeader in interface ChartModel
Parameters:
rowIndex - row index.
Returns:
the label for the specified data row.

getColumnHeader

public java.lang.String getColumnHeader(int columnIndex)
Returns the label for the specified data column.

Specified by:
getColumnHeader in interface ChartModel
Parameters:
columnIndex - column index.
Returns:
the label for the specified data column.


Copyright © 2004-2011 XWiki. All Rights Reserved.