org.eclipse.birt.chart.datafeed
Class ResultSetWrapper

java.lang.Object
  extended byorg.eclipse.birt.chart.datafeed.ResultSetWrapper

public final class ResultSetWrapper
extends java.lang.Object

Wraps an implementation specific host resultset into a chart specific resultset that may be subsequently bound to individual series associated with a chart instance.


Constructor Summary
ResultSetWrapper(java.util.Set stExpressionKeys, java.util.List liResultSet, boolean bGrouped)
          The default constructor that allows creation of a resultset wrapper
 
Method Summary
 void applySeriesGrouping(SeriesDefinition sd, java.lang.String[] saExpressionKeys)
          Groups rows of data as specified in the grouping criteria for the series definition
static int compareObjects(java.lang.Object a, java.lang.Object b)
          Compares two objects of the same data type
 int getColumnCount()
          Returns a pre-computed column count associated with the resultset wrapper instance
 int getColumnDataType(int iColumnIndex)
          Returns the data type of specified column.
 int getGroupCount()
          Returns a pre-computed group count associated with the resultset wrapper instance
 java.lang.Object getGroupKey(int iGroupIndex, int iColumnIndex)
          Extracts the group's key value that remains unchanged for a given group
 java.lang.Object getGroupKey(int iGroupIndex, java.lang.String sExpressionKey)
          Extracts the group's key value that remains unchanged for a given group
 int getGroupRowCount(int iGroupIndex)
          Returns the row count in specified group.
 java.lang.Object[] getMergedGroupingBaseValues(int iColumnIndex, SortOption sorting)
          Returns the values for given column and compute index arrays.
 int getRowCount()
          Returns the number of rows of data associated with the resultset wrapper instance
 ResultSetDataSet getSubset(org.eclipse.emf.common.util.EList elExpressions)
          Creates an instance of a resultset subset that uses references to dynamically compute a subset of the original resultset instance rather than duplicate a copy of the original resultset data content
 ResultSetDataSet getSubset(int iColumnIndex)
          Creates an instance of a resultset subset that uses references to dynamically compute a subset of the original resultset instance rather than duplicate a copy of the original resultset data content
 ResultSetDataSet getSubset(int iGroupIndex, org.eclipse.emf.common.util.EList elExpressionKeys)
          Creates an instance of a resultset subset that uses references to dynamically compute a subset of the original resultset instance rather than duplicate a copy of the original resultset data content
 ResultSetDataSet getSubset(int iGroupIndex, int iColumnIndex)
          Creates an instance of a resultset subset that uses references to dynamically compute a subset of the original resultset instance rather than duplicate a copy of the original resultset data content
 ResultSetDataSet getSubset(int iGroupIndex, java.lang.String sExpressionKey)
          Creates an instance of a resultset subset that uses references to dynamically compute a subset of the original resultset instance rather than duplicate a copy of the original resultset data content
 ResultSetDataSet getSubset(int iGroupIndex, java.lang.String[] sExpressionKeys)
          Creates an instance of a resultset subset that uses references to dynamically compute a subset of the original resultset instance rather than duplicate a copy of the original resultset data content
 ResultSetDataSet getSubset(java.lang.String sExpressionKey)
          Creates an instance of a resultset subset that uses references to dynamically compute a subset of the original resultset instance rather than duplicate a copy of the original resultset data content
 ResultSetDataSet getSubset(java.lang.String[] sExpressionKeys)
          Creates an instance of a resultset subset that uses references to dynamically compute a subset of the original resultset instance rather than duplicate a copy of the original resultset data content
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResultSetWrapper

public ResultSetWrapper(java.util.Set stExpressionKeys,
                        java.util.List liResultSet,
                        boolean bGrouped)
The default constructor that allows creation of a resultset wrapper

Parameters:
stExpressionKeys - The set of expressions associated with each column in the resultset
liResultSet - A list of rows that represent the actual resultset data content. Each row contains an Object[]
Method Detail

applySeriesGrouping

public final void applySeriesGrouping(SeriesDefinition sd,
                                      java.lang.String[] saExpressionKeys)
                               throws ChartException
Groups rows of data as specified in the grouping criteria for the series definition

Parameters:
sd -
Throws:
GenerationException
ChartException

getGroupCount

public final int getGroupCount()
Returns a pre-computed group count associated with the resultset wrapper instance

Returns:
A pre-computed group count associated with the resultset wrapper instance

getGroupRowCount

public final int getGroupRowCount(int iGroupIndex)
Returns the row count in specified group.

Parameters:
iGroupIndex -
Returns:

getColumnCount

public final int getColumnCount()
Returns a pre-computed column count associated with the resultset wrapper instance

Returns:
A pre-computed column count associated with the resultset wrapper instance

getRowCount

public final int getRowCount()
Returns the number of rows of data associated with the resultset wrapper instance

