chemaxon.formats
Class MolConverter.Builder

java.lang.Object
  extended by chemaxon.formats.MolConverter.Builder
Direct Known Subclasses:
MolConverter.Options
Enclosing class:
MolConverter

public static class MolConverter.Builder
extends java.lang.Object

MolConverter builder.

Since:
Marvin 5.2.3, 05/28/2009
Author:
Peter Csizmadia

Constructor Summary
MolConverter.Builder()
          Constructs an empty Builder object.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MolConverter.Builder

public MolConverter.Builder()
Constructs an empty Builder object.

Method Detail

build

public MolConverter build()
                   throws MolFormatException,
                          MolExportException,
                          java.io.IOException,
                          java.lang.IllegalArgumentException
Builds the MolConverter.

Returns:
the new MolConverter
Throws:
MolFormatException - If the molecule file is in a format that cannot be read
MolExportException - If the molecule cannot be exported in the specified format
java.io.IOException - If I/O error occured when determining the file format.
java.lang.IllegalArgumentException - Invalid format string (fmt).

clear

public void clear()
Clears all settings.


addInput

public void addInput(java.io.InputStream is,
                     java.lang.String opts)
Adds an input stream.

Parameters:
is - the input stream
opts - import options or null

addInput

public void addInput(java.io.File f,
                     java.lang.String opts)
Adds an input file.

Parameters:
f - the file
opts - import options or null

addInput

public void addInput(java.lang.String fname,
                     java.lang.String opts)
Adds an input file.

Parameters:
fname - the file's path
opts - import options or null

getInputCount

public int getInputCount()
Gets the number of input files/streams.

Returns:
the number of input files/streams

setOutput

public void setOutput(java.io.OutputStream out,
                      java.lang.String fmtopts)
Sets the output stream.

Parameters:
out - the output stream
fmtopts - file format and options (or null)

setOutput

public void setOutput(java.io.File f,
                      java.lang.String fmtopts)
Sets the output file.

Parameters:
f - the output file
fmtopts - file format and options (or null)

setOutput

public void setOutput(java.lang.String fname,
                      java.lang.String fmtopts)
Sets the output file.

Parameters:
fname - the output file's path
fmtopts - file format and options (or null)

setOutputFlags

public void setOutputFlags(int outflags)
Sets output flags.

Parameters:
outflags - output flags, a combination of MolExporter.TEXT and MolExporter.MULTIPLE

setEncodings

public void setEncodings(java.lang.String enc)
Sets the input and/or output encoding.

Parameters:
enc - the input and/or output encodings in INCHARSET..OUTCHARSET format

setFields

public void setFields(java.lang.String[] fields)
Sets the included fields to be shown in a table.

Parameters:
fields - the fields

clean

public MolConverter.Builder clean(int dim)
Enables cleaning.

Parameters:
dim - cleaning dimension, 2 or 3
Returns:
this builder object
Since:
Marvin 5.2.4, 07/07/2009

clean

public MolConverter.Builder clean(int dim,
                                  java.lang.String opts)
Enables cleaning.

Parameters:
dim - cleaning dimension, 2 or 3
opts - cleaning options
Returns:
this builder object
Since:
Marvin 5.2.4, 07/07/2009

clone

protected java.lang.Object clone()
Clones the object.

Overrides:
clone in class java.lang.Object