Package adams.opt.genetic.setupupload
Class MySQL
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,FlowContextHandler
,Serializable
public class MySQL extends AbstractSetupUpload
Stores the setup information in the specified MySQL table.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
KEY_SUCCESSFUL
protected AbstractDatabaseConnection
m_DatabaseConnection
the database connection.protected String
m_Table
the table to store the setups in.-
Fields inherited from class adams.opt.genetic.setupupload.AbstractSetupUpload
KEY_FITNESS, KEY_MEASURE, m_Experiment, m_FlowContext
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description MySQL()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.protected void
doFinish(AbstractGeneticAlgorithm algorithm, String error, Map<String,Object> params)
Finishing up the genetic algorithm run.protected void
doStart(AbstractGeneticAlgorithm algorithm)
Before Starting the uploads, ie the genetic algorithm run.protected String
doUpload(Map<String,Object> setup)
Uploads the setup.String
getTable()
Returns the table name to use.String
globalInfo()
Returns a string describing the object.protected String
initDatabase()
Initializes the database connection, if necessary.protected String
initTable()
Initializes the table.boolean
requiresFlowContext()
Returns whether flow context is required.protected void
reset()
Resets the scheme.void
setTable(String value)
Sets the table name to use.String
tableTipText()
Returns the tip text for this property.-
Methods inherited from class adams.opt.genetic.setupupload.AbstractSetupUpload
experimentTipText, finish, getExperiment, getFlowContext, setExperiment, setFlowContext, start, toProperties, upload
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
KEY_SUCCESSFUL
public static final String KEY_SUCCESSFUL
- See Also:
- Constant Field Values
-
m_Table
protected String m_Table
the table to store the setups in.
-
m_DatabaseConnection
protected AbstractDatabaseConnection m_DatabaseConnection
the database connection.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceGlobalInfoSupporter
- Specified by:
globalInfo
in classAbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractSetupUpload
-
setTable
public void setTable(String value)
Sets the table name to use.- Parameters:
value
- the name
-
getTable
public String getTable()
Returns the table name to use.- Returns:
- the name
-
tableTipText
public String tableTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
reset
protected void reset()
Resets the scheme.- Overrides:
reset
in classAbstractOptionHandler
-
requiresFlowContext
public boolean requiresFlowContext()
Returns whether flow context is required.- Specified by:
requiresFlowContext
in classAbstractSetupUpload
- Returns:
- true if required
-
doStart
protected void doStart(AbstractGeneticAlgorithm algorithm)
Before Starting the uploads, ie the genetic algorithm run.- Specified by:
doStart
in classAbstractSetupUpload
- Parameters:
algorithm
- the algorithm initiating the run
-
initDatabase
protected String initDatabase()
Initializes the database connection, if necessary.- Returns:
- null if successful or already initialized, otherwise error message
-
initTable
protected String initTable()
Initializes the table.- Returns:
- null if successful or already initialized, otherwise error message
-
doUpload
protected String doUpload(Map<String,Object> setup)
Uploads the setup.- Specified by:
doUpload
in classAbstractSetupUpload
- Parameters:
setup
- the setup data to upload- Returns:
- null if successful, otherwise error message
-
doFinish
protected void doFinish(AbstractGeneticAlgorithm algorithm, String error, Map<String,Object> params)
Finishing up the genetic algorithm run.- Specified by:
doFinish
in classAbstractSetupUpload
- Parameters:
algorithm
- the algorithm that initiated the runerror
- null if successful, otherwise error messageparams
- the parameters to store
-
-