Class Difference
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.transformer.multispreadsheetoperation.AbstractMultiSpreadSheetOperation<SpreadSheet>
-
- adams.flow.transformer.multispreadsheetoperation.AbstractIndentifiableRowOperation
-
- adams.flow.transformer.multispreadsheetoperation.Difference
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,SizeOfHandler
,Serializable
public class Difference extends AbstractIndentifiableRowOperation
Computes the difference of the numeric cells between two spreadsheets.
The values of the second spreadsheet are subtracted from the first one.
If no 'key' columns are defined, the current order of rows is used for comparison.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-key-columns <adams.data.spreadsheet.SpreadSheetColumnRange> (property: keyColumns) The columns to use as keys for identifying rows in the spreadsheets, if empty the row index is used instead; A range is a comma-separated list of single 1-based indices or sub-ranges of indices ('start-end'); 'inv(...)' inverts the range '...'; column names (case-sensitive) as well as the following placeholders can be used: first, second, third, last_2, last_1, last; numeric indices can be enforced by preceding them with '#' (eg '#12'); column names can be surrounded by double quotes. default: example: A range is a comma-separated list of single 1-based indices or sub-ranges of indices ('start-end'); 'inv(...)' inverts the range '...'; column names (case-sensitive) as well as the following placeholders can be used: first, second, third, last_2, last_1, last; numeric indices can be enforced by preceding them with '#' (eg '#12'); column names can be surrounded by double quotes.
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class adams.flow.transformer.multispreadsheetoperation.AbstractIndentifiableRowOperation
m_ColIndices, m_KeyColumns, m_Rows
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description Difference()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
globalInfo()
Returns a string describing the object.protected Row
performOperation(SpreadSheet output, Row row1, Row row2)
Computes the difference between the two rows: actual difference is computed for numeric cells.-
Methods inherited from class adams.flow.transformer.multispreadsheetoperation.AbstractIndentifiableRowOperation
defineOptions, doProcess, generateOutputRow, generates, getKeyColumns, getQuickInfo, initRowLookup, keyColumnsTipText, maxNumSheetsRequired, minNumSheetsRequired, setKeyColumns
-
Methods inherited from class adams.flow.transformer.multispreadsheetoperation.AbstractMultiSpreadSheetOperation
check, process
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceGlobalInfoSupporter
- Specified by:
globalInfo
in classAbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
performOperation
protected Row performOperation(SpreadSheet output, Row row1, Row row2)
Computes the difference between the two rows: actual difference is computed for numeric cells. If cells are strings, then the results is a missing value in case of differing strings, otherwise the same.- Specified by:
performOperation
in classAbstractIndentifiableRowOperation
- Parameters:
output
- the spreadsheet the new row will get added torow1
- the row from the first sheetrow2
- the row from the second sheet- Returns:
- the generated difference
-
-