Dashboard Builder Data Provider API 6.0.0.Beta3

org.jboss.dashboard.dataset
Interface DataSet


public interface DataSet

A data set represents a matrix of data with a fixed number of properties and a fixed number of rows.


Method Summary
 void filter(DataFilter filter)
          Filter the dataset.
 void formatXMLProperties(PrintWriter out, int indent)
          Returns an XML string with the definition of the data set properties.
 DataProvider getDataProvider()
          DataProvider
 DataProperty[] getProperties()
           
 DataProperty getPropertyById(String id)
          Get a property by its column index.
 DataProperty getPropertyByIndex(int column)
          Get a property by its id
 int getPropertyColumn(DataProperty property)
          Get a property column position in the dataset.
 List getPropertyValues(DataProperty p)
          Get all values encountered for the specified column.
 Map getRowAsMap(int row)
          Get all the values for a given row.
 Object[] getRowAt(int row)
          Get all the values for a given row.
 int getRowCount()
          Get the number of rows in the dataset.
 Object getValueAt(int row, int column)
          Get the value at a given cell.
 List getValuesAt(int column)
          Get all the values at a given column.
 DataSet groupBy(DataProperty property, List<DataProperty> groupByProps, List<String> functionCodes)
          Groups this data set.
 void parseXMLProperties(NodeList nodes)
          It updates the dataset properties with the definition coming from the specified XML.
 void setDataProvider(DataProvider dataProvider)
           
 DataSet sort(ComparatorByCriteria comparator)
          Sorts this data set.
 

Method Detail

getDataProvider

DataProvider getDataProvider()
DataProvider


setDataProvider

void setDataProvider(DataProvider dataProvider)

getProperties

DataProperty[] getProperties()

getPropertyValues

List getPropertyValues(DataProperty p)
Get all values encountered for the specified column. No matter if duplicates exists.


getPropertyByIndex

DataProperty getPropertyByIndex(int column)
Get a property by its id


getPropertyById

DataProperty getPropertyById(String id)
Get a property by its column index.


getPropertyColumn

int getPropertyColumn(DataProperty property)
Get a property column position in the dataset.


getRowCount

int getRowCount()
Get the number of rows in the dataset.


getValueAt

Object getValueAt(int row,
                  int column)
Get the value at a given cell.

Parameters:
row - The cell row (the first row is 0).
column - The cell column (the first column is 0).

getValuesAt

List getValuesAt(int column)
Get all the values at a given column.

Parameters:
column - The cell column (the first column is 0).

getRowAt

Object[] getRowAt(int row)
Get all the values for a given row.

Parameters:
row - The row position (the first row is 0).
Returns:
An array of objects representing the row.

getRowAsMap

Map getRowAsMap(int row)
Get all the values for a given row.

Parameters:
row - The row position (the first row is 0).
Returns:
A map of [property identifier, value (Object)].

filter

void filter(DataFilter filter)
            throws Exception
Filter the dataset.

Throws:
Exception

groupBy

DataSet groupBy(DataProperty property,
                List<DataProperty> groupByProps,
                List<String> functionCodes)
Groups this data set.

Parameters:
property - The property to group for.
groupByProps - The list of DataProperty instances to be include in the resulting data set.
functionCodes - The scalar function codes to apply to each property of the resulting data set.
Returns:
A new data set instance containing the group by calculations.

sort

DataSet sort(ComparatorByCriteria comparator)
Sorts this data set. NOTE: Implemented for single column sorting.

Parameters:
comparator - Comparator used to compare elements.
Returns:
Sorted data set.

formatXMLProperties

void formatXMLProperties(PrintWriter out,
                         int indent)
                         throws Exception
Returns an XML string with the definition of the data set properties.

Throws:
Exception

parseXMLProperties

void parseXMLProperties(NodeList nodes)
                        throws Exception
It updates the dataset properties with the definition coming from the specified XML.

Throws:
Exception

Dashboard Builder Data Provider API 6.0.0.Beta3

Copyright © 2012-2013 JBoss by Red Hat. All Rights Reserved.