org.eclipse.birt.data.engine.api.querydefn
Class GroupDefinition

java.lang.Object
  extended by org.eclipse.birt.data.engine.api.querydefn.BaseTransform
      extended by org.eclipse.birt.data.engine.api.querydefn.GroupDefinition
All Implemented Interfaces:
IBaseTransform, IGroupDefinition

public class GroupDefinition
extends BaseTransform
implements IGroupDefinition

Default implementation of IGroupDefinition.


Field Summary
protected  int interval
           
protected  double intervalRange
           
protected  java.lang.Object intervalStart
           
protected  java.lang.String keyColumn
           
protected  java.lang.String keyExpr
           
protected  java.lang.String name
           
protected  int sortDirection
           
 
Fields inherited from class org.eclipse.birt.data.engine.api.querydefn.BaseTransform
AFTER_LAST_ROW, afterExpressions, BEFORE_FIRST_ROW, beforeExpressions, filters, ON_EACH_ROW, rowExpressions, sorts, subqueries
 
Fields inherited from interface org.eclipse.birt.data.engine.api.IGroupDefinition
DAY_INTERVAL, HOUR_INTERVAL, MINUTE_INTERVAL, MONTH_INTERVAL, NO_INTERVAL, NO_SORT, NUMERIC_INTERVAL, QUARTER_INTERVAL, SECOND_INTERVAL, SORT_ASC, SORT_DESC, STRING_PREFIX_INTERVAL, WEEK_INTERVAL, YEAR_INTERVAL
 
Constructor Summary
GroupDefinition()
          Deprecated.  
GroupDefinition(java.lang.String name)
          Constructs a group with the given name
 
Method Summary
 int getInterval()
          Returns the interval for grouping on a range of contiguous group key values.
 double getIntervalRange()
          Returns the number of contiguous group intervals that form one single group, when Interval is used to define group break level.
 java.lang.Object getIntervalStart()
          Gets the starting value for the first interval
 java.lang.String getKeyColumn()
          Returns the name of the column that defines the group key.
 java.lang.String getKeyExpression()
          Returns the JavaScript expression that defines the group key.
 java.lang.String getName()
          Returns the name of the group
 int getSortDirection()
          Returns the sort direction on the group key.
 void setInterval(int interval)
           
 void setIntervalRange(double intervalRange)
           
 void setIntervalStart(java.lang.Object start)
           
 void setKeyColumn(java.lang.String keyColumn)
           
 void setKeyExpression(java.lang.String keyExpr)
           
 void setSortDirection(int sortDirection)
           
 
Methods inherited from class org.eclipse.birt.data.engine.api.querydefn.BaseTransform
addFilter, addSort, addSubquery, getFilters, getSorts, getSubqueries
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.birt.data.engine.api.IBaseTransform
getFilters, getSorts, getSubqueries
 

Field Detail

name

protected java.lang.String name

keyExpr

protected java.lang.String keyExpr

keyColumn

protected java.lang.String keyColumn

interval

protected int interval

intervalRange

protected double intervalRange

sortDirection

protected int sortDirection

intervalStart

protected java.lang.Object intervalStart
Constructor Detail

GroupDefinition

public GroupDefinition(java.lang.String name)
Constructs a group with the given name


GroupDefinition

public GroupDefinition()
Deprecated. 

Constructs an unnamed group

Method Detail

getName

public java.lang.String getName()
Returns the name of the group

Specified by:
getName in interface IGroupDefinition
Returns:
Name of group. Can be null if group is unnamed.

getInterval

public int getInterval()
Returns the interval for grouping on a range of contiguous group key values. Interval can be year, months, day, etc.

Specified by:
getInterval in interface IGroupDefinition
Returns:
the grouping interval

getSortDirection

public int getSortDirection()
Returns the sort direction on the group key. Use this to specify a sort in the common case where the groups are ordered by the group key only. To specify other types of sort criteria, use the Sorts property. SortDirection is ignored if Sorts is defined for this group.

Specified by:
getSortDirection in interface IGroupDefinition
Returns:
The group key sort direction. If no direction is specified, NO_SORT is returned. This means that the data engine can choose any sort order, or no sort order at all, for this group level.

getIntervalRange

public double getIntervalRange()
Returns the number of contiguous group intervals that form one single group, when Interval is used to define group break level. For example, if Interval is MONTH_INTERVAL, and IntervalRange is 6, each group is defined to contain a span of 6 months.

Specified by:
getIntervalRange in interface IGroupDefinition

getIntervalStart

public java.lang.Object getIntervalStart()
Gets the starting value for the first interval

Specified by:
getIntervalStart in interface IGroupDefinition

getKeyColumn

public java.lang.String getKeyColumn()
Returns the name of the column that defines the group key. Either the KeyColumn or KeyExpr can be used to define the group key.

Specified by:
getKeyColumn in interface IGroupDefinition

getKeyExpression

public java.lang.String getKeyExpression()
Returns the JavaScript expression that defines the group key.
Note: Presently group key must be a column. If an JavaScript expression is used to specify the group key, the expression must be in the form of row.column_name, or row["column_name"].

Specified by:
getKeyExpression in interface IGroupDefinition

setInterval

public void setInterval(int interval)
Parameters:
interval - The interval to set.

setIntervalRange

public void setIntervalRange(double intervalRange)
Parameters:
intervalRange - The intervalRange to set.

setIntervalStart

public void setIntervalStart(java.lang.Object start)
Parameters:
start - a start value for the first interval

setKeyColumn

public void setKeyColumn(java.lang.String keyColumn)
Parameters:
keyColumn - Name of the column to group by

setKeyExpression

public void setKeyExpression(java.lang.String keyExpr)
Parameters:
keyExpr - Key expression to group by

setSortDirection

public void setSortDirection(int sortDirection)
Parameters:
sortDirection - The sortDirection to set.


Copyright © 2008 Actuate Corp. All rights reserved.