Class AbstractFeatureGenerator

    • Field Detail

      • m_Prefix

        protected String m_Prefix
        the prefix for the feature fields.
    • Constructor Detail

      • AbstractFeatureGenerator

        public AbstractFeatureGenerator()
    • Method Detail

      • reset

        protected void reset()
        Resets the generator. Derived classes must call this method in set-methods of parameters to assure the invalidation of previously generated data.
        Overrides:
        reset in class adams.core.option.AbstractOptionHandler
      • 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
      • getDefaultPrefix

        protected String getDefaultPrefix()
        Returns the default prefix for the generated features.
        Returns:
        the default prefix
      • setPrefix

        public void setPrefix​(String value)
        Sets the prefix to use for the generated features.
        Parameters:
        value - the prefix to use
      • getPrefix

        public String getPrefix()
        Returns the prefix in use for the generated features.
        Returns:
        the prefix in use
      • prefixTipText

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

        public void cleanUp()
        Cleans up data structures, frees up memory.
      • generate

        public Heatmap generate​(Heatmap data)
        Generates the features and adds them to the report.
        Parameters:
        data - the data to process
        Returns:
        the processed data
      • checkData

        protected void checkData​(Heatmap data)
        The default implementation only checks whether there is any data set.
        Parameters:
        data - the data to process
      • addFeature

        protected Double addFeature​(Heatmap data,
                                    double value)
        Adds the specified feature. Uses the class name (without packages) as feature suffix.
        Parameters:
        data - the heatmap to add the feature to
        value - the value of the feature
        Returns:
        the previous value for this feature if any, otherwise null
      • addFeature

        protected Double addFeature​(Heatmap data,
                                    String suffix,
                                    double value)
        Adds the specified feature. Uses an explicit suffix for the feature.
        Parameters:
        data - the heatmap to add the feature to
        suffix - the suffix of the feature
        value - the value of the feature
        Returns:
        the previous value for this feature if any, otherwise null
      • processData

        protected abstract Heatmap processData​(Heatmap data)
        Performs the actual feature generation.
        Parameters:
        data - the data to process
        Returns:
        the processed data
      • 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 AbstractFeatureGenerator shallowCopy()
        Returns a shallow copy of itself, i.e., based on the commandline options.
        Specified by:
        shallowCopy in interface adams.core.ShallowCopySupporter<AbstractFeatureGenerator>
        Returns:
        the shallow copy
      • shallowCopy

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

        public static String[] getGenerators()
        Returns a list with classnames of generators.
        Returns:
        the generator classnames
      • forName

        public static AbstractFeatureGenerator forName​(String classname,
                                                       String[] options)
        Instantiates the generator with the given options.
        Parameters:
        classname - the classname of the generator to instantiate
        options - the options for the generator
        Returns:
        the instantiated generator or null if an error occurred
      • forCommandLine

        public static AbstractFeatureGenerator forCommandLine​(String cmdline)
        Instantiates the generator from the given commandline (i.e., classname and optional options).
        Parameters:
        cmdline - the classname (and optional options) of the generator to instantiate
        Returns:
        the instantiated generator or null if an error occurred