Dashboard Builder Data Provider API 6.2.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
 DataSet 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 getPropertyByColumn(int column)
          Get a property by its column index (starting by 0)
 DataProperty getPropertyById(String id)
          Get a property by its column index.
 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 groupByProperty, int[] columns, String[] functionCodes)
          Groups this data set.
 DataSet groupBy(DataProperty groupByProperty, int[] columns, String[] functionCodes, int sortIndex, int sortOrder)
          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)
           
 int sizeOf()
          Return the estimated memory (in bytes) this data set is consuming.
 DataSet sort(Comparator 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.


getPropertyByColumn

DataProperty getPropertyByColumn(int column)
Get a property by its column index (starting by 0)


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)].

sizeOf

int sizeOf()
Return the estimated memory (in bytes) this data set is consuming.

Returns:
The number of bytes

filter

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

Returns:
A filtered data set or null if there is nothing to do with the filter specified, because it's empty or does not contains properties belonging to this data set.
Throws:
Exception

groupBy

DataSet groupBy(DataProperty groupByProperty,
                int[] columns,
                String[] functionCodes)
Groups this data set.

Parameters:
groupByProperty - The property to group for.
columns - An array of the columns to be included 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.

groupBy

DataSet groupBy(DataProperty groupByProperty,
                int[] columns,
                String[] functionCodes,
                int sortIndex,
                int sortOrder)
Groups this data set.

Parameters:
groupByProperty - The property to group for.
columns - An array of the columns to be included in the resulting data set.
functionCodes - The scalar function codes to apply to each property of the resulting data set.
sortIndex - The resulting data set column to order the result for (starting at 0 and lower than the columns array length).
sortOrder - 1=Ascending, -1=Descending, 0=None
Returns:
A new data set instance containing the group by calculations.

sort

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

Parameters:
comparator - Used to compare rows (Object[] instances).
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.2.0.Beta3

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