Package weka.core.xml
Class XMLInstances
java.lang.Object
weka.core.xml.XMLDocument
weka.core.xml.XMLInstances
- All Implemented Interfaces:
Serializable
,RevisionHandler
XML representation of the Instances class.
- Version:
- $Revision: 10203 $
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
the class attributestatic final String
the format attribute (for date attributes)static final String
the index attributestatic final String
the missing attributestatic final String
the type attributestatic final String
the version attributestatic final String
the weight attributestatic final String
the DTDstatic String
The filename extension that should be used for xrff filesstatic final String
the attribute elementstatic final String
the attributes elementstatic final String
the body elementstatic final String
the root elementstatic final String
the header elementstatic final String
the instance elementstatic final String
the data elementstatic final String
the label elementstatic final String
the labels elementstatic final String
the meta-data elementstatic final String
the notes elementstatic final String
the property elementstatic final String
the value elementstatic final String
the value for datestatic final String
the value for nominalstatic final String
the value for normalstatic final String
the value for numericstatic final String
the value for relationalstatic final String
the value for sparsestatic final String
the value for stringFields inherited from class weka.core.xml.XMLDocument
ATT_NAME, DTD_ANY, DTD_AT_LEAST_ONE, DTD_ATTLIST, DTD_CDATA, DTD_DOCTYPE, DTD_ELEMENT, DTD_IMPLIED, DTD_OPTIONAL, DTD_PCDATA, DTD_REQUIRED, DTD_SEPARATOR, DTD_ZERO_OR_MORE, PI, VAL_NO, VAL_YES
-
Constructor Summary
ConstructorDescriptionthe default constructorXMLInstances
(Reader reader) generates the Instances directly from the reader containing the XML data.XMLInstances
(Instances data) generates the XML structure based on the given data -
Method Summary
Modifier and TypeMethodDescriptionreturns the current instances, either the ones that were set or the ones that were generated from the XML structure.Returns the revision string.static void
takes an XML document as first argument and then outputs the Instances statisticsvoid
setInstances
(Instances data) builds up the XML structure based on the given datavoid
reads the XML structure from the given readerMethods inherited from class weka.core.xml.XMLDocument
clear, evalBoolean, evalDouble, evalString, findNodes, getBuilder, getChildTags, getChildTags, getContent, getDocType, getDocument, getFactory, getNode, getRootNode, getValidating, newDocument, print, read, read, read, read, setDocType, setDocument, setRootNode, setValidating, toString, write, write, write, write
-
Field Details
-
FILE_EXTENSION
The filename extension that should be used for xrff files -
TAG_DATASET
the root element- See Also:
-
TAG_HEADER
the header element- See Also:
-
TAG_BODY
the body element- See Also:
-
TAG_NOTES
the notes element- See Also:
-
TAG_ATTRIBUTES
the attributes element- See Also:
-
TAG_ATTRIBUTE
the attribute element- See Also:
-
TAG_LABELS
the labels element- See Also:
-
TAG_LABEL
the label element- See Also:
-
TAG_METADATA
the meta-data element- See Also:
-
TAG_PROPERTY
the property element- See Also:
-
TAG_INSTANCES
the data element- See Also:
-
TAG_INSTANCE
the instance element- See Also:
-
TAG_VALUE
the value element- See Also:
-
ATT_VERSION
the version attribute- See Also:
-
ATT_TYPE
the type attribute- See Also:
-
ATT_FORMAT
the format attribute (for date attributes)- See Also:
-
ATT_CLASS
the class attribute- See Also:
-
ATT_INDEX
the index attribute- See Also:
-
ATT_WEIGHT
the weight attribute- See Also:
-
ATT_MISSING
the missing attribute- See Also:
-
VAL_NUMERIC
the value for numeric- See Also:
-
VAL_DATE
the value for date- See Also:
-
VAL_NOMINAL
the value for nominal- See Also:
-
VAL_STRING
the value for string- See Also:
-
VAL_RELATIONAL
the value for relational- See Also:
-
VAL_NORMAL
the value for normal- See Also:
-
VAL_SPARSE
the value for sparse- See Also:
-
DOCTYPE
the DTD
-
-
Constructor Details
-
XMLInstances
the default constructor- Throws:
Exception
- if XML initialization fails
-
XMLInstances
generates the XML structure based on the given data- Parameters:
data
- the data to build the XML structure from- Throws:
Exception
- if initialization/generation fails
-
XMLInstances
generates the Instances directly from the reader containing the XML data.- Parameters:
reader
- the reader for the XML data- Throws:
Exception
- if something goes wrong
-
-
Method Details
-
setInstances
builds up the XML structure based on the given data- Parameters:
data
- data to generate the XML from
-
getInstances
returns the current instances, either the ones that were set or the ones that were generated from the XML structure.- Returns:
- the current instances
-
setXML
reads the XML structure from the given reader- Parameters:
reader
- the reader to get the XML from- Throws:
Exception
- if
-
getRevision
Returns the revision string.- Specified by:
getRevision
in interfaceRevisionHandler
- Overrides:
getRevision
in classXMLDocument
- Returns:
- the revision
-
main
takes an XML document as first argument and then outputs the Instances statistics- Parameters:
args
- the commandline options
-