weka.core
Class CheckOptionHandler

java.lang.Object
  extended byweka.core.CheckOptionHandler

public class CheckOptionHandler
extends java.lang.Object

Simple command line checking of classes that implement OptionHandler.

Usage:

CheckOptionHandler -W optionHandlerClassName -- test options

Valid options are:

-W classname
The name of a class implementing an OptionHandler.

Options after -- are used as user options in testing the OptionHandler

Version:
$Revision: 1.7 $
Author:
Len Trigg (trigg@cs.waikato.ac.nz)

Constructor Summary
CheckOptionHandler()
           
 
Method Summary
static void checkOptionHandler(OptionHandler oh, java.lang.String[] options)
          Runs some diagnostic tests on an optionhandler object.
static void compareOptions(java.lang.String[] options1, java.lang.String[] options2)
          Compares the two given sets of options.
static void main(java.lang.String[] args)
          Main method for using the CheckOptionHandler.
static java.lang.String printOptions(java.lang.String[] options)
          Prints the given options to a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CheckOptionHandler

public CheckOptionHandler()
Method Detail

printOptions

public static java.lang.String printOptions(java.lang.String[] options)
Prints the given options to a string.

Parameters:
options - the options to be joined

compareOptions

public static void compareOptions(java.lang.String[] options1,
                                  java.lang.String[] options2)
                           throws java.lang.Exception
Compares the two given sets of options.

Parameters:
options1 - the first set of options
options2 - the second set of options
Throws:
java.lang.Exception - if the two sets of options differ

checkOptionHandler

public static void checkOptionHandler(OptionHandler oh,
                                      java.lang.String[] options)
                               throws java.lang.Exception
Runs some diagnostic tests on an optionhandler object. Output is printed to System.out.

Parameters:
oh - the OptionHandler of interest
options - an array of strings containing some test command line options
Throws:
java.lang.Exception - if the option handler fails any of the tests.

main

public static void main(java.lang.String[] args)
Main method for using the CheckOptionHandler.

Valid options are:

-W classname
The name of the class implementing an OptionHandler.

Options after -- are used as user options in testing the OptionHandler