Class AbstractThreeWayDataFeatureGenerator

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected adams.data.featureconverter.AbstractFeatureConverter m_Converter
      the feature converter to use.
      protected adams.data.report.Field[] m_Fields
      fields to add to the output data.
      protected adams.core.base.BaseString[] m_Notes
      the notes to add as attributes.
      protected String m_Prefix
      the prefix to use for the fields.
      • Fields inherited from class adams.core.option.AbstractOptionHandler

        m_OptionManager
      • Fields inherited from class adams.core.logging.LoggingObject

        m_Logger, m_LoggingIsEnabled, m_LoggingLevel
    • Field Detail

      • m_Converter

        protected adams.data.featureconverter.AbstractFeatureConverter m_Converter
        the feature converter to use.
      • m_Prefix

        protected String m_Prefix
        the prefix to use for the fields.
      • m_Fields

        protected adams.data.report.Field[] m_Fields
        fields to add to the output data.
      • m_Notes

        protected adams.core.base.BaseString[] m_Notes
        the notes to add as attributes.
    • Constructor Detail

      • AbstractThreeWayDataFeatureGenerator

        public AbstractThreeWayDataFeatureGenerator()
    • Method Detail

      • defineOptions

        public void defineOptions()
        Adds options to the internal list of options.
        Specified by:
        defineOptions in interface adams.core.option.OptionHandler
        Overrides:
        defineOptions in class adams.core.option.AbstractOptionHandler
      • reset

        protected void reset()
        Resets the scheme, i.e., the header information.
        Overrides:
        reset in class adams.core.option.AbstractOptionHandler
      • setConverter

        public void setConverter​(adams.data.featureconverter.AbstractFeatureConverter value)
        Sets the feature converter to use.
        Parameters:
        value - the converter
      • getConverter

        public adams.data.featureconverter.AbstractFeatureConverter getConverter()
        Returns the feature converter in use.
        Returns:
        the converter
      • converterTipText

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

        public void setPrefix​(String value)
        Sets the (optional) prefix for the feature names.
        Parameters:
        value - the prefix
      • getPrefix

        public String getPrefix()
        Returns the (optional) prefix for the feature names.
        Returns:
        the prefix
      • prefixTipText

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

        public void setFields​(adams.data.report.Field[] value)
        Sets the targets to add.
        Parameters:
        value - the targets
      • getFields

        public adams.data.report.Field[] getFields()
        Returns the targets to add.
        Returns:
        the targets
      • fieldsTipText

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

        public void setNotes​(adams.core.base.BaseString[] value)
        Sets the notes to add as attributes.
        Parameters:
        value - the notes prefixes, e.g., "PROCESS INFORMATION"
      • getNotes

        public adams.core.base.BaseString[] getNotes()
        Returns the current notes to add as attributes.
        Returns:
        the notes prefixes, e.g., "PROCESS INFORMATION"
      • notesTipText

        public String notesTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the gui
      • getDatasetFormat

        public Class getDatasetFormat()
        Returns the class of the dataset that the converter generates.
        Returns:
        the format
      • getRowFormat

        public Class getRowFormat()
        Returns the class of the row that the converter generates.
        Returns:
        the format
      • checkData

        protected void checkData​(ThreeWayData data)
        Optional checks of the data.

        Default implementation only checks whether data is null.
        Parameters:
        data - the data to check
      • createHeader

        public abstract adams.data.featureconverter.HeaderDefinition createHeader​(ThreeWayData data)
        Creates the header from template data.
        Parameters:
        data - the data to act as a template
        Returns:
        the generated header
      • postProcessHeader

        public adams.data.featureconverter.HeaderDefinition postProcessHeader​(adams.data.featureconverter.HeaderDefinition header)
        Post-processes the header, adding fields and notes.
        Parameters:
        header - the header to process
        Returns:
        the post-processed header
      • generateRows

        public abstract List<Object>[] generateRows​(ThreeWayData data)
        Performs the actual feature generation.
        Parameters:
        data - the data to process
        Returns:
        the generated features
      • postProcessRow

        public List<Object> postProcessRow​(ThreeWayData data,
                                           List<Object> generated)
        Post-processes the generated row, adding notes and fields.
        Parameters:
        data - the data container
        generated - the generated to post-process
        Returns:
        the updated generated data
      • postProcessRows

        public List<Object>[] postProcessRows​(ThreeWayData data,
                                              List<Object>[] generated)
        Post-processes the generated rows, adding notes and fields.
        Parameters:
        data - the data container
        generated - the inst to process
        Returns:
        the updated instance
      • generate

        public Object[] generate​(ThreeWayData data)
        Process the given data. This method will also create the header if necessary.
        Parameters:
        data - the data to process
        Returns:
        the generated array
        See Also:
        createHeader(ThreeWayData)
      • compareTo

        public int compareTo​(Object o)
        Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

        Only compares the commandlines of the two objects.
        Specified by:
        compareTo in interface Comparable
        Parameters:
        o - the object to be compared.
        Returns:
        a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
        Throws:
        ClassCastException - if the specified object's type prevents it from being compared to this object.
      • equals

        public boolean equals​(Object o)
        Returns whether the two objects are the same.

        Only compares the commandlines of the two objects.
        Overrides:
        equals in class Object
        Parameters:
        o - the object to be compared
        Returns:
        true if the object is the same as this one
      • shallowCopy

        public AbstractThreeWayDataFeatureGenerator shallowCopy​(boolean expand)
        Returns a shallow copy of itself, i.e., based on the commandline options.
        Specified by:
        shallowCopy in interface adams.core.ShallowCopySupporter<AbstractThreeWayDataFeatureGenerator>
        Parameters:
        expand - whether to expand variables to their current values
        Returns:
        the shallow copy
      • cleanUp

        public void cleanUp()
        Cleans up data structures, frees up memory.
        Specified by:
        cleanUp in interface adams.core.CleanUpHandler
      • destroy

        public void destroy()
        Frees up memory in a "destructive" non-reversible way.

        Calls cleanUp() and cleans up the options.
        Specified by:
        destroy in interface adams.core.Destroyable
        Overrides:
        destroy in class adams.core.option.AbstractOptionHandler