org.eclipse.birt.chart.internal.datafeed
Class ResultSetWrapper

java.lang.Object
  extended byorg.eclipse.birt.chart.internal.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(GroupingLookupHelper hmLookup, java.util.List liResultSet, GroupKey[] groupKeys)
          The default constructor that allows creation of a resultset wrapper
 
Method Summary
 void applyBaseSeriesSortingAndGrouping(SeriesDefinition sdBase, java.lang.String[] aggregationExp, 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, java.lang.String aggExp)
          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, java.lang.String aggExp)
          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, java.lang.String aggExp)
          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[] sExpressionKeys, java.lang.String aggExp)
          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, java.lang.String aggExp)
          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, java.lang.String aggExp)
          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, java.lang.String aggExp)
          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
 java.util.Iterator iterator()
          Returns the iterator of associated resultset.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResultSetWrapper

public ResultSetWrapper(GroupingLookupHelper hmLookup,
                        java.util.List liResultSet,
                        GroupKey[] groupKeys)
The default constructor that allows creation of a resultset wrapper

Parameters:
hmLookup - The map 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[]
groupKeys - An array of orthogonal grouping keys, if it's null or zero-length, no orthogonal grouping used.
Method Detail

applyBaseSeriesSortingAndGrouping

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

Throws:
ChartException

getGroupCount

public 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 int getGroupRowCount(int iGroupIndex)
Returns the row count in specified group.

Parameters:
iGroupIndex -
Returns:

getColumnCount

public 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 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 java.lang.Object getGroupKey(int iGroupIndex,
                                    java.lang.String sExpressionKey,
                                    java.lang.String aggExp)
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 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 ResultSetDataSet getSubset(int iGroupIndex,
                                  java.lang.String sExpressionKey,
                                  java.lang.String aggExp)
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 ResultSetDataSet getSubset(int iGroupIndex,
                                  org.eclipse.emf.common.util.EList elExpressionKeys,
                                  java.lang.String aggExp)
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 ResultSetDataSet getSubset(int iGroupIndex,
                                  java.lang.String[] sExpressionKeys,
                                  java.lang.String aggExp)
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 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 ResultSetDataSet getSubset(org.eclipse.emf.common.util.EList elExpressions,
                                  java.lang.String aggExp)
                           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 ResultSetDataSet getSubset(java.lang.String sExpressionKey,
                                  java.lang.String aggExp)
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 ResultSetDataSet getSubset(java.lang.String[] sExpressionKeys,
                                  java.lang.String aggExp)
                           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 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 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 int getColumnDataType(int iColumnIndex)
Returns the data type of specified column.

Parameters:
iColumnIndex -
Returns:

iterator

public java.util.Iterator iterator()
Returns the iterator of associated resultset.

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-2007 Actuate Corp. All rights reserved.