|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectchemaxon.jchem.db.Exporter
This class is a tool for exporting molecules from database tables into an OutputStream object. The OutputStream can represent a file, the standard output, etc.
| Field Summary |
| Fields inherited from interface chemaxon.jchem.db.Transfer |
JTF, MOLFILE, MRV, RDFILE, RXNFILE, SDFILE, SMILES |
| Constructor Summary | |
Exporter()
|
|
| Method Summary | |
java.lang.String |
getConditions()
Returns the SQL WHERE statement, if specified. |
ConnectionHandler |
getConnectionHandler()
Getter for property connectionHandler. |
java.lang.String |
getDelimiter()
Gets the field delimiter character between columns for JTF format output. |
java.lang.String |
getEol()
Gets the End Of Line character(s). |
java.lang.String |
getFieldList()
Returns the specified list of fields. |
int |
getFormat()
Gets the format of the export. |
int[] |
getIDList()
Returns the list of allowed cd_id values. |
java.io.OutputStream |
getOutputStream()
Gets the OutputStream object to export to. |
java.lang.String |
getQuotation()
Gets the field enclosing character for JTF format output. |
java.lang.String |
getTableName()
Gets the name of the table to export from. |
boolean |
isDefaults()
Gets if only default fields are to be exported. |
boolean |
isJtfWithStructure()
Gets, wheter exported JTF will contain structure information. |
void |
setConditions(java.lang.String conditions)
An SQL WHERE condition can be specified here. |
void |
setConnectionHandler(ConnectionHandler conh)
Setter for property connectionHandler. |
void |
setDefaults(boolean b)
Sets if only default fields will be exported. |
void |
setDelimiter(java.lang.String delimiter)
Sets the field delimiter character between columns for JTF format output. |
void |
setEol(java.lang.String eol)
Sets the End Of Line character(s), system dependent. |
void |
setFieldList(java.lang.String fieldList)
Sets the list of fields to be exported. |
void |
setFormat(int format)
Sets the format of the export. |
void |
setIDList(int[] list)
Sets the list of allowed cd_id values, only these rows will be exported. |
void |
setJtfWithStructure(boolean b)
Specifies, wheter exported JTF will contain structure information. |
void |
setOutputFieldNames(java.lang.String fieldNames)
Specifies the names of the data fields in the output file. |
void |
setOutputStream(java.io.OutputStream os)
Sets the OutputStream object to export to. |
void |
setQuotation(java.lang.String quotation)
Sets the field enclosing character for JTF format output. |
void |
setSelectStatement(java.lang.String sql)
Sets a custom SQL SELECT statement to be used as the basis of the export. |
void |
setTableName(java.lang.String tname)
Sets the name of the table to export from. |
int |
writeAll()
Exports all the (remaining) molecules. |
boolean |
writeNext()
Writes the next molecule to the outputstream, this method is useful if one wants to track the progress of the export. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Exporter()
| Method Detail |
public void setConnectionHandler(ConnectionHandler conh)
public ConnectionHandler getConnectionHandler()
public void setTableName(java.lang.String tname)
public java.lang.String getTableName()
public void setFieldList(java.lang.String fieldList)
setDefaults.setOutputFieldNames(String).
public java.lang.String getFieldList()
public void setConditions(java.lang.String conditions)
public java.lang.String getConditions()
public void setIDList(int[] list)
list - the list. If set to null,
no filtering will be performed.public int[] getIDList()
null, if no filterig is performed.setIDList(int[])public void setOutputStream(java.io.OutputStream os)
public java.io.OutputStream getOutputStream()
public void setFormat(int format)
public int getFormat()
public void setDefaults(boolean b)
public boolean isDefaults()
public void setEol(java.lang.String eol)
public void setSelectStatement(java.lang.String sql)
By using this method one can
setJtfWithStructure(false)
is used, in this case the structure field should be omitted).setOutputFieldNames(String).Example: SELECT STRUCTURES.CD_STRUCTURE, STRUCTURES.CD_ID, BIODATA.TOXICITY FROM STRUCTURES, BIODATA WHERE STRUCTURES.CD=BIODATA.CD_ID AND BIODATA.ACTIVITY>23.4 ORDER BY STRUCTURES.MOLWEIGHT
If a custom select statement is specified, the following methods have no effect:
setConditions(String)setDefaults(boolean)setFieldList(String)setIDList(int[])setTableName(String)
sql - the SQL statement. If set to null, a standard
SELECT statement is generated by JChem for the export (default).public void setOutputFieldNames(java.lang.String fieldNames)
fieldNames - the names of the fields in order, separated by spaces.
If set to null or less field names specified than exported,
the name of the database field will be used fo the unspecified ones.
Only effective if a SELECT statement is specified by
setSelectStatement(String).
public java.lang.String getEol()
public void setDelimiter(java.lang.String delimiter)
public java.lang.String getDelimiter()
public void setQuotation(java.lang.String quotation)
public java.lang.String getQuotation()
public void setJtfWithStructure(boolean b)
public boolean isJtfWithStructure()
public boolean writeNext()
throws TransferException
TransferException
public int writeAll()
throws TransferException
TransferException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||