|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectproper.xml.XMLInstances
public class XMLInstances
This class reads XML files representing Instances and writes Instances to XML.
| Field Summary | |
|---|---|
static java.lang.String |
DATE_FORMAT
the initial format for dates |
static java.lang.String |
DOCTYPE
the DTD for the output |
static java.lang.String |
PI
the PI for the output |
static java.lang.String |
TAG_ATTRIBUTE
|
static java.lang.String |
TAG_ATTRIBUTES
|
static java.lang.String |
TAG_INSTANCE
|
static java.lang.String |
TAG_INSTANCES
|
static java.lang.String |
TAG_RELATION
|
static java.lang.String |
TAG_VALUE
|
static java.lang.String |
TYPE_DATE
|
static java.lang.String |
TYPE_NOMINAL
|
static java.lang.String |
TYPE_NUMERIC
|
static java.lang.String |
TYPE_STRING
|
| Constructor Summary | |
|---|---|
XMLInstances()
initializes the object |
|
XMLInstances(weka.core.Instances instances)
initializes the object with the given instances |
|
| Method Summary | |
|---|---|
java.lang.String |
getDateFormat()
returns the date format used in the DATE attributes |
java.lang.String |
getDoctype()
returns the DTD used in the XML file |
weka.core.Instances |
getInstances()
returns the current instances object (either read or set) |
java.lang.String |
getPI()
returns the processing instructions to use in the file |
static void |
main(java.lang.String[] args)
for testing only (first arg type [xml/arff], second arg filename) |
weka.core.Instances |
process(Document doc)
transforms an XML document into an instances object |
Document |
process(weka.core.Instances instances)
transforms instances into a XML document |
boolean |
read(java.lang.String filename)
reads the instances from the given XML file, returns TRUE if successful |
void |
setDateFormat(java.lang.String dateFormat)
sets the date format to use in the attributes |
void |
setDoctype(java.lang.String doctype)
sets the DTD to use in XML file |
void |
setInstances(weka.core.Instances instances)
sets the instances object to use |
void |
setPI(java.lang.String pi)
sets the processing instructions to use in the file |
static int |
stringToType(java.lang.String typeStr)
returns the WEKA Attribute type of the given string, default is STRING |
static java.lang.String |
typeToString(int type)
returns a string representation of the given WEKA Attribute type, default is TYPE_STRING |
boolean |
write(java.lang.String filename)
writes the current instances to the given filename, returns TRUE if successful |
static boolean |
write(java.lang.String filename,
weka.core.Instances instances)
writes the given instances to the given file, in XML format, returns TRUE if successful |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String TYPE_DATE
public static final java.lang.String TYPE_NOMINAL
public static final java.lang.String TYPE_NUMERIC
public static final java.lang.String TYPE_STRING
public static final java.lang.String DOCTYPE
public static final java.lang.String PI
public static final java.lang.String DATE_FORMAT
public static final java.lang.String TAG_RELATION
public static final java.lang.String TAG_ATTRIBUTES
public static final java.lang.String TAG_ATTRIBUTE
public static final java.lang.String TAG_INSTANCES
public static final java.lang.String TAG_INSTANCE
public static final java.lang.String TAG_VALUE
| Constructor Detail |
|---|
public XMLInstances()
public XMLInstances(weka.core.Instances instances)
| Method Detail |
|---|
public void setInstances(weka.core.Instances instances)
public weka.core.Instances getInstances()
public void setDoctype(java.lang.String doctype)
DOCTYPEpublic java.lang.String getDoctype()
DOCTYPEpublic void setPI(java.lang.String pi)
PIpublic java.lang.String getPI()
PIpublic void setDateFormat(java.lang.String dateFormat)
DATE_FORMATpublic java.lang.String getDateFormat()
DATE_FORMATpublic static int stringToType(java.lang.String typeStr)
Attribute.STRINGpublic static java.lang.String typeToString(int type)
TYPE_STRINGpublic Document process(weka.core.Instances instances)
public weka.core.Instances process(Document doc)
public boolean write(java.lang.String filename)
public static boolean write(java.lang.String filename,
weka.core.Instances instances)
public boolean read(java.lang.String filename)
public static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||