Package weka.core
Class CheckOptionHandler
java.lang.Object
weka.core.Check
weka.core.CheckOptionHandler
- All Implemented Interfaces:
OptionHandler,RevisionHandler
Simple command line checking of classes that implement OptionHandler.
Usage:
CheckOptionHandler -W optionHandlerClassName -- test options
Valid options are:
-D Turn on debugging output.
-S Silent mode - prints nothing to stdout.
-W Full name of the OptionHandler analysed. eg: weka.classifiers.rules.ZeroR (default weka.classifiers.rules.ZeroR)
Options specific to option handler weka.classifiers.rules.ZeroR:
-D If set, classifier is run in debug mode and may output additional info to the consoleOptions after -- are used as user options in testing the OptionHandler
- Version:
- $Revision: 10203 $
- Author:
- Len Trigg (trigg@cs.waikato.ac.nz), FracPete (fracpete at waikato dot ac dot nz)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanchecks whether the user-supplied options stay the same after settting, getting and re-setting againbooleanchecks whether the default options can be processed completely or some invalid options are returned by the getOptions() method.booleanchecks whether the listOptions method worksbooleanchecks whether the user-supplied options can be processed completely or some "left-over" options remainbooleanchecks whether the optionhandler can be re-setted again to default options after the user-supplied options have been set.booleanchecks whether the user-supplied options can be processed at allvoiddoTests()Runs some diagnostic tests on an optionhandler object.Get the OptionHandler used in the tests.String[]Gets the current settings of the CheckClassifier.Returns the revision string.booleanreturns the success of the testsString[]Gets the current user-supplied options (creates a copy)Returns an enumeration describing the available options.static voidMain method for using the CheckOptionHandler.voidsetOptionHandler(OptionHandler value) Set the OptionHandler to work on..voidsetOptions(String[] options) Parses a given list of options.voidsetUserOptions(String[] value) Sets the user-supplied options (creates a copy)
-
Constructor Details
-
CheckOptionHandler
public CheckOptionHandler()
-
-
Method Details
-
listOptions
Returns an enumeration describing the available options.- Specified by:
listOptionsin interfaceOptionHandler- Overrides:
listOptionsin classCheck- Returns:
- an enumeration of all the available options.
-
setOptions
Parses a given list of options. Valid options are:-D Turn on debugging output.
-S Silent mode - prints nothing to stdout.
-W Full name of the OptionHandler analysed. eg: weka.classifiers.rules.ZeroR (default weka.classifiers.rules.ZeroR)
Options specific to option handler weka.classifiers.rules.ZeroR:
-D If set, classifier is run in debug mode and may output additional info to the console
- Specified by:
setOptionsin interfaceOptionHandler- Overrides:
setOptionsin classCheck- Parameters:
options- the list of options as an array of strings- Throws:
Exception- if an option is not supported
-
getOptions
Gets the current settings of the CheckClassifier.- Specified by:
getOptionsin interfaceOptionHandler- Overrides:
getOptionsin classCheck- Returns:
- an array of strings suitable for passing to setOptions
-
setOptionHandler
Set the OptionHandler to work on..- Parameters:
value- the OptionHandler to use.
-
getOptionHandler
Get the OptionHandler used in the tests.- Returns:
- the OptionHandler used in the tests.
-
setUserOptions
Sets the user-supplied options (creates a copy)- Parameters:
value- the user-supplied options to use
-
getUserOptions
Gets the current user-supplied options (creates a copy)- Returns:
- the user-supplied options
-
getSuccess
public boolean getSuccess()returns the success of the tests- Returns:
- true if the tests were successful
-
checkListOptions
public boolean checkListOptions()checks whether the listOptions method works- Returns:
- index 0 is true if the test was passed, index 1 is always false
-
checkSetOptions
public boolean checkSetOptions()checks whether the user-supplied options can be processed at all- Returns:
- index 0 is true if the test was passed, index 1 is always false
-
checkDefaultOptions
public boolean checkDefaultOptions()checks whether the default options can be processed completely or some invalid options are returned by the getOptions() method.- Returns:
- index 0 is true if the test was passed, index 1 is always false
-
checkRemainingOptions
public boolean checkRemainingOptions()checks whether the user-supplied options can be processed completely or some "left-over" options remain- Returns:
- index 0 is true if the test was passed, index 1 is always false
-
checkCanonicalUserOptions
public boolean checkCanonicalUserOptions()checks whether the user-supplied options stay the same after settting, getting and re-setting again- Returns:
- index 0 is true if the test was passed, index 1 is always false
-
checkResettingOptions
public boolean checkResettingOptions()checks whether the optionhandler can be re-setted again to default options after the user-supplied options have been set.- Returns:
- index 0 is true if the test was passed, index 1 is always false
-
doTests
public void doTests()Runs some diagnostic tests on an optionhandler object. Output is printed to System.out (if not silent). -
getRevision
Returns the revision string.- Returns:
- the revision
-
main
Main method for using the CheckOptionHandler.- Parameters:
args- the options to the CheckOptionHandler
-