Package adams.flow.source
Class AbstractWekaSetupGenerator<T>
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.core.AbstractActor
-
- adams.flow.source.AbstractSource
-
- adams.flow.source.AbstractWekaSetupGenerator<T>
-
- Type Parameters:
T
- the type of setups to generate
- All Implemented Interfaces:
AdditionalInformationHandler
,CleanUpHandler
,Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,ShallowCopySupporter<Actor>
,SizeOfHandler
,Stoppable
,StoppableWithFeedback
,VariablesInspectionHandler
,VariableChangeListener
,Actor
,ErrorHandler
,OutputProducer
,Serializable
,Comparable
- Direct Known Subclasses:
WekaClassifierGenerator
,WekaClustererGenerator
,WekaFilterGenerator
public abstract class AbstractWekaSetupGenerator<T> extends AbstractSource
Abstract ancestor for setup generator sources. Derived classes must defined get/set/tiptext methods for the property "setup".- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected weka.core.SetupGenerator
m_Generator
the underlying setup generator.protected boolean
m_OutputArray
whether to output an array or a sequence of setups.protected List<T>
m_Setups
all the setups.-
Fields inherited from class adams.flow.core.AbstractActor
m_Annotations, m_BackupState, m_DetectedObjectVariables, m_DetectedVariables, m_ErrorHandler, m_Executed, m_Executing, m_ExecutionListeningSupporter, m_FullName, m_LoggingPrefix, m_Name, m_Parent, m_ScopeHandler, m_Self, m_Silent, m_Skip, m_StopFlowOnError, m_StopMessage, m_Stopped, m_StorageHandler, m_VariablesUpdated
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
Fields inherited from interface adams.flow.core.Actor
FILE_EXTENSION, FILE_EXTENSION_GZ
-
-
Constructor Summary
Constructors Constructor Description AbstractWekaSetupGenerator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.protected String
doExecute()
Executes the flow item.Class[]
generates()
Returns the class of objects that it generates.protected String
getDefaultPackage()
Returns the default package of the types of setups to generate.protected abstract weka.core.setupgenerator.AbstractParameter[]
getDefaultParameters()
Returns the default parameters.protected abstract T
getDefaultSetup()
Returns the default setup.protected abstract Class
getDefaultSuperClass()
Returns the default super class, the same as the type "T" when defining the generics.boolean
getOutputArray()
Returns whether to output an array or a sequence of classifier setups.weka.core.setupgenerator.AbstractParameter[]
getParameters()
Returns the setup parameters.String
getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.boolean
hasPendingOutput()
Checks whether there is pending output to be collected after executing the flow item.protected void
initialize()
Initializes the members.Token
output()
Returns the generated token.String
outputArrayTipText()
Returns the tip text for this property.String
parametersTipText()
Returns the tip text for this property.void
setOutputArray(boolean value)
Sets whether to output an array or a sequence of classifier setups.void
setParameters(weka.core.setupgenerator.AbstractParameter[] value)
Sets the setup parameters.void
wrapUp()
Cleans up after the execution has finished.-
Methods inherited from class adams.flow.core.AbstractActor
annotationsTipText, backupState, canInspectOptions, canPerformSetUpCheck, cleanUp, compareTo, configureLogger, destroy, equals, execute, finalUpdateVariables, findVariables, findVariables, forceVariables, forCommandLine, forName, forName, getAdditionalInformation, getAnnotations, getDefaultName, getDetectedVariables, getErrorHandler, getFlowActors, getFlowExecutionListeningSupporter, getFullName, getName, getNextSibling, getParent, getParentComponent, getPreviousSibling, getRoot, getScopeHandler, getSilent, getSkip, getStopFlowOnError, getStopMessage, getStorageHandler, getVariables, handleError, handleException, hasErrorHandler, hasStopMessage, index, isBackedUp, isExecuted, isExecuting, isFinished, isHeadless, isStopped, nameTipText, performSetUpChecks, performVariableChecks, postExecute, preExecute, pruneBackup, pruneBackup, reset, restoreState, setAnnotations, setErrorHandler, setName, setParent, setSilent, setSkip, setStopFlowOnError, setUp, setVariables, shallowCopy, shallowCopy, silentTipText, sizeOf, skipTipText, stopExecution, stopExecution, stopFlowOnErrorTipText, updateDetectedVariables, updatePrefix, updateVariables, variableChanged
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.flow.core.Actor
cleanUp, compareTo, destroy, equals, execute, findVariables, getAnnotations, getDefaultName, getDetectedVariables, getErrorHandler, getFlowExecutionListeningSupporter, getFullName, getName, getNextSibling, getParent, getParentComponent, getPreviousSibling, getRoot, getScopeHandler, getSilent, getSkip, getStopFlowOnError, getStopMessage, getStorageHandler, getVariables, handleError, hasErrorHandler, hasStopMessage, index, isExecuted, isFinished, isHeadless, isStopped, setAnnotations, setErrorHandler, setName, setParent, setSilent, setSkip, setStopFlowOnError, setUp, setVariables, shallowCopy, shallowCopy, sizeOf, stopExecution, stopExecution, toCommandLine, variableChanged
-
Methods inherited from interface adams.core.AdditionalInformationHandler
getAdditionalInformation
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel, setLoggingLevel
-
Methods inherited from interface adams.core.logging.LoggingSupporter
getLogger, isLoggingEnabled
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager
-
Methods inherited from interface adams.core.VariablesInspectionHandler
canInspectOptions
-
-
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractActor
-
getDefaultSetup
protected abstract T getDefaultSetup()
Returns the default setup. Used in the options as default value.- Returns:
- the default setup
- See Also:
defineOptions()
-
getDefaultParameters
protected abstract weka.core.setupgenerator.AbstractParameter[] getDefaultParameters()
Returns the default parameters. Used in the options as default value.- Returns:
- the default parameters
- See Also:
defineOptions()
-
getDefaultPackage
protected String getDefaultPackage()
Returns the default package of the types of setups to generate.- Returns:
- the default package
- See Also:
getQuickInfo()
,getDefaultSuperClass()
-
getDefaultSuperClass
protected abstract Class getDefaultSuperClass()
Returns the default super class, the same as the type "T" when defining the generics.- Returns:
- the default super class
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initialize
in classAbstractActor
-
setParameters
public void setParameters(weka.core.setupgenerator.AbstractParameter[] value)
Sets the setup parameters.- Parameters:
value
- the parameters
-
getParameters
public weka.core.setupgenerator.AbstractParameter[] getParameters()
Returns the setup parameters.- Returns:
- the parameters
-
parametersTipText
public String parametersTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setOutputArray
public void setOutputArray(boolean value)
Sets whether to output an array or a sequence of classifier setups.- Parameters:
value
- if true then an array will be output
-
getOutputArray
public boolean getOutputArray()
Returns whether to output an array or a sequence of classifier setups.- Returns:
- true if an array is output
-
outputArrayTipText
public String outputArrayTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.- Specified by:
getQuickInfo
in interfaceActor
- Specified by:
getQuickInfo
in interfaceQuickInfoSupporter
- Overrides:
getQuickInfo
in classAbstractActor
- Returns:
- null if no info available, otherwise short string
-
generates
public Class[] generates()
Returns the class of objects that it generates.- Returns:
- weka.classifiers.Classifier.class
-
doExecute
protected String doExecute()
Executes the flow item.- Specified by:
doExecute
in classAbstractActor
- Returns:
- null if everything is fine, otherwise error message
-
output
public Token output()
Returns the generated token.- Returns:
- the generated token
-
hasPendingOutput
public boolean hasPendingOutput()
Checks whether there is pending output to be collected after executing the flow item.- Returns:
- true if there is pending output
-
wrapUp
public void wrapUp()
Cleans up after the execution has finished. Graphical output is left untouched.- Specified by:
wrapUp
in interfaceActor
- Overrides:
wrapUp
in classAbstractActor
-
-