Package adams.data.heatmapfeatures
Class AbstractHeatmapFeatureGenerator
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.heatmapfeatures.AbstractHeatmapFeatureGenerator
-
- All Implemented Interfaces:
adams.core.CleanUpHandler,adams.core.Destroyable,adams.core.GlobalInfoSupporter,adams.core.logging.LoggingLevelHandler,adams.core.logging.LoggingSupporter,adams.core.option.OptionHandler,adams.core.QuickInfoSupporter,adams.core.ShallowCopySupporter<AbstractHeatmapFeatureGenerator>,adams.core.SizeOfHandler,Serializable,Comparable
- Direct Known Subclasses:
AbstractHeatmapFeatureGeneratorWithSkippableMissingValues,AbstractMetaHeatmapFeatureGenerator,AbstractScript,AbstractScriptedFeatureGenerator,Max,Min,MultiFeatureGenerator,Values
public abstract class AbstractHeatmapFeatureGenerator extends adams.core.option.AbstractOptionHandler implements Comparable, adams.core.CleanUpHandler, adams.core.ShallowCopySupporter<AbstractHeatmapFeatureGenerator>, adams.core.QuickInfoSupporter
Abstract base class for Heatmap feature generation.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected adams.data.featureconverter.AbstractFeatureConverterm_Converterthe feature converter to use.protected adams.data.report.Field[]m_Fieldsfields to add to the output data.protected adams.core.base.BaseString[]m_Notesthe notes to add as attributes.
-
Constructor Summary
Constructors Constructor Description AbstractHeatmapFeatureGenerator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidcheckData(Heatmap map)Optional checks of the heatmap.voidcleanUp()Cleans up data structures, frees up memory.intcompareTo(Object o)Compares this object with the specified object for order.StringconverterTipText()Returns the tip text for this property.abstract adams.data.featureconverter.HeaderDefinitioncreateHeader(Heatmap map)Creates the header from a template heatmap.voiddefineOptions()Adds options to the internal list of options.voiddestroy()Frees up memory in a "destructive" non-reversible way.booleanequals(Object o)Returns whether the two objects are the same.StringfieldsTipText()Returns the tip text for this property.Object[]generate(Heatmap map)Process the given heatmap.abstract List<Object>[]generateRows(Heatmap map)Performs the actual feature generation.adams.data.featureconverter.AbstractFeatureConvertergetConverter()Returns the feature converter in use.ClassgetDatasetFormat()Returns the class of the dataset that the converter generates.adams.data.report.Field[]getFields()Returns the targets to add.adams.core.base.BaseString[]getNotes()Returns the current notes to add as attributes.StringgetQuickInfo()Returns a quick info about the object, which can be displayed in the GUI.ClassgetRowFormat()Returns the class of the row that the converter generates.StringnotesTipText()Returns the tip text for this property.adams.data.featureconverter.HeaderDefinitionpostProcessHeader(adams.data.featureconverter.HeaderDefinition header)Post-processes the header, adding fields and notes.List<Object>postProcessRow(Heatmap map, List<Object> data)Post-processes the generated row, adding notes and fields.List<Object>[]postProcessRows(Heatmap map, List<Object>[] data)Post-processes the generated rows, adding notes and fields.protected voidreset()Resets the scheme, i.e., the header information.voidsetConverter(adams.data.featureconverter.AbstractFeatureConverter value)Sets the feature converter to use.voidsetFields(adams.data.report.Field[] value)Sets the targets to add.voidsetNotes(adams.core.base.BaseString[] value)Sets the notes to add as attributes.AbstractHeatmapFeatureGeneratorshallowCopy()Returns a shallow copy of itself, i.e., based on the commandline options.AbstractHeatmapFeatureGeneratorshallowCopy(boolean expand)Returns a shallow copy of itself, i.e., based on the commandline options.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, initialize, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Field Detail
-
m_Converter
protected adams.data.featureconverter.AbstractFeatureConverter m_Converter
the feature converter to use.
-
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.
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceadams.core.option.OptionHandler- Overrides:
defineOptionsin classadams.core.option.AbstractOptionHandler
-
reset
protected void reset()
Resets the scheme, i.e., the header information.- Overrides:
resetin classadams.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.
-
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
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.
Default implementation returns null.- Specified by:
getQuickInfoin interfaceadams.core.QuickInfoSupporter- Returns:
- null if no info available, otherwise short string
-
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(Heatmap map)
Optional checks of the heatmap.
Default implementation only checks whether heatmap is null.- Parameters:
map- the heatmap to check
-
createHeader
public abstract adams.data.featureconverter.HeaderDefinition createHeader(Heatmap map)
Creates the header from a template heatmap.- Parameters:
map- the heatmap 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(Heatmap map)
Performs the actual feature generation.- Parameters:
map- the heatmap to process- Returns:
- the generated features
-
postProcessRow
public List<Object> postProcessRow(Heatmap map, List<Object> data)
Post-processes the generated row, adding notes and fields.- Parameters:
map- the heatmap containerdata- the data to process- Returns:
- the updated instance
-
postProcessRows
public List<Object>[] postProcessRows(Heatmap map, List<Object>[] data)
Post-processes the generated rows, adding notes and fields.- Parameters:
map- the heatmap containerdata- the data to process- Returns:
- the updated instance
-
generate
public Object[] generate(Heatmap map)
Process the given heatmap. This method will also create the header if necessary.- Parameters:
map- the heatmap to process- Returns:
- the generated array
- See Also:
createHeader(Heatmap)
-
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:
compareToin interfaceComparable- 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.
-
shallowCopy
public AbstractHeatmapFeatureGenerator shallowCopy()
Returns a shallow copy of itself, i.e., based on the commandline options.- Specified by:
shallowCopyin interfaceadams.core.ShallowCopySupporter<AbstractHeatmapFeatureGenerator>- Returns:
- the shallow copy
-
shallowCopy
public AbstractHeatmapFeatureGenerator shallowCopy(boolean expand)
Returns a shallow copy of itself, i.e., based on the commandline options.- Specified by:
shallowCopyin interfaceadams.core.ShallowCopySupporter<AbstractHeatmapFeatureGenerator>- 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:
cleanUpin interfaceadams.core.CleanUpHandler
-
destroy
public void destroy()
Frees up memory in a "destructive" non-reversible way.
Calls cleanUp() and cleans up the options.- Specified by:
destroyin interfaceadams.core.Destroyable- Overrides:
destroyin classadams.core.option.AbstractOptionHandler
-
-