类 XMLExperiment

所有已实现的接口:
RevisionHandler

public class XMLExperiment extends XMLBasicSerialization
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.
版本:
$Revision: 1.6 $
作者:
FracPete (fracpete at waikato dot ac dot nz)
另请参阅:
  • Experiment.m_ClassFirst
  • 字段详细资料

    • NAME_CLASSFIRST

      public static final String NAME_CLASSFIRST
      the name of the classFirst property
      另请参阅:
    • NAME_PROPERTYNODE_VALUE

      public static final String NAME_PROPERTYNODE_VALUE
      PropertyNode member
      另请参阅:
    • NAME_PROPERTYNODE_PARENTCLASS

      public static final String NAME_PROPERTYNODE_PARENTCLASS
      PropertyNode member
      另请参阅:
    • NAME_PROPERTYNODE_PROPERTY

      public static final String NAME_PROPERTYNODE_PROPERTY
      PropertyNode member
      另请参阅:
  • 构造器详细资料

    • XMLExperiment

      public XMLExperiment() throws Exception
      initializes the serialization
      抛出:
      Exception - if initialization fails
  • 方法详细资料

    • clear

      public void clear() throws Exception
      generates internally a new XML document and clears also the IgnoreList and the mappings for the Read/Write-Methods
      覆盖:
      clear 在类中 XMLBasicSerialization
      抛出:
      Exception - if initializing fails
    • writePropertyNode

      public Element writePropertyNode(Element parent, Object o, String name) throws Exception
      adds the given PropertyNode to a DOM structure.
      参数:
      parent - the parent of this object, e.g. the class this object is a member of
      o - the Object to describe in XML
      name - the name of the object
      返回:
      the node that was created
      抛出:
      Exception - if the DOM creation fails
    • readPropertyNode

      public Object readPropertyNode(Element node) throws Exception
      builds the PropertyNode from the given DOM node.
      参数:
      node - the associated XML node
      返回:
      the instance created from the XML description
      抛出:
      Exception - if instantiation fails
      另请参阅:
    • getRevision

      public String getRevision()
      Returns the revision string.
      指定者:
      getRevision 在接口中 RevisionHandler
      覆盖:
      getRevision 在类中 XMLBasicSerialization
      返回:
      the revision
    • main

      public static void main(String[] args) throws Exception
      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 a 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
      抛出:
      Exception - if something goes wrong, e.g., file not found