adams.flow.source
Class AbstractWekaSetupGenerator<T>

java.lang.Object
  extended by adams.core.ConsoleObject
      extended by adams.core.option.AbstractOptionHandler
          extended by adams.flow.core.AbstractActor
              extended by adams.flow.source.AbstractSource
                  extended by adams.flow.source.AbstractWekaSetupGenerator<T>
Type Parameters:
T - the type of setups to generate
All Implemented Interfaces:
AdditionalInformationHandler, CleanUpHandler, Debuggable, DebugOutputHandler, Destroyable, OptionHandler, QuickInfoSupporter, ShallowCopySupporter<AbstractActor>, SizeOfHandler, Stoppable, VariableChangeListener, 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: 4584 $
Author:
fracpete (fracpete at waikato dot ac dot nz)
See Also:
Serialized Form

Field Summary
protected  SetupGenerator m_Generator
          the underlying setup generator.
protected  boolean m_OutputArray
          whether to output an array or a sequence of setups.
protected  Vector<T> m_Setups
          all the setups.
 
Fields inherited from class adams.flow.core.AbstractActor
FILE_EXTENSION, FILE_EXTENSION_GZ, m_Annotations, m_BackupState, m_DetectedObjectVariables, m_DetectedVariables, m_ErrorHandler, m_Executed, m_FullName, m_Headless, m_Name, m_Parent, m_Root, m_Self, m_Skip, m_StopFlowOnError, m_StopMessage, m_Stopped, m_StorageHandler, m_VariablesUpdated
 
Fields inherited from class adams.core.option.AbstractOptionHandler
m_DebugLevel, m_OptionManager
 
Constructor Summary
AbstractWekaSetupGenerator()
           
 
Method Summary
 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  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.
 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(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, debug, destroy, equals, execute, findVariables, findVariables, findVariables, forceVariables, forCommandLine, forName, getAdditionalInformation, getAnnotations, getDefaultName, getDetectedVariables, getErrorHandler, getFlowActors, getFullName, getName, getNextSibling, getParent, getPreviousSibling, getRoot, getSkip, getStopFlowOnError, getStopMessage, getStorageHandler, getVariables, handleError, hasErrorHandler, hasStopMessage, index, isBackedUp, isExecuted, isFinished, isHeadless, isStopped, nameTipText, performSetUpChecks, postExecute, preExecute, pruneBackup, pruneBackup, reset, restoreState, setAnnotations, setErrorHandler, setHeadless, setName, setParent, setSkip, setStopFlowOnError, setUp, setVariables, shallowCopy, shallowCopy, sizeOf, skipTipText, stopExecution, stopExecution, stopFlowOnErrorTipText, updateDetectedVariables, updatePrefix, updateVariables, variableChanged
 
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, debug, debugLevelTipText, finishInit, getDebugLevel, getOptionManager, globalInfo, isDebugOn, newOptionManager, setDebugLevel, toCommandLine, toString
 
Methods inherited from class adams.core.ConsoleObject
getDebugging, getSystemErr, getSystemOut
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_OutputArray

protected boolean m_OutputArray
whether to output an array or a sequence of setups.


m_Generator

protected SetupGenerator m_Generator
the underlying setup generator.


m_Setups

protected Vector<T> m_Setups
all the setups.

Constructor Detail

AbstractWekaSetupGenerator

public AbstractWekaSetupGenerator()
Method Detail

defineOptions

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

Specified by:
defineOptions in interface OptionHandler
Overrides:
defineOptions in class 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 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 class AbstractActor

setParameters

public void setParameters(AbstractParameter[] value)
Sets the setup parameters.

Parameters:
value - the parameters

getParameters

public 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 interface QuickInfoSupporter
Overrides:
getQuickInfo in class 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:
doExecute in class AbstractActor
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.

Overrides:
wrapUp in class AbstractActor


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