|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.filters.CheckSource
public class CheckSource
A simple class for checking the source generated from Filters
implementing the weka.filters.Sourcable
interface.
It takes a filter, the classname of the generated source
and the dataset the source was generated with as parameters and tests
the output of the built filter against the output of the generated
source. Use option '-h' to display all available commandline options.
Valid options are:
-W <classname and options> The filter (incl. options) that was used to generate the source code.
-S <classname> The classname of the generated source code.
-t <file> The training set with which the source code was generated.
-c <index> The class index of the training set. 'first' and 'last' are valid indices. (default: none)Options after -- are passed to the designated filter.
Sourcable
Constructor Summary | |
---|---|
CheckSource()
|
Method Summary | |
---|---|
boolean |
execute()
performs the comparison test |
int |
getClassIndex()
Gets the class index of the dataset. |
File |
getDataset()
Gets the dataset to use for testing, can be null. |
Filter |
getFilter()
Gets the filter being used for the tests, can be null. |
String[] |
getOptions()
Gets the current settings of the filter. |
String |
getRevision()
Returns the revision string. |
Filter |
getSourceCode()
Gets the class to test. |
Enumeration |
listOptions()
Returns an enumeration describing the available options. |
static void |
main(String[] args)
Executes the tests, use "-h" to list the commandline options. |
void |
setClassIndex(int value)
Sets the class index of the dataset. |
void |
setDataset(File value)
Sets the dataset to use for testing. |
void |
setFilter(Filter value)
Sets the filter to use for the comparison. |
void |
setOptions(String[] options)
Parses a given list of options. |
void |
setSourceCode(Filter value)
Sets the class to test. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CheckSource()
Method Detail |
---|
public Enumeration listOptions()
listOptions
in interface OptionHandler
public void setOptions(String[] options) throws Exception
-W <classname and options> The filter (incl. options) that was used to generate the source code.
-S <classname> The classname of the generated source code.
-t <file> The training set with which the source code was generated.
-c <index> The class index of the training set. 'first' and 'last' are valid indices. (default: none)Options after -- are passed to the designated filter.
setOptions
in interface OptionHandler
options
- the list of options as an array of strings
Exception
- if an option is not supportedpublic String[] getOptions()
getOptions
in interface OptionHandler
public void setFilter(Filter value)
value
- the filter to usepublic Filter getFilter()
public void setSourceCode(Filter value)
value
- the class to testpublic Filter getSourceCode()
public void setDataset(File value)
value
- the dataset to use.public File getDataset()
public void setClassIndex(int value)
value
- the class index of the dataset.public int getClassIndex()
public boolean execute() throws Exception
Exception
- if tests failpublic String getRevision()
getRevision
in interface RevisionHandler
public static void main(String[] args) throws Exception
args
- the commandline parameters
Exception
- if something goes wrong
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |