Class IUPACNamingPlugin

  • All Implemented Interfaces:
    chemaxon.license.Licensable

    @PublicAPI
    public class IUPACNamingPlugin
    extends CalculatorPlugin
    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();
     String casNumber = plugin.getCASNumber();
     // do something with the result ...
     

    For concurrent plugin example applications using ChemAxon's concurrent framework, refer to the Concurrent plugin examples.

    Since:
    Marvin 4.1.7, 03/12/2007
    See Also:
    Molecule.toFormat(String)
    • Constructor Detail

      • IUPACNamingPlugin

        public IUPACNamingPlugin()
    • Method Detail

      • canRepeat

        public boolean canRepeat()
        Description copied from class: CalculatorPlugin
        Returns true if repeatedly running the same plugin object while getting the results on the GUI is allowed, false otherwise. For internal use.
        Overrides:
        canRepeat in class CalculatorPlugin
        Returns:
        true if allowed, false otherwise
      • checkMolecule

        public void checkMolecule​(Molecule mol)
        Description copied from class: CalculatorPlugin
        Checks the input molecule. Throws exception if the molecule is not accepted as input molecule, otherwise does nothing (simply returns). The default implementation refuses query molecules, molecules with SRU S-groups, molecules with multicenter S-groups and molecules with coordinate bonds.
        Overrides:
        checkMolecule in class CalculatorPlugin
        Parameters:
        mol - is the input molecule
      • getResultAsString

        public String getResultAsString​(Object type,
                                        int index,
                                        Object result)
                                 throws PluginException
        Returns the specified result in String format.
        Overrides:
        getResultAsString in class CalculatorPlugin
        Parameters:
        type - is the result type
        index - is the result index
        result - is the result item
        Returns:
        the specified result in String format
        Throws:
        PluginException - if an invalid result item is given
      • getTypeString

        public String getTypeString​(Object type)
        Returns a string representation of the given type. The default implementation returns type.toString().
        Overrides:
        getTypeString in class CalculatorPlugin
        Parameters:
        type - is the type object
        Returns:
        the type string
      • 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. Returns true if parameter "single" is set to "false", false otherwise (default: false).
        Overrides:
        handlesMultiFragmentMolecules in class CalculatorPlugin
        Returns:
        true if the plugin handles multifragment molecules, false otherwise
      • setGenerateCASNumber

        public void setGenerateCASNumber​(boolean g)
        Sets CAS number name generation. CAS number is fetched using a public web service.
        Parameters:
        g - if true then CAS number is generated
        Since:
        Marvin 5.0
        See Also:
        getCASNumber()
      • setGeneratePreferredIUPACName

        public void setGeneratePreferredIUPACName​(boolean g)
        Sets preferred IUPAC name generation.
        Parameters:
        g - if true then preferred IUPAC name is generated
        Since:
        Marvin 5.0
        See Also:
        getPreferredIUPACName()
      • setGenerateTraditionalIUPACName

        public void setGenerateTraditionalIUPACName​(boolean g)
        Sets traditional IUPAC name generation.
        Parameters:
        g - if true then traditional IUPAC name is generated
        Since:
        Marvin 5.0
        See Also:
        getTraditionalName()
      • standardize

        public void standardize​(Molecule mol)
        Standardizes the molecule. Overrides the default standardization.
        Overrides:
        standardize in class CalculatorPlugin
        Parameters:
        mol - is the molecule to be standardized