Class 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
    • Constructor Detail

      • Difference

        public Difference()
    • Method Detail

      • 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 class AbstractIndentifiableRowOperation
        Parameters:
        output - the spreadsheet the new row will get added to
        row1 - the row from the first sheet
        row2 - the row from the second sheet
        Returns:
        the generated difference