|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectproper.core.ProperObject
proper.database.ConnectorObject
proper.database.Writer
public class Writer
This class is used for writing a table to an ARFF-file.
Field Summary | |
---|---|
static boolean |
USE_TOSTRING
whether to use the memory consuming Instances.toString() method for writing the instances to a file |
Fields inherited from interface proper.core.ProperInterface |
---|
VERSION |
Constructor Summary | |
---|---|
Writer(Connector conn)
initializes the object |
|
Writer(Connector conn,
java.lang.String table,
java.lang.String field)
initializes the object |
Method Summary | |
---|---|
java.lang.String |
getField()
returns the field used as class |
java.lang.String |
getFieldList()
returns the list of fields to retrieve (comma separated list) |
java.lang.String |
getFilename()
returns the name of the output file |
weka.core.Instances |
getInstances()
returns the instances |
java.lang.String |
getNominalList()
returns the list of fields to treat additionally as nominals (comma separated list) |
java.lang.String |
getNoNullsList()
returns the list of fields where no NULL values are allowed |
java.lang.String |
getOrderBy()
returns the field used for ordering |
double |
getPercentage()
returns the currently set percentage to retrieve from the table. |
java.lang.String |
getRelationName()
returns the name of the relation |
boolean |
getSort()
returns whether the attributes are sorted or not |
java.lang.String |
getTable()
returns the name of the table to read from |
void |
setField(java.lang.String field)
sets the field to use as class |
void |
setFieldList(java.lang.String fields)
sets the list (comma separated) of fields to retrieve in this order from the table |
void |
setFilename(java.lang.String filename)
sets the name of the output file |
void |
setInstances(weka.core.Instances instances)
sets the instancs to write |
void |
setNominalList(java.lang.String fields)
sets the list (comma separated) of fields to treat additionally as nominals the table |
void |
setNoNullsList(java.lang.String fields)
sets the list (comma separated) of fields where no NULL values are allowed |
void |
setOrderBy(java.lang.String orderBy)
sets the fields to order by (only ASC!) |
void |
setPercentage(double percentage)
sets the percentage of instances we want to retrieve from the table. |
void |
setRelationName(java.lang.String relation)
sets the name of the relation |
void |
setSort(boolean sort)
sets whether to sort the attributes or not |
void |
setTable(java.lang.String table)
sets the name of the table to use |
void |
write()
writes the instances from the table to an ARFF-file |
void |
write(weka.core.Instances instances)
writes the given instances to an ARFF-file. |
Methods inherited from class proper.database.ConnectorObject |
---|
getConnector |
Methods inherited from class proper.core.ProperObject |
---|
addListener, addOutput, classInVerbose, debugprint, debugprint, debugprint, debugprint, debugprintln, debugprintln, debugprintln, debugprintln, debugprintln, getListeners, getRuntime, getVerbose, getVerboseLevel, getVerboseLevelForClass, getVerboseString, getVerboseStringForClass, notifyListener, notifyListeners, print, print, print, print, println, println, println, println, println, printMemory, removeListener, setOutput, setVerbose, setVerboseLevel, setVerboseString, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final boolean USE_TOSTRING
Constructor Detail |
---|
public Writer(Connector conn)
conn
- the Connector used for Database-Handlingpublic Writer(Connector conn, java.lang.String table, java.lang.String field)
conn
- the Connector used for Database-Handlingtable
- the table to use for readingfield
- the field that contains the classMethod Detail |
---|
public void setRelationName(java.lang.String relation)
public java.lang.String getRelationName()
public void setTable(java.lang.String table)
public java.lang.String getTable()
public void setField(java.lang.String field)
public java.lang.String getField()
public void setOrderBy(java.lang.String orderBy)
public java.lang.String getOrderBy()
public void setSort(boolean sort)
public boolean getSort()
public void setFilename(java.lang.String filename)
public java.lang.String getFilename()
public void setFieldList(java.lang.String fields)
public java.lang.String getFieldList()
public void setNominalList(java.lang.String fields)
public java.lang.String getNominalList()
public void setNoNullsList(java.lang.String fields)
public java.lang.String getNoNullsList()
public void setPercentage(double percentage)
public double getPercentage()
public void setInstances(weka.core.Instances instances)
public weka.core.Instances getInstances()
public void write()
public void write(weka.core.Instances instances)
toString()
method of the instances-object is too memory
consuming, we basically do the same as this method, but directly
writing to a file and not to a String.
USE_TOSTRING
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |