|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectadams.core.ConsoleObject
adams.core.option.AbstractOptionHandler
adams.data.instances.AbstractInstanceGenerator<T>
public abstract class AbstractInstanceGenerator<T extends DataContainer & ReportHandler>
Abstract base class for schemes that turn temperature profiles into weka.core.Instance objects.
| Field Summary | |
|---|---|
static String |
LABEL_FALSE
the "false" label for boolean data types. |
static String |
LABEL_TRUE
the "true" label for boolean data types. |
protected boolean |
m_AddDatabaseID
whether to add the database ID. |
protected AbstractDatabaseConnection |
m_DatabaseConnection
the database connection. |
protected weka.core.Instances |
m_OutputHeader
the generated header. |
| Fields inherited from class adams.core.option.AbstractOptionHandler |
|---|
m_DebugLevel, m_OptionManager |
| Constructor Summary | |
|---|---|
AbstractInstanceGenerator()
|
|
| Method Summary | |
|---|---|
String |
addDatabaseIDTipText()
Returns the tip text for this property. |
protected abstract void |
checkHeader(T data)
Checks whether the number of waves are the same. |
protected void |
checkInput(T data)
Checks the input profile. |
String |
checkSetup()
Checks whether the setup is consistent. |
void |
cleanUp()
Cleans up data structures, frees up memory. |
int |
compareTo(Object o)
Compares this object with the specified object for order. |
void |
defineOptions()
Adds options to the internal list of options. |
void |
destroy()
Frees up memory in a "destructive" non-reversible way. |
boolean |
equals(Object o)
Returns whether the two objects are the same. |
static AbstractInstanceGenerator |
forCommandLine(String cmdline)
Instantiates the generator from the given commandline (i.e., classname and optional options). |
static AbstractInstanceGenerator |
forName(String classname,
String[] options)
Instantiates the generator with the given options. |
weka.core.Instance |
generate(T data)
Returns the generated data, generates it if necessary. |
protected abstract void |
generateHeader(T data)
Generates the header of the output data. |
protected abstract weka.core.Instance |
generateOutput(T data)
Generates the actual data. |
boolean |
getAddDatabaseID()
Returns whether the database ID is added. |
AbstractDatabaseConnection |
getDatabaseConnection()
Returns the currently used database connection object, can be null. |
protected abstract AbstractDatabaseConnection |
getDefaultDatabaseConnection()
Returns the default database connection. |
static String[] |
getGenerators()
Returns a list with classnames of generators. |
weka.core.Instances |
getOutputHeader()
Returns the current header. |
protected void |
initialize()
Initializes the members. |
protected String |
interpretePosition(weka.core.Instances data,
String position)
Interpretes the position string based on the given dataset. |
protected void |
postProcessHeader(T data)
Adds IDs, notes, additional fields to header. |
protected weka.core.Instance |
postProcessOutput(T data,
weka.core.Instance inst)
For adding IDs, notes, additional fields to the data. |
protected void |
reset()
Resets the generator (but does not clear the input data!). |
void |
setAddDatabaseID(boolean value)
Sets whether the database ID is added to the data or not. |
void |
setDatabaseConnection(AbstractDatabaseConnection value)
Sets the database connection object to use. |
AbstractInstanceGenerator |
shallowCopy()
Returns a shallow copy of itself, i.e., based on the commandline options. |
AbstractInstanceGenerator |
shallowCopy(boolean expand)
Returns a shallow copy of itself, i.e., based on the commandline options. |
| 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 |
|---|
public static final String LABEL_TRUE
public static final String LABEL_FALSE
protected weka.core.Instances m_OutputHeader
protected boolean m_AddDatabaseID
protected AbstractDatabaseConnection m_DatabaseConnection
| Constructor Detail |
|---|
public AbstractInstanceGenerator()
| Method Detail |
|---|
public void defineOptions()
defineOptions in interface OptionHandlerdefineOptions in class AbstractOptionHandlerprotected void initialize()
initialize in class AbstractOptionHandlerprotected void reset()
reset in class AbstractOptionHandlerpublic void cleanUp()
cleanUp in interface CleanUpHandlerpublic void destroy()
destroy in interface Destroyabledestroy in class AbstractOptionHandlerpublic void setAddDatabaseID(boolean value)
value - true if database ID should be addedpublic boolean getAddDatabaseID()
public String addDatabaseIDTipText()
protected abstract AbstractDatabaseConnection getDefaultDatabaseConnection()
public AbstractDatabaseConnection getDatabaseConnection()
getDatabaseConnection in interface DatabaseConnectionProviderpublic void setDatabaseConnection(AbstractDatabaseConnection value)
setDatabaseConnection in interface DatabaseConnectionHandlervalue - the object to usepublic weka.core.Instances getOutputHeader()
public String checkSetup()
public weka.core.Instance generate(T data)
data - the profile to turn into an instance
protected void checkInput(T data)
data - the data to processprotected abstract void checkHeader(T data)
data - the input dataprotected abstract void generateHeader(T data)
data - the input data
protected String interpretePosition(weka.core.Instances data,
String position)
data - the data to base the intepretation onposition - the position string
protected void postProcessHeader(T data)
data - the input dataprotected abstract weka.core.Instance generateOutput(T data)
data - the input data to transform
protected weka.core.Instance postProcessOutput(T data,
weka.core.Instance inst)
data - the input datainst - the generated instance
public int compareTo(Object o)
compareTo in interface Comparableo - the object to be compared.
ClassCastException - if the specified object's type prevents it
from being compared to this object.public boolean equals(Object o)
equals in class Objecto - the object to be compared
public AbstractInstanceGenerator shallowCopy()
shallowCopy in interface ShallowCopySupporter<AbstractInstanceGenerator>public AbstractInstanceGenerator shallowCopy(boolean expand)
shallowCopy in interface ShallowCopySupporter<AbstractInstanceGenerator>expand - whether to expand variables to their current values
public static String[] getGenerators()
public static AbstractInstanceGenerator forName(String classname,
String[] options)
classname - the classname of the generator to instantiateoptions - the options for the generator
public static AbstractInstanceGenerator forCommandLine(String cmdline)
cmdline - the classname (and optional options) of the
generator to instantiate
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||