infovis.metadata
Class AdditiveAggregation

java.lang.Object
  extended by infovis.metadata.AdditiveAggregation
All Implemented Interfaces:
Aggregation, AggregationConstants, Constants

public class AdditiveAggregation
extends Object
implements Aggregation

Manage number columns that are additive from the leaves to the root, as required by treemaps.

Version:
$Revision: 1.12 $
Author:
Jean-Daniel Fekete
InfoVis factory arguments:
AggregationFactory Additive

Nested Class Summary
static class AdditiveAggregation.NonAdditiveFilter
          ColumnFilter to filter out columns that are non additive.
 
Field Summary
static String ADDEDDEGREE_COLUMN
          Name of the column containing the Additive degree of a tree.
static AdditiveAggregation instance
          The instance.
 
Fields inherited from interface infovis.metadata.AggregationConstants
AGGREGATE_COMPATIBLE, AGGREGATE_NO, AGGREGATE_YES, AGGREGATION_TYPE, AGGREGATION_TYPE_ADDITIVE, AGGREGATION_TYPE_ATLEAF, AGGREGATION_TYPE_CONCAT, AGGREGATION_TYPE_MAX, AGGREGATION_TYPE_MEAN, AGGREGATION_TYPE_MIN, AGGREGATION_TYPE_NONE
 
Fields inherited from interface infovis.metadata.Constants
CONTRIBUTOR, COVERAGE, CREATOR, DATE, DESCRITION, FORMAT, IDENTIFIER, LANGUAGE, PUBLISHER, RELATION, RIGHTS, SOURCE, SUBJECT, TITLE, TYPE
 
Constructor Summary
AdditiveAggregation()
           
 
Method Summary
 Column aggregate(Column src, Tree tree, Column dst)
          Computes the aggregation values of the specified source column into the destination column.
static short analyzeAdditiveWeight(NumberColumn col, Tree tree)
          Checks whether a NumberColumn is a valid sizeColumn.
static NumberColumn buildAdditiveWeight(NumberColumn src, Tree tree, DoubleFunction fn, RowDoubleValueGenerator gen, NumberColumn dst)
          Creates a NumberColumn to be a valid sizeColumn by computing the sum of the leave and undefining non leaf nodes.
static AdditiveAggregation getInstance()
          Returns the instance of AdditiveAggregation.
 String getType()
          Returns the type name of the aggregation.
static short isAdditive(NumberColumn col, Tree tree)
          Returns whether a NumberColumn is a valid sizeColumn.
 boolean isAggregating(Column col, Tree tree)
          Checks whether a column is aggregating following the class aggregation scheme.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

public static final AdditiveAggregation instance
The instance.


ADDEDDEGREE_COLUMN

public static final String ADDEDDEGREE_COLUMN
Name of the column containing the Additive degree of a tree.

See Also:
Constant Field Values
Constructor Detail

AdditiveAggregation

public AdditiveAggregation()
Method Detail

getInstance

public static AdditiveAggregation getInstance()
Returns the instance of AdditiveAggregation.

Returns:
the instance of AdditiveAggregation

isAggregating

public boolean isAggregating(Column col,
                             Tree tree)
Checks whether a column is aggregating following the class aggregation scheme.

Specified by:
isAggregating in interface Aggregation
Parameters:
col - the column
tree - the tree
Returns:
true if the column follows the aggregation scheme, false otherwise.

aggregate

public Column aggregate(Column src,
                        Tree tree,
                        Column dst)
Computes the aggregation values of the specified source column into the destination column. Source and destination should be allocated and of the right type.

Specified by:
aggregate in interface Aggregation
Parameters:
src - the source column
tree - the tree
dst - the destination column
Returns:
the dst column.

getType

public String getType()
Returns the type name of the aggregation.

Specified by:
getType in interface Aggregation
Returns:
the type name of the aggregation.

isAdditive

public static short isAdditive(NumberColumn col,
                               Tree tree)
Returns whether a NumberColumn is a valid sizeColumn.

Parameters:
col - the NumberColumn
tree - the Tree.
Returns:
AGGREGATE_YES if the NumberColumn is a valid sizeColumn, AGGREGATE_NO if the column is not a valid sizeColumn and cannot be turned into one, and AGGREGATE_COMPATIBLE otherwise.

analyzeAdditiveWeight

public static short analyzeAdditiveWeight(NumberColumn col,
                                          Tree tree)
Checks whether a NumberColumn is a valid sizeColumn.

Parameters:
col - the NumberColumn
tree - the Tree.
Returns:
ADDITIVE_YES if the NumberColumn is a valid sizeColumn, ADDITIVE_NO if the column is not a valid sizeColumn and cannot be turned into one, and ADDITIVE_COMPATIBLE otherwise.

buildAdditiveWeight

public static NumberColumn buildAdditiveWeight(NumberColumn src,
                                               Tree tree,
                                               DoubleFunction fn,
                                               RowDoubleValueGenerator gen,
                                               NumberColumn dst)
Creates a NumberColumn to be a valid sizeColumn by computing the sum of the leave and undefining non leaf nodes. The initial values are provided by a WeightBuilder and transformed through a function.

Parameters:
src - the source NumberColumn.
tree - the tree.
fn - the transforming function.
gen - the generator for undefined values
dst - the destination column
Returns:
a NumberColumn containing the sum of the leaves of the specified NumberColumn of the specified tree.


Copyright © 2005 by Jean-Daniel Fekete and INRIA, France All rights reserved.