|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectadams.core.ConsoleObject
adams.core.option.AbstractOptionHandler
adams.data.conversion.AbstractConversion
adams.data.conversion.AbstractSpreadSheetConversion
adams.data.conversion.AggregateSpreadSheet
public class AggregateSpreadSheet
Aggregates rows (min, max, avg, etc) in a spreadsheet using key columns.
All numeric columns in the specified aggregrate range (excluding the key columns) get aggregated. For each of the specified aggregates a new column is generated.
-D <int> (property: debugLevel) The greater the number the more additional info the scheme may output to the console (0 = off). default: 0 minimum: 0
-key-columns <adams.core.Range> (property: keyColumns)
The columns to use as keys for identifying rows in the spreadsheets; A range
is a comma-separated list of single 1-based indices or sub-ranges of indices
('start-en2d'); 'inv(...)' inverts the range '...'; the following placeholders
can be used as well: first, second, third, last_2, last_1, last
default: first
-aggregate-columns <adams.core.Range> (property: aggregateColumns)
The columns to aggregate (only numeric ones will be used); A range is a
comma-separated list of single 1-based indices or sub-ranges of indices
('start-end'); 'inv(...)' inverts the range '...'; the following placeholders
can be used as well: first, second, third, last_2, last_1, last
default: first-last
-aggregate <SUM|MIN|MAX|AVERAGE|MEDIAN|STDEV|STDEVP|INTERQUARTILE> [-aggregate ...] (property: aggregates) The aggregates to calculate and introduce as columns. default: SUM
| Nested Class Summary | |
|---|---|
static class |
AggregateSpreadSheet.Aggregate
The types of aggregates to generate. |
| Field Summary | |
|---|---|
protected Range |
m_AggregateColumns
the range of columns to aggregate. |
protected AggregateSpreadSheet.Aggregate[] |
m_Aggregates
the aggregates to generate. |
protected Range |
m_KeyColumns
the range of column indices to use as key for identifying a row. |
| Fields inherited from class adams.data.conversion.AbstractConversion |
|---|
m_Input, m_Output, m_Owner |
| Fields inherited from class adams.core.option.AbstractOptionHandler |
|---|
m_DebugLevel, m_OptionManager |
| Constructor Summary | |
|---|---|
AggregateSpreadSheet()
|
|
| Method Summary | |
|---|---|
String |
aggregateColumnsTipText()
Returns the tip text for this property. |
String |
aggregatesTipText()
Returns the tip text for this property. |
protected double |
computeAggregate(SpreadSheet input,
List<Integer> subset,
Row rowNew,
int index,
AggregateSpreadSheet.Aggregate agg)
Computes the aggregate. |
protected SpreadSheet |
convert(SpreadSheet input)
Generates the new spreadsheet from the input. |
void |
defineOptions()
Adds options to the internal list of options. |
Range |
getAggregateColumns()
Returns the colums that should get aggregated. |
AggregateSpreadSheet.Aggregate[] |
getAggregates()
Returns the aggregates to calculate. |
Range |
getKeyColumns()
Returns the colums that identify a rowx |
String |
globalInfo()
Returns a string describing the object. |
String |
keyColumnsTipText()
Returns the tip text for this property. |
void |
setAggregateColumns(Range value)
Sets the colums that should get aggregated. |
void |
setAggregates(AggregateSpreadSheet.Aggregate[] value)
Sets the aggregates to calculate. |
void |
setKeyColumns(Range value)
Sets the colums that identify a row. |
| Methods inherited from class adams.data.conversion.AbstractSpreadSheetConversion |
|---|
accepts, doConvert, generates |
| Methods inherited from class adams.data.conversion.AbstractConversion |
|---|
checkData, cleanUp, convert, getInput, getOutput, getOwner, getQuickInfo, reset, setInput, setOwner, shallowCopy, shallowCopy |
| Methods inherited from class adams.core.option.AbstractOptionHandler |
|---|
cleanUpOptions, debug, debug, debugLevelTipText, destroy, finishInit, getDebugLevel, getOptionManager, initialize, isDebugOn, newOptionManager, setDebugLevel, toCommandLine, toString |
| Methods inherited from class adams.core.ConsoleObject |
|---|
getDebugging, getSystemErr, getSystemOut, sizeOf |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected Range m_KeyColumns
protected Range m_AggregateColumns
protected AggregateSpreadSheet.Aggregate[] m_Aggregates
| Constructor Detail |
|---|
public AggregateSpreadSheet()
| Method Detail |
|---|
public String globalInfo()
globalInfo in class AbstractOptionHandlerpublic void defineOptions()
defineOptions in interface OptionHandlerdefineOptions in class AbstractOptionHandlerpublic void setKeyColumns(Range value)
value - the rangepublic Range getKeyColumns()
public String keyColumnsTipText()
public void setAggregateColumns(Range value)
value - the rangepublic Range getAggregateColumns()
public String aggregateColumnsTipText()
public void setAggregates(AggregateSpreadSheet.Aggregate[] value)
value - the aggregatespublic AggregateSpreadSheet.Aggregate[] getAggregates()
public String aggregatesTipText()
protected double computeAggregate(SpreadSheet input,
List<Integer> subset,
Row rowNew,
int index,
AggregateSpreadSheet.Aggregate agg)
input - the original sheetsubset - the subset of rows to use for the computationrowNew - the row to add the aggregate toindex - the column in the original spreadsheetagg - the aggregate to compute
protected SpreadSheet convert(SpreadSheet input)
throws Exception
convert in class AbstractSpreadSheetConversioninput - the incoming spreadsheet
Exception - if conversion fails for some reason
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||