Returns:
The number of rows of data associated with the resultset wrapper instance

getGroupKey

public final java.lang.Object getGroupKey(int iGroupIndex,
                                          java.lang.String sExpressionKey)
Extracts the group's key value that remains unchanged for a given group

Parameters:
iGroupIndex - The group index for which the key is requested
sExpressionKey - The expression column that holds the group key value
Returns:
The group key value associated with the requested group index

getGroupKey

public final java.lang.Object getGroupKey(int iGroupIndex,
                                          int iColumnIndex)
Extracts the group's key value that remains unchanged for a given group

Parameters:
iGroupIndex - The group index for which the key is requested
iColumnIndex - The column index from which the group key value is to be extracted
Returns:
The group key value associated with the requested group index

getSubset

public final ResultSetDataSet getSubset(int iGroupIndex,
                                        java.lang.String sExpressionKey)
Creates an instance of a resultset subset that uses references to dynamically compute a subset of the original resultset instance rather than duplicate a copy of the original resultset data content

Parameters:
iGroupIndex - The group number for which a subset is requested
sExpressionKey - A single expression column for which a subset is requested
Returns:
An instance of the resultset subset

getSubset

public final ResultSetDataSet getSubset(int iGroupIndex,
                                        org.eclipse.emf.common.util.EList elExpressionKeys)
Creates an instance of a resultset subset that uses references to dynamically compute a subset of the original resultset instance rather than duplicate a copy of the original resultset data content

Parameters:
iGroupIndex - The group number for which a subset is requested
elExpressionKeys - The expression columns for which a subset is requested
Returns:
An instance of the resultset subset

getSubset

public final ResultSetDataSet getSubset(int iGroupIndex,
                                        java.lang.String[] sExpressionKeys)
Creates an instance of a resultset subset that uses references to dynamically compute a subset of the original resultset instance rather than duplicate a copy of the original resultset data content

Parameters:
iGroupIndex - The group number for which a subset is requested
sExpressionKeys - The expression columns for which a subset is requested
Returns:
An instance of the resultset subset

getSubset

public final ResultSetDataSet getSubset(int iGroupIndex,
                                        int iColumnIndex)
Creates an instance of a resultset subset that uses references to dynamically compute a subset of the original resultset instance rather than duplicate a copy of the original resultset data content

Parameters:
iGroupIndex - The group number for which a subset is requested
iColumnIndex - A single column (defined by the index) for which the subset is requested
Returns:
An instance of the resultset subset

getSubset

public final ResultSetDataSet getSubset(org.eclipse.emf.common.util.EList elExpressions)
                                 throws ChartException
Creates an instance of a resultset subset that uses references to dynamically compute a subset of the original resultset instance rather than duplicate a copy of the original resultset data content

Parameters:
elExpressions - The expression columns for which a resultset subset is being requested
Returns:
The resultset subset containing the requested columns and all rows of the resultset
Throws:
ChartException

getSubset

public final ResultSetDataSet getSubset(java.lang.String sExpressionKey)
Creates an instance of a resultset subset that uses references to dynamically compute a subset of the original resultset instance rather than duplicate a copy of the original resultset data content

Parameters:
sExpressionKey - A single expression column for which a resultset subset is being requested
Returns:
The resultset subset containing the requested column and all rows of the resultset

getSubset

public final ResultSetDataSet getSubset(java.lang.String[] sExpressionKeys)
                                 throws ChartException
Creates an instance of a resultset subset that uses references to dynamically compute a subset of the original resultset instance rather than duplicate a copy of the original resultset data content

Parameters:
sExpressionKeys - The expression columns for which a resultset subset is being requested
Returns:
The resultset subset containing the requested columns and all rows of the resultset
Throws:
ChartException

getSubset

public final ResultSetDataSet getSubset(int iColumnIndex)
Creates an instance of a resultset subset that uses references to dynamically compute a subset of the original resultset instance rather than duplicate a copy of the original resultset data content

Parameters:
iColumnIndex - A single column for which a resultset subset is being requested
Returns:
The resultset subset containing the requested column (specified by index) and all rows of the resultset

getMergedGroupingBaseValues

public final java.lang.Object[] getMergedGroupingBaseValues(int iColumnIndex,
                                                            SortOption sorting)
Returns the values for given column and compute index arrays.

Parameters:
iColumnIndex -
Returns:
an array have two return objects, first is the base value list, second is the index map for all grouped subset.

getColumnDataType

public final int getColumnDataType(int iColumnIndex)
Returns the data type of specified column.

Parameters:
iColumnIndex -
Returns:

compareObjects

public static int compareObjects(java.lang.Object a,
                                 java.lang.Object b)
Compares two objects of the same data type

Parameters:
a - Object one
b - Object two
Returns:
The result of the comparison


Copyright © 2005 Actuate Corp. All rights reserved.