Class XMLExperiment
java.lang.Object
weka.core.xml.XMLSerialization
weka.core.xml.XMLBasicSerialization
weka.experiment.xml.XMLExperiment
- All Implemented Interfaces:
RevisionHandler
This class serializes and deserializes an Experiment instance to and
fro XML.
It omits the
Since there's no read-method for
It omits the
options from the Experiment, since these are handled
by the get/set-methods. For the Classifier class with all its
derivative classes it stores only debug and options.
For SplitEvaluator and ResultProducer only the
options are retrieved. The PropertyNode is done manually since
it has no get/set-methods for its public fields.Since there's no read-method for
m_ClassFirst we always save it
as false.- Version:
- $Revision: 1.6 $
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringthe name of the classFirst propertystatic final StringPropertyNode memberstatic final StringPropertyNode memberstatic final StringPropertyNode memberFields inherited from class XMLBasicSerialization
VAL_CELLS, VAL_KEY, VAL_MAPPING, VAL_VALUEFields inherited from class XMLSerialization
ATT_ARRAY, ATT_ARRAY_DEFAULT, ATT_CLASS, ATT_NAME, ATT_NULL, ATT_NULL_DEFAULT, ATT_PRIMITIVE, ATT_PRIMITIVE_DEFAULT, ATT_VERSION, DOCTYPE, ROOT_NODE, TAG_OBJECT, VAL_NO, VAL_ROOT, VAL_YES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()generates internally a new XML document and clears also the IgnoreList and the mappings for the Read/Write-MethodsReturns the revision string.static voidfor testing only.readPropertyNode(Element node) builds the PropertyNode from the given DOM node.writePropertyNode(Element parent, Object o, String name) adds the given PropertyNode to a DOM structure.Methods inherited from class XMLBasicSerialization
readCollection, readCostMatrixOld, readDefaultListModel, readMap, readMatrix, readMatrixOld, writeCollection, writeCostMatrixOld, writeDefaultListModel, writeMap, writeMatrix, writeMatrixOldMethods inherited from class XMLSerialization
fromXML, getVersion, read, read, read, read, readBooleanFromXML, readByteFromXML, readCharFromXML, readDoubleFromXML, readFloatFromXML, readFromXML, readFromXML, readIntFromXML, readLongFromXML, readShortFromXML, toXML, write, write, write, write, writeToXML
-
Field Details
-
NAME_CLASSFIRST
-
NAME_PROPERTYNODE_VALUE
-
NAME_PROPERTYNODE_PARENTCLASS
-
NAME_PROPERTYNODE_PROPERTY
-
-
Constructor Details
-
XMLExperiment
-
-
Method Details
-
clear
generates internally a new XML document and clears also the IgnoreList and the mappings for the Read/Write-Methods- Overrides:
clearin classXMLBasicSerialization- Throws:
Exception- if initializing fails
-
writePropertyNode
adds the given PropertyNode to a DOM structure.- Parameters:
parent- the parent of this object, e.g. the class this object is a member ofo- the Object to describe in XMLname- the name of the object- Returns:
- the node that was created
- Throws:
Exception- if the DOM creation fails
-
readPropertyNode
-
getRevision
Returns the revision string.- Specified by:
getRevisionin interfaceRevisionHandler- Overrides:
getRevisionin classXMLBasicSerialization- Returns:
- the revision
-
main
for testing only. if the first argument is a filename with ".xml" as extension it tries to generate an instance from the XML description and does atoString()of the generated object. Otherwise it loads the binary file, saves the XML representation in a file with the original filename appended by ".xml" and once again in a binary file with the original filename appended by ".exp".- Parameters:
args- the commandline arguments- Throws:
Exception- if something goes wrong, e.g., file not found
-