XMLInstances (original) (raw)
java.lang.Object
- weka.core.xml.XMLDocument
- weka.core.xml.XMLInstances
All Implemented Interfaces:
java.io.Serializable, RevisionHandler
public class XMLInstances
extends XMLDocument
implements java.io.Serializable
XML representation of the Instances class.
Version: Revision:1.4Revision: 1.4 Revision:1.4
Author:
fracpete (fracpete at waikato dot ac dot nz)
See Also:
Serialized Form
Field Summary
Fields
Modifier and Type Field and Description static java.lang.String ATT_CLASS the class attribute static java.lang.String ATT_FORMAT the format attribute (for date attributes) static java.lang.String ATT_INDEX the index attribute static java.lang.String ATT_MISSING the missing attribute static java.lang.String ATT_TYPE the type attribute static java.lang.String ATT_VERSION the version attribute static java.lang.String ATT_WEIGHT the weight attribute static java.lang.String DOCTYPE the DTD static java.lang.String FILE_EXTENSION The filename extension that should be used for xrff files static java.lang.String TAG_ATTRIBUTE the attribute element static java.lang.String TAG_ATTRIBUTES the attributes element static java.lang.String TAG_BODY the body element static java.lang.String TAG_DATASET the root element static java.lang.String TAG_HEADER the header element static java.lang.String TAG_INSTANCE the instance element static java.lang.String TAG_INSTANCES the data element static java.lang.String TAG_LABEL the label element static java.lang.String TAG_LABELS the labels element static java.lang.String TAG_METADATA the meta-data element static java.lang.String TAG_NOTES the notes element static java.lang.String TAG_PROPERTY the property element static java.lang.String TAG_VALUE the value element static java.lang.String VAL_DATE the value for date static java.lang.String VAL_NOMINAL the value for nominal static java.lang.String VAL_NORMAL the value for normal static java.lang.String VAL_NUMERIC the value for numeric static java.lang.String VAL_RELATIONAL the value for relational static java.lang.String VAL_SPARSE the value for sparse static java.lang.String VAL_STRING the value for string * ### Fields inherited from class weka.core.xml.[XMLDocument](../../../weka/core/xml/XMLDocument.html "class in weka.core.xml") `[ATT_NAME](../../../weka/core/xml/XMLDocument.html#ATT%5FNAME), [DTD_ANY](../../../weka/core/xml/XMLDocument.html#DTD%5FANY), [DTD_AT_LEAST_ONE](../../../weka/core/xml/XMLDocument.html#DTD%5FAT%5FLEAST%5FONE), [DTD_ATTLIST](../../../weka/core/xml/XMLDocument.html#DTD%5FATTLIST), [DTD_CDATA](../../../weka/core/xml/XMLDocument.html#DTD%5FCDATA), [DTD_DOCTYPE](../../../weka/core/xml/XMLDocument.html#DTD%5FDOCTYPE), [DTD_ELEMENT](../../../weka/core/xml/XMLDocument.html#DTD%5FELEMENT), [DTD_IMPLIED](../../../weka/core/xml/XMLDocument.html#DTD%5FIMPLIED), [DTD_OPTIONAL](../../../weka/core/xml/XMLDocument.html#DTD%5FOPTIONAL), [DTD_PCDATA](../../../weka/core/xml/XMLDocument.html#DTD%5FPCDATA), [DTD_REQUIRED](../../../weka/core/xml/XMLDocument.html#DTD%5FREQUIRED), [DTD_SEPARATOR](../../../weka/core/xml/XMLDocument.html#DTD%5FSEPARATOR), [DTD_ZERO_OR_MORE](../../../weka/core/xml/XMLDocument.html#DTD%5FZERO%5FOR%5FMORE), [PI](../../../weka/core/xml/XMLDocument.html#PI), [VAL_NO](../../../weka/core/xml/XMLDocument.html#VAL%5FNO), [VAL_YES](../../../weka/core/xml/XMLDocument.html#VAL%5FYES)`
Constructor Summary
Constructors
Constructor and Description XMLInstances() the default constructor XMLInstances(Instances data) generates the XML structure based on the given data XMLInstances(java.io.Reader reader) generates the Instances directly from the reader containing the XML data. Method Summary
All Methods Static Methods Instance Methods Concrete Methods
Modifier and Type Method and Description Instances getInstances() returns the current instances, either the ones that were set or the ones that were generated from the XML structure. java.lang.String getRevision() Returns the revision string. static void main(java.lang.String[] args) takes an XML document as first argument and then outputs the Instances statistics void setInstances(Instances data) builds up the XML structure based on the given data void setXML(java.io.Reader reader) reads the XML structure from the given reader * ### Methods inherited from class weka.core.xml.[XMLDocument](../../../weka/core/xml/XMLDocument.html "class in weka.core.xml") `[clear](../../../weka/core/xml/XMLDocument.html#clear--), [evalBoolean](../../../weka/core/xml/XMLDocument.html#evalBoolean-java.lang.String-), [evalDouble](../../../weka/core/xml/XMLDocument.html#evalDouble-java.lang.String-), [evalString](../../../weka/core/xml/XMLDocument.html#evalString-java.lang.String-), [findNodes](../../../weka/core/xml/XMLDocument.html#findNodes-java.lang.String-), [getBuilder](../../../weka/core/xml/XMLDocument.html#getBuilder--), [getChildTags](../../../weka/core/xml/XMLDocument.html#getChildTags-org.w3c.dom.Node-), [getChildTags](../../../weka/core/xml/XMLDocument.html#getChildTags-org.w3c.dom.Node-java.lang.String-), [getContent](../../../weka/core/xml/XMLDocument.html#getContent-org.w3c.dom.Element-), [getDocType](../../../weka/core/xml/XMLDocument.html#getDocType--), [getDocument](../../../weka/core/xml/XMLDocument.html#getDocument--), [getFactory](../../../weka/core/xml/XMLDocument.html#getFactory--), [getNode](../../../weka/core/xml/XMLDocument.html#getNode-java.lang.String-), [getRootNode](../../../weka/core/xml/XMLDocument.html#getRootNode--), [getValidating](../../../weka/core/xml/XMLDocument.html#getValidating--), [newDocument](../../../weka/core/xml/XMLDocument.html#newDocument-java.lang.String-java.lang.String-), [print](../../../weka/core/xml/XMLDocument.html#print--), [read](../../../weka/core/xml/XMLDocument.html#read-java.io.File-), [read](../../../weka/core/xml/XMLDocument.html#read-java.io.InputStream-), [read](../../../weka/core/xml/XMLDocument.html#read-java.io.Reader-), [read](../../../weka/core/xml/XMLDocument.html#read-java.lang.String-), [setDocType](../../../weka/core/xml/XMLDocument.html#setDocType-java.lang.String-), [setDocument](../../../weka/core/xml/XMLDocument.html#setDocument-org.w3c.dom.Document-), [setRootNode](../../../weka/core/xml/XMLDocument.html#setRootNode-java.lang.String-), [setValidating](../../../weka/core/xml/XMLDocument.html#setValidating-boolean-), [toString](../../../weka/core/xml/XMLDocument.html#toString--), [write](../../../weka/core/xml/XMLDocument.html#write-java.io.File-), [write](../../../weka/core/xml/XMLDocument.html#write-java.io.OutputStream-), [write](../../../weka/core/xml/XMLDocument.html#write-java.lang.String-), [write](../../../weka/core/xml/XMLDocument.html#write-java.io.Writer-)` * ### Methods inherited from class java.lang.Object `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`
Field Detail
* #### FILE\_EXTENSION public static java.lang.String FILE_EXTENSION The filename extension that should be used for xrff files * #### TAG\_DATASET public static final java.lang.String TAG_DATASET the root element See Also: [Constant Field Values](../../../constant-values.html#weka.core.xml.XMLInstances.TAG%5FDATASET) * #### TAG\_HEADER public static final java.lang.String TAG_HEADER the header element See Also: [Constant Field Values](../../../constant-values.html#weka.core.xml.XMLInstances.TAG%5FHEADER) * #### TAG\_BODY public static final java.lang.String TAG_BODY the body element See Also: [Constant Field Values](../../../constant-values.html#weka.core.xml.XMLInstances.TAG%5FBODY) * #### TAG\_NOTES public static final java.lang.String TAG_NOTES the notes element See Also: [Constant Field Values](../../../constant-values.html#weka.core.xml.XMLInstances.TAG%5FNOTES) * #### TAG\_ATTRIBUTES public static final java.lang.String TAG_ATTRIBUTES the attributes element See Also: [Constant Field Values](../../../constant-values.html#weka.core.xml.XMLInstances.TAG%5FATTRIBUTES) * #### TAG\_ATTRIBUTE public static final java.lang.String TAG_ATTRIBUTE the attribute element See Also: [Constant Field Values](../../../constant-values.html#weka.core.xml.XMLInstances.TAG%5FATTRIBUTE) * #### TAG\_LABELS public static final java.lang.String TAG_LABELS the labels element See Also: [Constant Field Values](../../../constant-values.html#weka.core.xml.XMLInstances.TAG%5FLABELS) * #### TAG\_LABEL public static final java.lang.String TAG_LABEL the label element See Also: [Constant Field Values](../../../constant-values.html#weka.core.xml.XMLInstances.TAG%5FLABEL) * #### TAG\_METADATA public static final java.lang.String TAG_METADATA the meta-data element See Also: [Constant Field Values](../../../constant-values.html#weka.core.xml.XMLInstances.TAG%5FMETADATA) * #### TAG\_PROPERTY public static final java.lang.String TAG_PROPERTY the property element See Also: [Constant Field Values](../../../constant-values.html#weka.core.xml.XMLInstances.TAG%5FPROPERTY) * #### TAG\_INSTANCES public static final java.lang.String TAG_INSTANCES the data element See Also: [Constant Field Values](../../../constant-values.html#weka.core.xml.XMLInstances.TAG%5FINSTANCES) * #### TAG\_INSTANCE public static final java.lang.String TAG_INSTANCE the instance element See Also: [Constant Field Values](../../../constant-values.html#weka.core.xml.XMLInstances.TAG%5FINSTANCE) * #### TAG\_VALUE public static final java.lang.String TAG_VALUE the value element See Also: [Constant Field Values](../../../constant-values.html#weka.core.xml.XMLInstances.TAG%5FVALUE) * #### ATT\_VERSION public static final java.lang.String ATT_VERSION the version attribute See Also: [Constant Field Values](../../../constant-values.html#weka.core.xml.XMLInstances.ATT%5FVERSION) * #### ATT\_TYPE public static final java.lang.String ATT_TYPE the type attribute See Also: [Constant Field Values](../../../constant-values.html#weka.core.xml.XMLInstances.ATT%5FTYPE) * #### ATT\_FORMAT public static final java.lang.String ATT_FORMAT the format attribute (for date attributes) See Also: [Constant Field Values](../../../constant-values.html#weka.core.xml.XMLInstances.ATT%5FFORMAT) * #### ATT\_CLASS public static final java.lang.String ATT_CLASS the class attribute See Also: [Constant Field Values](../../../constant-values.html#weka.core.xml.XMLInstances.ATT%5FCLASS) * #### ATT\_INDEX public static final java.lang.String ATT_INDEX the index attribute See Also: [Constant Field Values](../../../constant-values.html#weka.core.xml.XMLInstances.ATT%5FINDEX) * #### ATT\_WEIGHT public static final java.lang.String ATT_WEIGHT the weight attribute See Also: [Constant Field Values](../../../constant-values.html#weka.core.xml.XMLInstances.ATT%5FWEIGHT) * #### ATT\_MISSING public static final java.lang.String ATT_MISSING the missing attribute See Also: [Constant Field Values](../../../constant-values.html#weka.core.xml.XMLInstances.ATT%5FMISSING) * #### VAL\_NUMERIC public static final java.lang.String VAL_NUMERIC the value for numeric See Also: [Constant Field Values](../../../constant-values.html#weka.core.xml.XMLInstances.VAL%5FNUMERIC) * #### VAL\_DATE public static final java.lang.String VAL_DATE the value for date See Also: [Constant Field Values](../../../constant-values.html#weka.core.xml.XMLInstances.VAL%5FDATE) * #### VAL\_NOMINAL public static final java.lang.String VAL_NOMINAL the value for nominal See Also: [Constant Field Values](../../../constant-values.html#weka.core.xml.XMLInstances.VAL%5FNOMINAL) * #### VAL\_STRING public static final java.lang.String VAL_STRING the value for string See Also: [Constant Field Values](../../../constant-values.html#weka.core.xml.XMLInstances.VAL%5FSTRING) * #### VAL\_RELATIONAL public static final java.lang.String VAL_RELATIONAL the value for relational See Also: [Constant Field Values](../../../constant-values.html#weka.core.xml.XMLInstances.VAL%5FRELATIONAL) * #### VAL\_NORMAL public static final java.lang.String VAL_NORMAL the value for normal See Also: [Constant Field Values](../../../constant-values.html#weka.core.xml.XMLInstances.VAL%5FNORMAL) * #### VAL\_SPARSE public static final java.lang.String VAL_SPARSE the value for sparse See Also: [Constant Field Values](../../../constant-values.html#weka.core.xml.XMLInstances.VAL%5FSPARSE) * #### DOCTYPE public static final java.lang.String DOCTYPE the DTD
Constructor Detail
* #### XMLInstances public XMLInstances() throws java.lang.Exception the default constructor Throws: `java.lang.Exception` \- if XML initialization fails * #### XMLInstances public XMLInstances([Instances](../../../weka/core/Instances.html "class in weka.core") data) throws java.lang.Exception generates the XML structure based on the given data Parameters: `data` \- the data to build the XML structure from Throws: `java.lang.Exception` \- if initialization/generation fails * #### XMLInstances public XMLInstances(java.io.Reader reader) throws java.lang.Exception generates the Instances directly from the reader containing the XML data. Parameters: `reader` \- the reader for the XML data Throws: `java.lang.Exception` \- if something goes wrong
Method Detail
* #### setInstances public void setInstances([Instances](../../../weka/core/Instances.html "class in weka.core") data) builds up the XML structure based on the given data Parameters: `data` \- data to generate the XML from * #### getInstances public [Instances](../../../weka/core/Instances.html "class in weka.core") 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 public void setXML(java.io.Reader reader) throws java.lang.Exception reads the XML structure from the given reader Parameters: `reader` \- the reader to get the XML from Throws: `java.lang.Exception` \- if * #### getRevision public java.lang.String getRevision() Returns the revision string. Specified by: `[getRevision](../../../weka/core/RevisionHandler.html#getRevision--)` in interface `[RevisionHandler](../../../weka/core/RevisionHandler.html "interface in weka.core")` Overrides: `[getRevision](../../../weka/core/xml/XMLDocument.html#getRevision--)` in class `[XMLDocument](../../../weka/core/xml/XMLDocument.html "class in weka.core.xml")` Returns: the revision * #### main public static void main(java.lang.String[] args) takes an XML document as first argument and then outputs the Instances statistics Parameters: `args` \- the commandline options