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