Class SpreadSheetToNumeric

  • All Implemented Interfaces:
    AdditionalInformationHandler, CleanUpHandler, Destroyable, GlobalInfoSupporter, LoggingLevelHandler, LoggingSupporter, OptionHandler, QuickInfoSupporter, ShallowCopySupporter<AbstractConversion>, SizeOfHandler, Stoppable, Conversion, Serializable

    public class SpreadSheetToNumeric
    extends AbstractConversion
    Turns a spreadsheet into a purely numeric one.
    Missing cells can get replaced with a specified value or skipped.
    Booleans gets turned into 0/1 (false/true).
    Date/time types get turned into numeric ones by using their Java epoch.
    Strings (per column) get a 0-based index assigned in the order they appear.
    Any other cell type get flagged as missing or, if provided, set to the unhandled value.

    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -replace-missing-cells <boolean> (property: replaceMissingCells)
        If enabled, missing cells get replaced with the specified value.
        default: false
     
    -missing-value <double> (property: missingValue)
        The writer setup to use for generating the string.
        default: NaN
     
    -unhandled <double> (property: unhandled)
        The replacement value for unhandled cell types.
        default: NaN
     
    Version:
    $Revision$
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_ReplaceMissingCells

        protected boolean m_ReplaceMissingCells
        whether to replace missing cells.
      • m_MissingValue

        protected double m_MissingValue
        the replacement value for missing values.
      • m_Unhandled

        protected double m_Unhandled
        the replacement value for unhandled values.
    • Constructor Detail

      • SpreadSheetToNumeric

        public SpreadSheetToNumeric()
    • Method Detail

      • setReplaceMissingCells

        public void setReplaceMissingCells​(boolean value)
        Sets whether to replace missing cells.
        Parameters:
        value - true if to replace
      • getReplaceMissingCells

        public boolean getReplaceMissingCells()
        Returns whether to replace missing cells.
        Returns:
        true if to replace
      • replaceMissingCellsTipText

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

        public void setMissingValue​(double value)
        Sets the replacement value for missing cells.
        Parameters:
        value - the missing value
      • getMissingValue

        public double getMissingValue()
        Returns the replacement value for missing cells.
        Returns:
        the missing value
      • missingValueTipText

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

        public void setUnhandled​(double value)
        Sets the replacement value for unhandled cell types.
        Parameters:
        value - the unhandled value
      • getUnhandled

        public double getUnhandled()
        Returns the replacement value for unhandled cell types.
        Returns:
        the unhandled value
      • unhandledTipText

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