|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectchemaxon.marvin.plugin.CalculatorPluginOutput
public class CalculatorPluginOutput
Class providing plugin output in table form. The default implementation provides the following output:
| 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().
| Field Summary | |
|---|---|
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 Summary | |
|---|---|
CalculatorPluginOutput()
Default constructor. |
|
CalculatorPluginOutput(CalculatorPlugin plugin)
Constructor that sets plugin. |
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected CalculatorPlugin plugin
protected java.util.Properties params
protected java.lang.String separator
| Constructor Detail |
|---|
public CalculatorPluginOutput()
public CalculatorPluginOutput(CalculatorPlugin plugin)
plugin - is the plugin| Method Detail |
|---|
public 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.CalculatorResultAccesspublic void setSeparator(java.lang.String separator)
separator - is the separator string
public void setParameters(java.util.Properties params)
throws PluginException
params - is the parameter table
PluginException - on error
public java.util.Properties getPluginParameters()
throws PluginException
PluginException - on error
public void setOutputParameters(java.lang.Object[] types)
throws PluginException
types - the result types
PluginException - 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 output
public void setOutputStream(java.io.OutputStream os)
throws java.io.IOException
os - the output stream
java.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 needed
PluginExceptionpublic final java.lang.String getResultMessage()
getResultMessage in interface chemaxon.marvin.plugin.CalculatorResultAccesspublic java.lang.String getRemark()
getRemark in interface chemaxon.marvin.plugin.CalculatorResultAccesspublic boolean isOK()
true if the calculation has run without error.
isOK in interface chemaxon.marvin.plugin.CalculatorResultAccesstrue 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.CalculatorResultAccesstarget - is the target molecule
PluginException - on error
protected java.lang.String getResults(java.lang.Object type)
throws PluginException
type - is the result type
PluginException - on error
public Molecule getResultMolecule(Molecule target)
throws PluginException
getResultMolecule in interface chemaxon.marvin.plugin.CalculatorResultAccesstarget - is the target molecule
PluginException - on error
public Molecule[] getResultMolecules(Molecule target)
throws PluginException
null.
getResultMolecules in interface chemaxon.marvin.plugin.CalculatorResultAccesstarget - is the target molecules
PluginException - 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 string
PluginException - in case of plugin calculation error
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||