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:
adams.core.AdditionalInformationHandler,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<adams.flow.core.Actor>,adams.core.SizeOfHandler,adams.core.Stoppable,adams.core.StoppableWithFeedback,adams.core.VariablesInspectionHandler,adams.event.VariableChangeListener,adams.flow.core.Actor,adams.flow.core.ErrorHandler,adams.flow.core.OutputProducer,Serializable,Comparable
- Direct Known Subclasses:
WekaClassifierGenerator,WekaClustererGenerator,WekaFilterGenerator
public abstract class AbstractWekaSetupGenerator<T> extends adams.flow.source.AbstractSourceAbstract 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.SetupGeneratorm_Generatorthe underlying setup generator.protected booleanm_OutputArraywhether to output an array or a sequence of setups.protected List<T>m_Setupsall 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
-
-
Constructor Summary
Constructors Constructor Description AbstractWekaSetupGenerator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voiddefineOptions()Adds options to the internal list of options.protected StringdoExecute()Executes the flow item.Class[]generates()Returns the class of objects that it generates.protected StringgetDefaultPackage()Returns the default package of the types of setups to generate.protected abstract weka.core.setupgenerator.AbstractParameter[]getDefaultParameters()Returns the default parameters.protected abstract TgetDefaultSetup()Returns the default setup.protected abstract ClassgetDefaultSuperClass()Returns the default super class, the same as the type "T" when defining the generics.booleangetOutputArray()Returns whether to output an array or a sequence of classifier setups.weka.core.setupgenerator.AbstractParameter[]getParameters()Returns the setup parameters.StringgetQuickInfo()Returns a quick info about the actor, which will be displayed in the GUI.booleanhasPendingOutput()Checks whether there is pending output to be collected after executing the flow item.protected voidinitialize()Initializes the members.adams.flow.core.Tokenoutput()Returns the generated token.StringoutputArrayTipText()Returns the tip text for this property.StringparametersTipText()Returns the tip text for this property.voidsetOutputArray(boolean value)Sets whether to output an array or a sequence of classifier setups.voidsetParameters(weka.core.setupgenerator.AbstractParameter[] value)Sets the setup parameters.voidwrapUp()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
-
-
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceadams.core.option.OptionHandler- Overrides:
defineOptionsin classadams.flow.core.AbstractActor
-
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:
initializein classadams.flow.core.AbstractActor
-
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:
getQuickInfoin interfaceadams.flow.core.Actor- Specified by:
getQuickInfoin interfaceadams.core.QuickInfoSupporter- Overrides:
getQuickInfoin classadams.flow.core.AbstractActor- 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:
doExecutein classadams.flow.core.AbstractActor- Returns:
- null if everything is fine, otherwise error message
-
output
public adams.flow.core.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:
wrapUpin interfaceadams.flow.core.Actor- Overrides:
wrapUpin classadams.flow.core.AbstractActor
-
-