|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectchemaxon.formats.MolExporter
public class MolExporter
Molecule exporter class.
The output file format can be specified as an argument to the constructor of this class. Many different output file formats are supported like "mol", "sdf", "smiles", "png", "jpeg", etc.
Experimental feature (may change in the future!): "chemaxon.struc.Molecule" format for testing Molecule serialization.
| Field Summary | |
|---|---|
static int |
C_CLOSE_STREAM
Close the underlying stream. |
static int |
C_FLUSH_STREAM
Flush the output stream and force any buffered output bytes to be written out. |
| Constructor Summary | |
|---|---|
MolExporter(java.io.OutputStream out,
java.lang.String fmtWithOpts)
Creates a molecule exporter. |
|
MolExporter(java.io.OutputStream out,
java.lang.String fmtWithOpts,
boolean text,
java.lang.String[] incFields)
Creates a molecule exporter. |
|
MolExporter(java.io.OutputStream out,
java.lang.String fmtWithOpts,
boolean text,
java.lang.String[] incFields,
java.lang.String enc)
Creates a molecule exporter. |
|
MolExporter(java.io.OutputStream out,
java.lang.String fmtWithOpts,
java.lang.String enc)
Creates a molecule exporter. |
|
| Method Summary | |
|---|---|
void |
close()
Closes the MolExportModule and the underlying stream. |
void |
close(int opts)
Closes the MolExportModule and, optionally, the underlying
stream. |
protected void |
finalize()
|
void |
flush()
Flushes the output stream and forces any buffered output bytes to be written out. |
java.lang.String |
getFormat()
Gets the output file format. |
boolean |
isCleanable()
Tests whether cleaning is meaningful for the chosen output format. |
void |
write(Molecule m)
Writes a molecule into the stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int C_CLOSE_STREAM
close(int),
Constant Field Valuespublic static final int C_FLUSH_STREAM
close(int),
Constant Field Values| Constructor Detail |
|---|
public MolExporter(java.io.OutputStream out,
java.lang.String fmtWithOpts)
throws MolExportException,
java.io.IOException,
java.lang.IllegalArgumentException
out - the output streamfmtWithOpts - the output file format and the options
MolExportException - export error occured
java.io.IOException - output error occurred when writing the header
java.lang.IllegalArgumentException - Invalid format string (fmtWithOpts).
java.nio.charset.IllegalCharsetNameException - if the encoding is illegal
java.nio.charset.UnsupportedCharsetException - if the encoding is unsupported
public MolExporter(java.io.OutputStream out,
java.lang.String fmtWithOpts,
boolean text,
java.lang.String[] incFields)
throws MolExportException,
java.io.IOException,
java.lang.IllegalArgumentException
out - the output streamfmtWithOpts - the output file format and the optionstext - write OS dependent line.separators instead of '\n'incFields - SDF fields to include in table or null
MolExportException - export error occured
java.io.IOException - output error occurred when writing the header
java.lang.IllegalArgumentException - Invalid format string (fmtWithOpts).
java.nio.charset.IllegalCharsetNameException - if the encoding is illegal
java.nio.charset.UnsupportedCharsetException - if the encoding is unsupported
public MolExporter(java.io.OutputStream out,
java.lang.String fmtWithOpts,
java.lang.String enc)
throws MolExportException,
java.io.IOException,
java.lang.IllegalArgumentException
out - the output streamfmtWithOpts - the output file format and the optionsenc - charset name or null
MolExportException - export error occured
java.io.IOException - output error occurred when writing the header
java.lang.IllegalArgumentException - Invalid format string (fmtWithOpts).
java.nio.charset.IllegalCharsetNameException - if the encoding is illegal
java.nio.charset.UnsupportedCharsetException - if the encoding is unsupported
public MolExporter(java.io.OutputStream out,
java.lang.String fmtWithOpts,
boolean text,
java.lang.String[] incFields,
java.lang.String enc)
throws MolExportException,
java.io.IOException,
java.lang.IllegalArgumentException
out - the output streamfmtWithOpts - the output file format and the optionstext - write OS dependent line.separators instead of '\n'incFields - SDF fields to include in table or nullenc - charset name or null
MolExportException - export error occured
java.io.IOException - output error occurred when writing the header
java.lang.IllegalArgumentException - Invalid format string (fmtWithOpts).
java.nio.charset.IllegalCharsetNameException - if the encoding is illegal
java.nio.charset.UnsupportedCharsetException - if the encoding is unsupported| Method Detail |
|---|
public java.lang.String getFormat()
public boolean isCleanable()
public void write(Molecule m)
throws MolExportException,
java.io.IOException
m - the molecule
MolExportException - export error
java.io.IOException
public void close()
throws MolExportException,
java.io.IOException
MolExportModule and the underlying stream.
MolExportException - export error.
java.io.IOException - in case of any other I/O error.
public void close(int opts)
throws MolExportException,
java.io.IOException
MolExportModule and, optionally, the underlying
stream.
opts - closing options, C_CLOSE_STREAM
or C_FLUSH_STREAM.
MolExportException - export error.
java.io.IOException - in case of any other I/O error.
public void flush()
throws java.io.IOException
java.io.IOException - if an I/O error occurs.
protected void finalize()
throws MolExportException,
java.io.IOException
finalize in class java.lang.ObjectMolExportException
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||