|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--edu.mssm.crover.tables.treatments.Aggregation
Aggregation operation on tables, similar to Mineset aggregation. Just a little bit more flexible about the aggregation operations (Mineset proposes: Sum, Average, Count, Min, Max); This class supports any operation that accept a set of instances from the source table and computes an object or a primitive type.
| Nested Class Summary | |
protected class |
Aggregation.Aggregate
|
| Field Summary | |
protected java.lang.Object |
parameter
|
| Constructor Summary | |
Aggregation()
|
|
Aggregation(java.lang.Object parameter)
Variant useful for customization. |
|
| Method Summary | |
void |
aggregate(java.lang.String columnIdentifier)
|
Table |
aggregate(Table source)
Performs the aggregation operation on source, returns the new table. |
protected void |
begin(Table source,
Table dest)
Override to add the aggregation columns to the destination table. |
void |
doNotAggregate(java.lang.String columnIdentifier)
|
void |
doNotGroupBy(java.lang.String columnIdentifier)
|
void |
doNotRemove(java.lang.String columnIdentifier)
|
protected void |
end(Table source,
Table dest)
Invoked after every row has been processed. |
java.lang.Object |
getParameter()
Returns the parameter passed at construction time. |
void |
groupBy(java.lang.String columnIdentifier)
|
boolean |
isAggregateColumn(java.lang.String columnIdentifier)
|
boolean |
isGroupByColumn(java.lang.String columnIdentifier)
|
protected boolean |
isInGroup(java.lang.String element,
java.lang.String[] group)
|
boolean |
isRemoveColumn(java.lang.String columnIdentifier)
|
static void |
main(java.lang.String[] args)
Example and test of use for this class. |
void |
remove(java.lang.String columnIdentifier)
|
protected void |
treatAggregate(Table source,
Table.RowIterator[] aggregate,
Table dest)
Called for each aggregat of the source table. |
void |
treatInstance(Table dest,
Table.RowIterator ri)
|
protected int |
whereInGroup(java.lang.String element,
java.lang.String[] group)
Returns the index of the element in the group. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.lang.Object parameter
| Constructor Detail |
public Aggregation(java.lang.Object parameter)
getParameter()public Aggregation()
| Method Detail |
public java.lang.Object getParameter()
public void groupBy(java.lang.String columnIdentifier)
public void doNotGroupBy(java.lang.String columnIdentifier)
public boolean isGroupByColumn(java.lang.String columnIdentifier)
public boolean isRemoveColumn(java.lang.String columnIdentifier)
public boolean isAggregateColumn(java.lang.String columnIdentifier)
protected boolean isInGroup(java.lang.String element,
java.lang.String[] group)
public void remove(java.lang.String columnIdentifier)
public void doNotRemove(java.lang.String columnIdentifier)
public void aggregate(java.lang.String columnIdentifier)
public void doNotAggregate(java.lang.String columnIdentifier)
protected int whereInGroup(java.lang.String element,
java.lang.String[] group)
public Table aggregate(Table source)
throws TreatmentInterrupted
TreatmentInterrupted
public void treatInstance(Table dest,
Table.RowIterator ri)
protected void begin(Table source,
Table dest)
throws java.lang.Exception
java.lang.Exception
protected void end(Table source,
Table dest)
throws java.lang.Exception
java.lang.Exception
protected void treatAggregate(Table source,
Table.RowIterator[] aggregate,
Table dest)
throws java.lang.Exception
java.lang.Exceptionpublic static void main(java.lang.String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||