net.sf.jett.tag
Class AggTag

java.lang.Object
  extended by net.sf.jett.tag.BaseTag
      extended by net.sf.jett.tag.AggTag
All Implemented Interfaces:
Tag

public class AggTag
extends BaseTag

An AggTag represents possibly many aggregate values calculated from a List of values already exposed to the context. It uses jAgg functionality and exposes the results and Aggregators used for display later.


Attributes:

Author:
Randy Gettman

Field Summary
static java.lang.String ATTR_AGGS
          Attribute that specifies the List of Aggregators to use.
static java.lang.String ATTR_AGGS_VAR
          Attribute that specifies the name of the List of exposed aggregators.
static java.lang.String ATTR_CUBE
          Attribute that specifies a data cube that should occur on the results.
static java.lang.String ATTR_GROUP_BY
          Attribute that specifies the List of group-by properties.
static java.lang.String ATTR_GROUPING_SETS
          Attribute that specifies the exact grouping sets that should occur on the results.
static java.lang.String ATTR_ITEMS
          Attribute that specifies the List of items to aggregate.
static java.lang.String ATTR_PARALLEL
          Attribute that specifies the degree of parallelism to use.
static java.lang.String ATTR_ROLLUP
          Attribute that specifies a rollup that should occur on the results.
static java.lang.String ATTR_ROLLUPS
          Attribute that specifies multiple rollups that should occur on the results.
static java.lang.String ATTR_USE_MSD
          Attribute that specifies whether to use Multiset Discrimination instead of sorting during aggregation processing.
static java.lang.String ATTR_VALUES_VAR
          Attribute that specifies the List of exposed aggregation values.
 
Fields inherited from class net.sf.jett.tag.BaseTag
ATTR_ON_PROCESSED, SPEC_SEP
 
Constructor Summary
AggTag()
           
 
Method Summary
 java.lang.String getName()
          Returns this Tag's name.
protected  java.util.List<java.lang.String> getOptionalAttributes()
          Returns a List of optional attribute names.
protected  java.util.List<java.lang.String> getRequiredAttributes()
          Returns a List of required attribute names.
 boolean process()
          Run a "group by" operation on the specified Aggregators, get the results, and expose the aggregate values and the Aggregators used.
 void validateAttributes()
          Validates the attributes for this Tag.
 
Methods inherited from class net.sf.jett.tag.BaseTag
checkAttributes, clearBlock, deleteBlock, getAttributes, getContext, getWorkbookContext, isBodiless, processTag, removeBlock, setAttributes, setBodiless, setContext, setWorkbookContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTR_ITEMS

public static final java.lang.String ATTR_ITEMS
Attribute that specifies the List of items to aggregate.

See Also:
Constant Field Values

ATTR_AGGS

public static final java.lang.String ATTR_AGGS
Attribute that specifies the List of Aggregators to use.

See Also:
Constant Field Values

ATTR_AGGS_VAR

public static final java.lang.String ATTR_AGGS_VAR
Attribute that specifies the name of the List of exposed aggregators.

See Also:
Constant Field Values

ATTR_VALUES_VAR

public static final java.lang.String ATTR_VALUES_VAR
Attribute that specifies the List of exposed aggregation values.

See Also:
Constant Field Values

ATTR_GROUP_BY

public static final java.lang.String ATTR_GROUP_BY
Attribute that specifies the List of group-by properties.

See Also:
Constant Field Values

ATTR_PARALLEL

public static final java.lang.String ATTR_PARALLEL
Attribute that specifies the degree of parallelism to use.

See Also:
Constant Field Values

ATTR_USE_MSD

public static final java.lang.String ATTR_USE_MSD
Attribute that specifies whether to use Multiset Discrimination instead of sorting during aggregation processing. This means that the results will not be sorted by the "group by" properties. It defaults to false -- don't use Multiset Discrimination, use sorting.

Since:
0.4.0
See Also:
Constant Field Values

ATTR_ROLLUP

public static final java.lang.String ATTR_ROLLUP
Attribute that specifies a rollup that should occur on the results. Specify a List of 0-based integer indexes that reference the original list of properties. E.g. when grouping by two properties, prop1 and prop2, specifying a List of {0} specifies a rollup on prop1.

Since:
0.4.0
See Also:
ATTR_GROUP_BY, Constant Field Values

ATTR_ROLLUPS

public static final java.lang.String ATTR_ROLLUPS
Attribute that specifies multiple rollups that should occur on the results. Specify a List of Lists of 0-based integer indexes that reference the original list of properties. E.g. when grouping by three properties, prop1, prop2, and prop3, specifying a List of {{0}, {1, 2}} specifies a rollup on prop1, and a separate rollup on prop2 and prop3.

Since:
0.4.0
See Also:
ATTR_GROUP_BY, Constant Field Values

ATTR_CUBE

public static final java.lang.String ATTR_CUBE
Attribute that specifies a data cube that should occur on the results. Specify a List of 0-based integer indexes that reference the original list of properties. E.g. when grouping by three properties, prop1, prop2, and prop3, specifying a List of {0, 1} specifies a cube on prop1 and prop2.

Since:
0.4.0
See Also:
ATTR_GROUP_BY, Constant Field Values

ATTR_GROUPING_SETS

public static final java.lang.String ATTR_GROUPING_SETS
Attribute that specifies the exact grouping sets that should occur on the results. Specify a List of Lists of 0-based integer indexes that reference the original list of properties. E.g. when grouping by three properties, prop1, prop2, and prop3, specifying a List of {{0}, {1, 2}, {}} specifies a grouping set on prop1, a separate grouping set on prop2 and prop3, and a third grouping set on no properties (a grand total).

Since:
0.4.0
See Also:
ATTR_GROUP_BY, Constant Field Values
Constructor Detail

AggTag

public AggTag()
Method Detail

getName

public java.lang.String getName()
Returns this Tag's name.

Returns:
This Tag's name.

getRequiredAttributes

protected java.util.List<java.lang.String> getRequiredAttributes()
Returns a List of required attribute names.

Overrides:
getRequiredAttributes in class BaseTag
Returns:
A List of required attribute names.

getOptionalAttributes

protected java.util.List<java.lang.String> getOptionalAttributes()
Returns a List of optional attribute names.

Overrides:
getOptionalAttributes in class BaseTag
Returns:
A List of optional attribute names.

validateAttributes

public void validateAttributes()
                        throws TagParseException
Validates the attributes for this Tag. The "items" attribute must be a List. The "parallel" attribute must be a positive integer (defaults to 1). The "aggs" attribute must be a semicolon-separated list of valid Aggregator specification strings. The "valuesVar" attribute must be a string that indicates the name to which the aggregate values will be exposed in the Map of beans. The "aggsVar" attribute must be a string that indicates the name of the List that contains all created Aggregators and to which that will be exposed in the Map of beans. The "groupBy" attribute must be a semicolon- separated list of properties with which to "group" aggregated calculations (defaults to no "group by" properties). The "agg" tag must have a body.

Overrides:
validateAttributes in class BaseTag
Throws:
TagParseException - If the attribute values are illegal or unacceptable.

process

public boolean process()
Run a "group by" operation on the specified Aggregators, get the results, and expose the aggregate values and the Aggregators used.

Specified by:
process in class BaseTag
Returns:
Whether the first Cell in the Block associated with this Tag was processed.


Copyright © 2012-2013 Jett Team. All Rights Reserved.