|
|||||||||
| 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. |
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. |
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()
public 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(chemaxon.formats.MolExporter#C_CLOSE_STREAM).
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.IOExceptionpublic final java.lang.String getResultMessage()
public java.lang.String getRemark()
public final boolean isOK()
true if the calculation has run without error.
true if the calculation has run without errorpublic java.lang.String getHeader()
public java.lang.String getResult(Molecule target)
throws PluginException
target - 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
target - is the target molecule
PluginException - if on errorpublic int getResultDomain()
CalculatorPlugin.ATOM or CalculatorPlugin.MOLECULE
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 | ||||||||