public class XMLInstances extends XMLDocument implements java.io.Serializable
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
|
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 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.
|
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
|
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
public static java.lang.String FILE_EXTENSION
public static final java.lang.String TAG_DATASET
public static final java.lang.String TAG_HEADER
public static final java.lang.String TAG_BODY
public static final java.lang.String TAG_NOTES
public static final java.lang.String TAG_ATTRIBUTES
public static final java.lang.String TAG_ATTRIBUTE
public static final java.lang.String TAG_LABELS
public static final java.lang.String TAG_LABEL
public static final java.lang.String TAG_METADATA
public static final java.lang.String TAG_PROPERTY
public static final java.lang.String TAG_INSTANCES
public static final java.lang.String TAG_INSTANCE
public static final java.lang.String TAG_VALUE
public static final java.lang.String ATT_VERSION
public static final java.lang.String ATT_TYPE
public static final java.lang.String ATT_FORMAT
public static final java.lang.String ATT_CLASS
public static final java.lang.String ATT_INDEX
public static final java.lang.String ATT_WEIGHT
public static final java.lang.String ATT_MISSING
public static final java.lang.String VAL_NUMERIC
public static final java.lang.String VAL_DATE
public static final java.lang.String VAL_NOMINAL
public static final java.lang.String VAL_STRING
public static final java.lang.String VAL_RELATIONAL
public static final java.lang.String VAL_NORMAL
public static final java.lang.String VAL_SPARSE
public static final java.lang.String DOCTYPE
public XMLInstances() throws java.lang.Exception
java.lang.Exception
- if XML initialization failspublic XMLInstances(Instances data) throws java.lang.Exception
data
- the data to build the XML structure fromjava.lang.Exception
- if initialization/generation failspublic XMLInstances(java.io.Reader reader) throws java.lang.Exception
reader
- the reader for the XML datajava.lang.Exception
- if something goes wrongpublic void setInstances(Instances data)
data
- data to generate the XML frompublic Instances getInstances()
public void setXML(java.io.Reader reader) throws java.lang.Exception
reader
- the reader to get the XML fromjava.lang.Exception
- ifpublic java.lang.String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class XMLDocument
public static void main(java.lang.String[] args)
args
- the commandline options