Class SpreadSheetCollapse

  • All Implemented Interfaces:
    AdditionalInformationHandler, CleanUpHandler, Destroyable, GlobalInfoSupporter, LoggingLevelHandler, LoggingSupporter, OptionHandler, QuickInfoSupporter, ShallowCopySupporter<Actor>, SizeOfHandler, Stoppable, StoppableWithFeedback, VariablesInspectionHandler, VariableChangeListener, Actor, ErrorHandler, InputConsumer, OutputProducer, Serializable, Comparable

    public class SpreadSheetCollapse
    extends AbstractSpreadSheetTransformer
    Uses the specified key columns to identify groups of rows. It then collapses these rows into a single one, concatenating the content of the cells. Optionally, duplicate cell values can be omitted.

    Input/output:
    - accepts:
       adams.data.spreadsheet.SpreadSheet
    - generates:
       adams.data.spreadsheet.SpreadSheet


    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -name <java.lang.String> (property: name)
        The name of the actor.
        default: SpreadSheetCollapse
     
    -annotation <adams.core.base.BaseAnnotation> (property: annotations)
        The annotations to attach to this actor.
        default: 
     
    -skip <boolean> (property: skip)
        If set to true, transformation is skipped and the input token is just forwarded 
        as it is.
        default: false
     
    -stop-flow-on-error <boolean> (property: stopFlowOnError)
        If set to true, the flow gets stopped in case this actor encounters an error;
         useful for critical actors.
        default: false
     
    -silent <boolean> (property: silent)
        If enabled, then no errors are output in the console.
        default: false
     
    -key-columns <adams.data.spreadsheet.SpreadSheetColumnRange> (property: keyColumns)
        The columns to use as keys for identifying rows in the spreadsheets; if 
        left empty, all rows are used.
        default: first
        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
     
    -separator <java.lang.String> (property: separator)
        The separator to use when joining cell values.
        default: 
     
    -no-duplicates <boolean> (property: noDuplicates)
        If enabled, duplicate cell values get omitted.
        default: false
     
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_KeyColumns

        protected SpreadSheetColumnRange m_KeyColumns
        the range of column indices to use as key for identifying a row.
      • m_Separator

        protected String m_Separator
        the separator for the collapsed cells.
      • m_NoDuplicates

        protected boolean m_NoDuplicates
        whether to omit duplicate cell values.
    • Constructor Detail

      • SpreadSheetCollapse

        public SpreadSheetCollapse()
    • Method Detail

      • setKeyColumns

        public void setKeyColumns​(SpreadSheetColumnRange value)
        Sets the columns that identify a row.
        Parameters:
        value - the range
      • getKeyColumns

        public SpreadSheetColumnRange getKeyColumns()
        Returns the columns that identify a row.
        Returns:
        the range
      • keyColumnsTipText

        public String keyColumnsTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setSeparator

        public void setSeparator​(String value)
        Sets the separator to use when joining cell values.
        Parameters:
        value - the separator
      • getSeparator

        public String getSeparator()
        Returns the separator to use when joining cell values.
        Returns:
        the separator
      • separatorTipText

        public String separatorTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setNoDuplicates

        public void setNoDuplicates​(boolean value)
        Sets whether to omit duplicates.
        Parameters:
        value - true if to omit duplicates
      • getNoDuplicates

        public boolean getNoDuplicates()
        Returns whether to omit duplicates.
        Returns:
        true if to omit duplicates
      • noDuplicatesTipText

        public String noDuplicatesTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • doExecute

        protected String doExecute()
        Executes the flow item.
        Specified by:
        doExecute in class AbstractActor
        Returns:
        null if everything is fine, otherwise error message