|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectchemaxon.marvin.plugin.CalculatorPlugin
chemaxon.marvin.calculations.IUPACNamingPlugin
public class IUPACNamingPlugin
IUPAC name generator plugin.
API usage example:
// read input molecule MolImporter mi = new MolImporter("test.mol"); Molecule mol = mi.read(); mi.close(); // create plugin IUPACNamingPlugin plugin = new IUPACNamingPlugin(); // set the input molecule plugin.setMolecule(mol); // run the calculation plugin.run(); // get results String preferredIUPACName = plugin.getPreferredIUPACName(); String traditionalName = plugin.getTraditionalName(); // do something with the result ...
For concurrent plugin example applications using ChemAxon's concurrent framework, refer to the Concurrent plugin examples.
Molecule.toFormat(String)
Nested Class Summary |
---|
Nested classes/interfaces inherited from class chemaxon.marvin.plugin.CalculatorPlugin |
---|
CalculatorPlugin.HydrogenData |
Field Summary |
---|
Fields inherited from class chemaxon.marvin.plugin.CalculatorPlugin |
---|
ATOM, BLUE, CALCRGB_OFF, COVALENT_HYDRATION_ERROR_REMARK, CRITICAL_ERROR_MSG, EPSILON, explicitHydrogens, INCORRECT_AROMATIC_NITROGEN_REMARK, INSTABLE_TAUTOMERIC_FORM_REMARK, KEEP_HYDROGENS, keepHydrogens, licenseEnvironment, MOLECULE, MOLECULES, NAN, PLUGIN_CLASS_KEY, PLUGIN_DIR, RED, TRUE |
Constructor Summary | |
---|---|
IUPACNamingPlugin()
|
Method Summary | |
---|---|
boolean |
canRepeat()
Returns true if repeatedly running the same plugin object
while getting the results on the GUI is allowed, false otherwise. |
void |
checkMolecule(Molecule mol)
Checks the input molecule. |
java.lang.String |
getPreferredIUPACName()
Returns the preferred IUPAC name. |
java.lang.String |
getProductName()
Returns the product identifier of the plugin as given by LicenseManager . |
java.lang.Object |
getResult(java.lang.Object type,
int index)
Returns the result item for the specified key and index. |
java.lang.String |
getResultAsString(java.lang.Object type,
int index,
java.lang.Object result)
Returns the specified result in String format. |
Molecule |
getResultMolecule()
Returns the result molecule for display. |
java.lang.Object[] |
getResultTypes()
Returns the result types. |
java.lang.String |
getTraditionalName()
Returns the traditional IUPAC name. |
java.lang.String |
getTypeString(java.lang.Object type)
Returns a string representation of the given type. |
boolean |
handlesMultiFragmentMolecules()
Returns true if the plugin handles multifragment molecules,
false otherwise. |
boolean |
run()
Runs the tool. |
void |
setGeneratePreferredIUPACName(boolean g)
Sets preferred IUPAC name generation. |
void |
setGenerateTraditionalIUPACName(boolean g)
Sets traditional IUPAC name generation. |
protected void |
setInputMolecule(Molecule mol)
Sets the input molecule. |
void |
setLicenseEnvironment(java.lang.String env)
Sets license environment to be stored. |
void |
setParameters(java.util.Properties params)
Sets the input parameters for the plugin. |
void |
standardize(Molecule mol)
Standardizes the molecule. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IUPACNamingPlugin()
Method Detail |
---|
public void setParameters(java.util.Properties params) throws PluginException
setParameters
in class CalculatorPlugin
params
- is the parameter table
PluginException
- on errorpublic boolean handlesMultiFragmentMolecules()
true
if the plugin handles multifragment molecules,
false
otherwise. In the latter case the plugin takes the
fragment with more atoms if a multifragment molecule is given as input.
Returns true
if parameter "single" is set to "false",
false
otherwise (default: false
).
handlesMultiFragmentMolecules
in class CalculatorPlugin
public void checkMolecule(Molecule mol)
CalculatorPlugin
checkMolecule
in class CalculatorPlugin
mol
- is the input moleculeprotected void setInputMolecule(Molecule mol) throws PluginException
setInputMolecule
in class CalculatorPlugin
mol
- is the input molecule
PluginException
- on errorpublic void setGeneratePreferredIUPACName(boolean g)
g
- if true
then preferred IUPAC name is generatedgetPreferredIUPACName()
public void setGenerateTraditionalIUPACName(boolean g)
g
- if true
then traditional IUPAC name is generatedgetTraditionalName()
public boolean run() throws PluginException
run
in class CalculatorPlugin
PluginException
- on errorCalculatorPlugin.getErrorMessage()
public java.lang.String getPreferredIUPACName() throws PluginException
PluginException
- if name generation failsetGeneratePreferredIUPACName(boolean)
public java.lang.String getTraditionalName() throws PluginException
PluginException
- if name generation failsetGenerateTraditionalIUPACName(boolean)
public java.lang.Object[] getResultTypes()
getResultTypes
in class CalculatorPlugin
public java.lang.String getTypeString(java.lang.Object type)
getTypeString
in class CalculatorPlugin
type
- is the type object
public boolean canRepeat()
CalculatorPlugin
true
if repeatedly running the same plugin object
while getting the results on the GUI is allowed, false
otherwise.
For internal use.
canRepeat
in class CalculatorPlugin
true
if allowed, false
otherwisepublic java.lang.Object getResult(java.lang.Object type, int index) throws PluginException
getResult
in class CalculatorPlugin
type
- is the result typeindex
- is the result index
PluginException
- if the result cannot be returnedCalculatorPlugin.getResultTypes()
public java.lang.String getResultAsString(java.lang.Object type, int index, java.lang.Object result) throws PluginException
getResultAsString
in class CalculatorPlugin
type
- is the result typeindex
- is the result indexresult
- is the result item
PluginException
- if an invalid result item is givenpublic Molecule getResultMolecule() throws PluginException
MolAtom.getExtraLabel()
).
Molecular results are stored in molecule properties
with keys being the result types
(Molecule.getProperty(String)
).
getResultMolecule
in class CalculatorPlugin
PluginException
- on errorpublic java.lang.String getProductName()
LicenseManager
.
getProductName
in class CalculatorPlugin
LicenseManager.STRUCTURE_TO_NAME
public void setLicenseEnvironment(java.lang.String env)
CalculatorPlugin
setLicenseEnvironment
in interface chemaxon.license.Licensable
setLicenseEnvironment
in class CalculatorPlugin
env
- environment String to be stored and passed to the LicenseHandler in the isLicensed methodpublic void standardize(Molecule mol)
standardize
in class CalculatorPlugin
mol
- is the molecule to be standardized
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |