Constructor Detail

CalculatorPlugin

CalculatorPlugin

Constructor.
This constructor is intended to be used only internally. Please note that this constuctor is annotated with the
Beta annotation, so it can be subject to incompatible changes or complete removal in any of the upcoming
releases without further notification.

Parameters:

sgExpander - Method to use to expand sgroups.

CalculatorPlugin

Constructor.
This constructor is intended to be used only internally. Please note that this constuctor is annotated with the
Beta annotation, so it can be subject to incompatible changes or complete removal in any of the upcoming
releases without further notification.

Parameters:

sgExpander - Method to use to expand sgroups.

sgContractor - Method to use to contract sgroups.

Method Detail

getPluginResource

public static java.net.URL getPluginResource(java.lang.String path)

Returns the plugin JAR as resource URL,
given the JAR file path relatively to the "plugins" directory.

getDoublePrecision

setDoublePrecision

protected final void setDoublePrecision(java.lang.String pr)

Sets the precision in the decimal format.
This is done according to the user defined precision value:
0..8 means maximal number of fractional digits, ending padded with zeros
(e.g. 12.56 -> 12.5600 for precision 4).
'inf' means maximal number of digits set to 10, no padding zeros
(e.g. 12.56 -> 12.56)

setMolecule

Sets the input molecule after standardization.
Standardization includes plugin specific standardization
(e.g. dehydrogenize, aromatize) and sgroup expansion.
The input molecule is left unchanged
(it is cloned for standardization).

setMolecule

Sets the input molecule after an optional standardization.
Standardization includes plugin specific standardization
(e.g. dehydrogenize, aromatize) and sgroup expansion.
The input molecule is left unchanged
(it is cloned if standardization is required).

setMolecule

Sets the input molecule after an optional standardization and/or modification.
Standardization includes plugin specific standardization (e.g. dehydrogenize,
aromatize) and sgroup expansion, modification usually means taking a microspecies
form, or the major tautomeric form of the input molecule (usually optional).
The input molecule is left unchanged (it is cloned before standardization/modification
if required).

Parameters:

mol - is the input molecule

st - is true if standardization is required

om - is true if original input molecule is to be used for atom indexing
false if modified molecule is to be used for atom indexing

createModifiedInputMolecule

Returns the modified input molecule (e.g. microspecies, major tautomeric form).
This method is used for modifying the input molecule set by setMolecule(Molecule)
before passing the molecule to the calulation with setInputMolecule(Molecule)
method.
The default implementation returns the input molecule itself.

createStandardizedMolecule

Creates standardized molecule, the original input molecule is cloned.
If handlesMultiFragmentMolecules() returns false
then takes the largest fragment (measured by atom count).
The cloned molecule is standardized by standardize(Molecule).
Sets the atomIndexMap:
atomIndexMap[i] is the index in the standardized molecule
of the i-th atom in the original molecule or -1 if this atom has been removed.

Parameters:

mol - is the input molecule

om - is true if original input molecule is to be used for atom indexing
false if modified molecule is to be used for atom indexing

createStandardizedMolecule

Creates standardized molecule, the original input molecule is cloned.
If handlesMultiFragmentMolecules() returns false
then takes the largest fragment (measured by atom count).
The cloned molecule is standardized by standardize(Molecule).
Sets the atomIndexMap:
atomIndexMap[i] is the index in the standardized molecule
of the i-th atom in the original molecule or -1 if this atom has been removed.

getMainMolecule

Returns the molecule form with largest distribution.
Returns a microspecies with largest distribution on a given pH
if pH is different from Double.NaN,
otherwise returns the input molecule itself.
The default implementation returns the input molecule itself.

getDisplayMolecule

Returns the molecule object to be used for GUI display.
Plugins will add atom labels and/or molecule properties
to display plugin results in the molecule.
The default implementation returns the original molecule.

handlesMultiFragmentMolecules

public boolean handlesMultiFragmentMolecules()

Returns 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.
The default implementation returns false.

isOK

public boolean isOK()

Returns true if no calculation error,
false on error. This is the same as
the return value of the last call to run().
The default implementation returns true
if both getErrorMessage() and getWarningMessage()
return the empty string.

getWarningMessage

getResultMessage

public final java.lang.String getResultMessage()

Returns the plugin calculation error message,
error or warning.

Returns:

the plugin calculation error message

getRemark

public java.lang.String getRemark()

Returns the calculation remark.
While in case of warning or error returned in getErrorMessage()
or getWarningMessage() there is no calculation result,
in case of a remark the calculation can be performed although the
result may not be correct or precise - depending on the remark.
The default implementation returns null.

Returns:

the calculation remark

getResultTypes

public java.lang.Object[] getResultTypes()

Returns the result types.
The default implementation returns null.

Returns:

the result types

getTypeString

public java.lang.String getTypeString(java.lang.Object type)

Returns a string representation of the given type.
The default implementation returns type.toString().

getResultMolecules

Returns the result molecule array for display. The display of the
molecules in array have to be implemented in a class derived from
CalculatorPluginDispaly class (example: MultipleDataDisplay class).
Atomic results are stored in atom extra labels (MolAtom.getExtraLabel()).
Molecular results are stored in molecule properties with keys being the
result types (Molecule.getProperty(String)).

getResultSource

Returns the result as a document source object.
This is useful for displaying the molecules in a viewer dynamically
as they become available instead of collecting all results before display.
The default implementation returns null.

getResult

Returns the result item for the specified argument string.
The default implementation calls getResult(Object, int)
with the argument string converted to an integer (result index)
and with the first result type.

Parameters:

arg - is the argument string

Returns:

the result item for the first result type
and the given argument string

standardize

Standardizes the molecule by performing the transformations necessary
to run the plugin (aromatize, dehydrogenize, bring nitro groups to
common form, ...). This implementation performs the following transformations: