@PublicAPI public class CalculatorPluginOutput extends java.lang.Object implements chemaxon.marvin.plugin.CalculatorResultAccess
id | <type1> | <type2> | <type3> | ... |
<id1> | <result11> | <result12> | <result13> | ... |
<id2> | <result21> | <result22> | <result23> | ... |
... | ... | ... | ... | ... |
type1
, type2
, ... are the result types,
id1
, id2
, ... are the molecule ID-s fetched from the given ID tag of the
input SDF file or molecule indices if no such tag is given,
the resultij
is the result string for the i-th molecule and the j-th result type.
Other output formats can be implemented by subclassing this class and returning the class name in
the plugin-specific implementation of chemaxon.plugin.CalculatorPlugin.getOutputClassName().Modifier and Type | Field and Description |
---|---|
protected java.util.Properties |
params
The plugin parameter table.
|
protected CalculatorPlugin |
plugin
The CalculatorPlugin object.
|
protected java.lang.String |
separator
The separator string separating the results for different result types.
|
Constructor and Description |
---|
CalculatorPluginOutput()
Default constructor.
|
CalculatorPluginOutput(CalculatorPlugin plugin)
Constructor that sets plugin.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the output.
|
void |
close(int opts)
Closes the output.
|
chemaxon.marvin.plugin.CalculatorPluginCachedResults |
getCachedResults(Molecule target,
boolean stringResult)
Returns cached results, separated from the plugin object,
so that no further enqueries needed to the plugin to get the result.
|
java.lang.String |
getHeader()
Returns the table header.
|
CalculatorPlugin |
getPlugin()
Returns the calculator plugin object.
|
java.util.Properties |
getPluginParameters()
Returns the plugin parameter table (this should be set in the plugin).
|
java.lang.String |
getRemark()
Returns the calculation remark.
|
java.lang.String |
getResult(Molecule target)
Returns the result string for the given molecule.
|
int |
getResultDomain()
Returns the domain for the first result type.
|
java.lang.String |
getResultMessage()
Returns the plugin calculation error message,
error or warning.
|
Molecule |
getResultMolecule(Molecule target)
Returns the decorated result molecule for the given target molecule.
|
Molecule[] |
getResultMolecules(Molecule target)
Returns the result molecules for the given target molecule.
|
protected java.lang.String |
getResults(java.lang.Object type)
Returns result items for the given result type.
|
double |
getSpecResult(Molecule target,
java.lang.String arg)
Returns a specific plugin result corresponding to the given molecule
and argument string.
|
java.lang.Throwable |
getThrowable()
Returns the throwable object.
|
boolean |
isMolecular()
Returns
true if molecule output. |
boolean |
isOK()
Returns
true if the calculation has run without error. |
boolean |
isStreamOutput()
Returns
true if stream output. |
void |
setOutputParameters(java.lang.Object[] types)
Prepares the output based on the result type string.
|
void |
setOutputStream(java.io.OutputStream os)
Sets the output stream.
|
void |
setParameters(java.util.Properties params)
Sets the parameter table.
|
void |
setPlugin(CalculatorPlugin plugin)
Sets the calculator plugin object.
|
void |
setSeparator(java.lang.String separator)
Sets the separator string.
|
void |
setThrowable(java.lang.Throwable throwable)
Sets the throwable object.
|
protected CalculatorPlugin plugin
protected java.util.Properties params
protected java.lang.String separator
public CalculatorPluginOutput()
public CalculatorPluginOutput(CalculatorPlugin plugin)
plugin
- is the pluginpublic final void setPlugin(CalculatorPlugin plugin)
plugin
- is the CalculatorPlugin objectpublic final CalculatorPlugin getPlugin()
public final void setThrowable(java.lang.Throwable throwable)
throwable
- is the CalculatorPlugin objectpublic final java.lang.Throwable getThrowable()
getThrowable
in interface chemaxon.marvin.plugin.CalculatorResultAccess
public void setSeparator(java.lang.String separator)
separator
- is the separator stringpublic void setParameters(java.util.Properties params) throws PluginException
params
- is the parameter tablePluginException
- on errorpublic java.util.Properties getPluginParameters() throws PluginException
PluginException
- on errorpublic void setOutputParameters(java.lang.Object[] types) throws PluginException
types
- the result typesPluginException
- on errorpublic boolean isMolecular()
true
if molecule output.
The default implementation returns false
.true
if molecule outputpublic boolean isStreamOutput()
true
if stream output.
The default implementation returns false
.true
if stream outputpublic void setOutputStream(java.io.OutputStream os) throws java.io.IOException
os
- the output streamjava.io.IOException
public void close() throws java.io.IOException
close(int)
with
MolExporter.C_CLOSE_STREAM
parameter.java.io.IOException
public void close(int opts) throws java.io.IOException
opts
- closing options, MolExporter.C_CLOSE_STREAM
or MolExporter.C_FLUSH_STREAM
java.io.IOException
public final chemaxon.marvin.plugin.CalculatorPluginCachedResults getCachedResults(Molecule target, boolean stringResult) throws PluginException
target
- the target moleculestringResult
- is true
if string result is needed,
false
if decorated molecule is neededPluginException
public final java.lang.String getResultMessage()
getResultMessage
in interface chemaxon.marvin.plugin.CalculatorResultAccess
public java.lang.String getRemark()
getRemark
in interface chemaxon.marvin.plugin.CalculatorResultAccess
public boolean isOK()
true
if the calculation has run without error.isOK
in interface chemaxon.marvin.plugin.CalculatorResultAccess
true
if the calculation has run without errorpublic java.lang.String getHeader()
getHeader
in interface chemaxon.marvin.plugin.CalculatorResultAccess
public java.lang.String getResult(Molecule target) throws PluginException
getResult
in interface chemaxon.marvin.plugin.CalculatorResultAccess
target
- is the target moleculePluginException
- on errorprotected java.lang.String getResults(java.lang.Object type) throws PluginException
type
- is the result typePluginException
- on errorpublic Molecule getResultMolecule(Molecule target) throws PluginException
getResultMolecule
in interface chemaxon.marvin.plugin.CalculatorResultAccess
target
- is the target moleculePluginException
- on errorpublic Molecule[] getResultMolecules(Molecule target) throws PluginException
null
.getResultMolecules
in interface chemaxon.marvin.plugin.CalculatorResultAccess
target
- is the target moleculesPluginException
- on errorpublic int getResultDomain()
CalculatorPlugin.ATOM
,
CalculatorPlugin.MOLECULE
or
CalculatorPlugin.MOLECULES
public double getSpecResult(Molecule target, java.lang.String arg) throws PluginException
CalculatorPlugin.getResult(int index)
(converted to double
) with index given in the argument string:
the argument string format is <result index>
.target
- is the target moleculearg
- is the argument stringPluginException
- in case of plugin calculation error