|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectproper.xml.XMLExemplars
public class XMLExemplars
This class reads XML files representing Exemplars and writes Exemplars to XML.
| Field Summary | |
|---|---|
static java.lang.String |
DOCTYPE
the DTD for the output |
| Constructor Summary | |
|---|---|
XMLExemplars()
initializes the object |
|
XMLExemplars(milk.core.Exemplars exemplars)
initializes the object with the given exemplars |
|
XMLExemplars(weka.core.Instances instances)
initializes the object with the given instances (creates exemplars out of them), assumes that the bag id is the first attribute |
|
| 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 |
milk.core.Exemplars |
getExemplars()
returns the current exemplars 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) |
milk.core.Exemplars |
process(Document doc)
transforms an XML document into an exemplars object |
Document |
process(milk.core.Exemplars exemplars)
transforms Exemplars into an XML document |
boolean |
read(java.lang.String filename)
reads the exemplars 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 |
setExemplars(milk.core.Exemplars exemplars)
sets the exemplars object to use |
void |
setInstances(weka.core.Instances instances)
sets the instances object to use, assumes that the first attribute is the bag for creating an exemplars object |
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 exemplars to the given filename, returns TRUE if successful |
static boolean |
write(java.lang.String filename,
milk.core.Exemplars exemplars)
writes the given exemplars to the given file, in XML format, 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 DOCTYPE
| Constructor Detail |
|---|
public XMLExemplars()
public XMLExemplars(milk.core.Exemplars exemplars)
public XMLExemplars(weka.core.Instances instances)
| Method Detail |
|---|
public void setExemplars(milk.core.Exemplars exemplars)
public void setInstances(weka.core.Instances instances)
public milk.core.Exemplars getExemplars()
public void setDoctype(java.lang.String doctype)
XMLInstances.DOCTYPEpublic java.lang.String getDoctype()
XMLInstances.DOCTYPEpublic void setPI(java.lang.String pi)
XMLInstances.PIpublic java.lang.String getPI()
XMLInstances.PIpublic void setDateFormat(java.lang.String dateFormat)
XMLInstances.DATE_FORMATpublic java.lang.String getDateFormat()
XMLInstances.DATE_FORMATpublic static int stringToType(java.lang.String typeStr)
Attribute.STRINGpublic static java.lang.String typeToString(int type)
XMLInstances.TYPE_STRINGpublic Document process(milk.core.Exemplars exemplars)
public milk.core.Exemplars process(Document doc)
public boolean write(java.lang.String filename)
public static boolean write(java.lang.String filename,
milk.core.Exemplars exemplars)
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 | |||||||||