org.xwiki.chart.model
Class DefaultChartModel

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

public class DefaultChartModel
extends Object
implements ChartModel

Default implementation of ChartModel.

Since:
2.0M1
Version:
$Id$

Constructor Summary
DefaultChartModel(Number[][] data)
          Constructs a new DefaultChartModel with the provided data.
DefaultChartModel(Number[][] data, String[] rowHeaders, String[] columnHeaders)
          Constructs a new DefaultChartModel with the provided data and row / column headers.
 
Method Summary
 Number getCellValue(int rowIndex, int columnIndex)
          Returns the specified cell value.
 int getColumnCount()
          Number of data columns.
 String getColumnHeader(int columnIndex)
          Returns the label for the specified data column.
 int getRowCount()
          Number of data rows.
 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(Number[][] data)
Constructs a new DefaultChartModel with the provided data.

Parameters:
data - chart data.

DefaultChartModel

public DefaultChartModel(Number[][] data,
                         String[] rowHeaders,
                         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()
Description copied from interface: ChartModel
Number of data rows.

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

getColumnCount

public int getColumnCount()
Description copied from interface: ChartModel
Number of data columns.

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

getCellValue

public Number getCellValue(int rowIndex,
                           int columnIndex)
Description copied from interface: ChartModel
Returns the specified cell value.

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

getRowHeader

public String getRowHeader(int rowIndex)
Description copied from interface: ChartModel
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 String getColumnHeader(int columnIndex)
Description copied from interface: ChartModel
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-2012 XWiki. All Rights Reserved.