|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.visualization.datasource.query.engine.AggregationTree
public class AggregationTree
An aggregation tree is the logical data structure that represents table grouping information. Each level of the tree (besides the root-level) is associated with an aggregation column. Each node of the tree is associated with a value (of some cell in the column defining its level). Each node contains aggregation information, i.e., information about the minimum, maximum, count, average and sum on the aggregated columns. A leaf node holds this aggregation information for the corresponding "path" of values. For example, if the group-by columns are {Name, Revenue}, then the tree consists of 3 levels: the root level, holding only the root, then a level with nodes representing different values of Name, and then a level with nodes holding different values of Revenue. Then the leaf node which is at the path {"Joe", 100} from the root will hold the aggregation information for all rows in the table for which the value of Name is "Joe" and the value of Revenue is 100. The non-leaf node which is at the path {"Joe"} will contain the aggregation information for all rows in which the name is "Joe", without any consideration of the value of the Revenue column. The root node contains all aggregation information for the entire table.
| Constructor Summary | |
|---|---|
AggregationTree(java.util.Set<java.lang.String> columnsToAggregate,
DataTable table)
Construct an aggregation tree. |
|
| Method Summary | |
|---|---|
void |
aggregate(AggregationPath path,
java.util.Map<java.lang.String,Value> valuesToAggregate)
Aggregates values to all the nodes on a path. |
AggregationNode |
getNode(AggregationPath path)
Returns the aggregation node at the end of a path. |
java.util.Set<AggregationPath> |
getPathsToLeaves()
Returns a set containing a path for each leaf in the tree. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AggregationTree(java.util.Set<java.lang.String> columnsToAggregate,
DataTable table)
columnsToAggregate - A set of ids of the columns to aggregate.table - The table.| Method Detail |
|---|
public void aggregate(AggregationPath path,
java.util.Map<java.lang.String,Value> valuesToAggregate)
valuesToAggregate - Maps column ids to values (to aggregate).path - The aggregation path.public AggregationNode getNode(AggregationPath path)
path - The aggregation path.
java.util.NoSuchElementException - In case no node lies at the end of the path.public java.util.Set<AggregationPath> getPathsToLeaves()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||