adams.data.instances
Class AbstractFieldInstanceGenerator

java.lang.Object
  extended by adams.core.ConsoleObject
      extended by adams.core.option.AbstractOptionHandler
          extended by adams.data.instances.AbstractInstanceGenerator<Heatmap>
              extended by adams.data.instances.AbstractFieldInstanceGenerator
All Implemented Interfaces:
CleanUpHandler, Debuggable, Destroyable, OptionHandler, ShallowCopySupporter<AbstractInstanceGenerator>, SizeOfHandler, DatabaseConnectionHandler, DatabaseConnectionProvider, Serializable, Comparable
Direct Known Subclasses:
FieldInstanceGenerator, HistogramInstanceGenerator, IntensityInstanceGenerator, RawInstanceGenerator

public abstract class AbstractFieldInstanceGenerator
extends AbstractInstanceGenerator<Heatmap>

Abstract base class for schemes that turn heatmaps into weka.core.Instance objects.

Version:
$Revision: 6027 $
Author:
fracpete (fracpete at waikato dot ac dot nz)
See Also:
Serialized Form

Field Summary
protected  Field[] m_Fields
          fields to add to the output data.
 
Fields inherited from class adams.data.instances.AbstractInstanceGenerator
LABEL_FALSE, LABEL_TRUE, m_AddDatabaseID, m_DatabaseConnection, m_OutputHeader, m_TolerateHeaderChanges
 
Fields inherited from class adams.core.option.AbstractOptionHandler
m_DebugLevel, m_OptionManager
 
Constructor Summary
AbstractFieldInstanceGenerator()
           
 
Method Summary
protected  void addFields(Heatmap data, double[] values)
          Adds the fields of the heatmap to the data array.
protected  void checkHeader(Heatmap data)
          Checks whether the number of waves are the same.
protected  Attribute createAttribute(Field field, StringBuilder names)
          Creates an attribute from the specified field.
 void defineOptions()
          Adds options to the internal list of options.
 String fieldsTipText()
          Returns the tip text for this property.
protected  AbstractDatabaseConnection getDefaultDatabaseConnection()
          Returns the default database connection.
 Field[] getFields()
          Returns the targets to add.
 void setFields(Field[] value)
          Sets the targets to add.
 
Methods inherited from class adams.data.instances.AbstractInstanceGenerator
addDatabaseIDTipText, checkInput, checkSetup, cleanUp, compareTo, destroy, equals, forCommandLine, forName, generate, generateHeader, generateOutput, getAddDatabaseID, getDatabaseConnection, getGenerators, getOutputHeader, getTolerateHeaderChanges, initialize, interpretePosition, postProcessHeader, postProcessOutput, reset, setAddDatabaseID, setDatabaseConnection, setTolerateHeaderChanges, shallowCopy, shallowCopy, tolerateHeaderChangesTipText
 
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, debug, debug, debugLevelTipText, finishInit, getDebugLevel, getOptionManager, globalInfo, isDebugOn, newOptionManager, setDebugLevel, toCommandLine, toString
 
Methods inherited from class adams.core.ConsoleObject
getDebugging, getSystemErr, getSystemOut, sizeOf
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_Fields

protected Field[] m_Fields
fields to add to the output data.

Constructor Detail

AbstractFieldInstanceGenerator

public AbstractFieldInstanceGenerator()
Method Detail

defineOptions

public void defineOptions()
Adds options to the internal list of options.

Specified by:
defineOptions in interface OptionHandler
Overrides:
defineOptions in class AbstractInstanceGenerator<Heatmap>

getDefaultDatabaseConnection

protected AbstractDatabaseConnection getDefaultDatabaseConnection()
Returns the default database connection.

Specified by:
getDefaultDatabaseConnection in class AbstractInstanceGenerator<Heatmap>
Returns:
the default database connection

setFields

public void setFields(Field[] value)
Sets the targets to add.

Parameters:
value - the targets

getFields

public 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.

checkHeader

protected void checkHeader(Heatmap data)
Checks whether the number of waves are the same.

Specified by:
checkHeader in class AbstractInstanceGenerator<Heatmap>
Parameters:
data - the input data

createAttribute

protected Attribute createAttribute(Field field,
                                    StringBuilder names)
Creates an attribute from the specified field.

Parameters:
field - the field to turn into an attribute
names - for appending the field name
Returns:
the Attribute

addFields

protected void addFields(Heatmap data,
                         double[] values)
Adds the fields of the heatmap to the data array.

Parameters:
data - the heatmap to get the field values from
values - the data for the instance


Copyright © 2013 University of Waikato, Hamilton, NZ. All Rights Reserved.