public static class MolConverter.Builder
extends java.lang.Object
Constructor and Description |
---|
Builder()
Constructs an empty Builder object.
|
Modifier and Type | Method and Description |
---|---|
void |
addInput(java.io.File f,
java.lang.String opts)
Adds an input file.
|
void |
addInput(java.io.InputStream is,
java.lang.String opts)
Adds an input stream.
|
void |
addInput(java.lang.String fname,
java.lang.String opts)
Adds an input file.
|
MolConverter |
build()
Builds the MolConverter.
|
MolConverter.Builder |
clean(int dim)
Enables cleaning.
|
MolConverter.Builder |
clean(int dim,
java.lang.String opts)
Enables cleaning.
|
void |
clear()
Clears all settings.
|
protected java.lang.Object |
clone()
Clones the object.
|
int |
getInputCount()
Gets the number of input files/streams.
|
void |
setEncodings(java.lang.String enc)
Sets the input and/or output encoding.
|
void |
setFields(java.lang.String[] fields)
Sets the included fields to be shown in a table.
|
void |
setOutput(java.io.File f,
java.lang.String fmtopts)
Sets the output file.
|
void |
setOutput(java.io.OutputStream out,
java.lang.String fmtopts)
Sets the output stream.
|
void |
setOutput(java.lang.String fname,
java.lang.String fmtopts)
Sets the output file.
|
void |
setOutputFlags(int outflags)
Sets output flags.
|
public MolConverter build() throws MolFormatException, MolExportException, java.io.IOException, java.lang.IllegalArgumentException
MolFormatException
- If the molecule file is in a
format that cannot be readMolExportException
- If the molecule cannot be exported
in the specified formatjava.io.IOException
- If I/O error occured when determining
the file format.java.lang.IllegalArgumentException
- Invalid format string (fmt).public void clear()
public void addInput(java.io.InputStream is, java.lang.String opts)
is
- the input streamopts
- import options or null
public void addInput(java.io.File f, java.lang.String opts)
f
- the fileopts
- import options or null
public void addInput(java.lang.String fname, java.lang.String opts)
fname
- the file's pathopts
- import options or null
public int getInputCount()
public void setOutput(java.io.OutputStream out, java.lang.String fmtopts)
out
- the output streamfmtopts
- file format and options (or null
)public void setOutput(java.io.File f, java.lang.String fmtopts)
f
- the output filefmtopts
- file format and options (or null
)public void setOutput(java.lang.String fname, java.lang.String fmtopts)
fname
- the output file's pathfmtopts
- file format and options (or null
)public void setOutputFlags(int outflags)
outflags
- output flags, a combination of
MolExporter.TEXT
and MolExporter.MULTIPLE
public void setEncodings(java.lang.String enc)
enc
- the input and/or output encodings in
INCHARSET..OUTCHARSET formatpublic void setFields(java.lang.String[] fields)
fields
- the fieldspublic MolConverter.Builder clean(int dim)
dim
- cleaning dimension, 2 or 3public MolConverter.Builder clean(int dim, java.lang.String opts)
dim
- cleaning dimension, 2 or 3opts
- cleaning optionsprotected java.lang.Object clone()
clone
in class java.lang.Object