|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.core.xml.XMLSerialization
weka.core.xml.XMLBasicSerialization
weka.experiment.xml.XMLExperiment
public class XMLExperiment
This class serializes and deserializes an Experiment instance to and
fro XML.
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
.
Experiment.m_ClassFirst
Field Summary | |
---|---|
static java.lang.String |
NAME_CLASSFIRST
the name of the classFirst property |
static java.lang.String |
NAME_PROPERTYNODE_PARENTCLASS
PropertyNode member |
static java.lang.String |
NAME_PROPERTYNODE_PROPERTY
PropertyNode member |
static java.lang.String |
NAME_PROPERTYNODE_VALUE
PropertyNode member |
Fields inherited from class weka.core.xml.XMLBasicSerialization |
---|
VAL_CELLS, VAL_KEY, VAL_MAPPING, VAL_VALUE |
Fields inherited from class weka.core.xml.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 | |
---|---|
XMLExperiment()
initializes the serialization |
Method Summary | |
---|---|
void |
clear()
generates internally a new XML document and clears also the IgnoreList and the mappings for the Read/Write-Methods |
java.lang.String |
getRevision()
Returns the revision string. |
static void |
main(java.lang.String[] args)
for testing only. |
java.lang.Object |
readPropertyNode(org.w3c.dom.Element node)
builds the PropertyNode from the given DOM node. |
org.w3c.dom.Element |
writePropertyNode(org.w3c.dom.Element parent,
java.lang.Object o,
java.lang.String name)
adds the given PropertyNode to a DOM structure. |
Methods inherited from class weka.core.xml.XMLBasicSerialization |
---|
readCollection, readCostMatrixOld, readDefaultListModel, readMap, readMatrix, readMatrixOld, writeCollection, writeCostMatrixOld, writeDefaultListModel, writeMap, writeMatrix, writeMatrixOld |
Methods inherited from class weka.core.xml.XMLSerialization |
---|
fromXML, getVersion, read, read, read, read, readBooleanFromXML, readByteFromXML, readCharFromXML, readDoubleFromXML, readFloatFromXML, readFromXML, readFromXML, readIntFromXML, readLongFromXML, readShortFromXML, toXML, write, write, write, write, writeToXML |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String NAME_CLASSFIRST
public static final java.lang.String NAME_PROPERTYNODE_VALUE
public static final java.lang.String NAME_PROPERTYNODE_PARENTCLASS
public static final java.lang.String NAME_PROPERTYNODE_PROPERTY
Constructor Detail |
---|
public XMLExperiment() throws java.lang.Exception
java.lang.Exception
- if initialization failsMethod Detail |
---|
public void clear() throws java.lang.Exception
clear
in class XMLBasicSerialization
java.lang.Exception
- if initializing failspublic org.w3c.dom.Element writePropertyNode(org.w3c.dom.Element parent, java.lang.Object o, java.lang.String name) throws java.lang.Exception
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
java.lang.Exception
- if the DOM creation failspublic java.lang.Object readPropertyNode(org.w3c.dom.Element node) throws java.lang.Exception
node
- the associated XML node
java.lang.Exception
- if instantiation failsDefaultListModel
public java.lang.String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class XMLBasicSerialization
public static void main(java.lang.String[] args) throws java.lang.Exception
toString()
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".
args
- the commandline arguments
java.lang.Exception
- if something goes wrong, e.g., file not found
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |