Enum Class FormulaGenerationRule

java.lang.Object
java.lang.Enum<FormulaGenerationRule>
com.chemaxon.calculations.elemanal.FormulaGenerationRule
All Implemented Interfaces:
Serializable, Comparable<FormulaGenerationRule>, java.lang.constant.Constable

@PublicApi public enum FormulaGenerationRule extends Enum<FormulaGenerationRule>
Molecular formula generation settings.
  • Enum Constant Details

    • IGNORE_MASS_NUMBERS

      public static final FormulaGenerationRule IGNORE_MASS_NUMBERS
      The generated molecular formula will not contain isotopic information.
      For example: C5[13C]H6 -> C6H6
    • IGNORE_CHARGE

      public static final FormulaGenerationRule IGNORE_CHARGE
      Ignore charges in the generated molecular formula.
      For example: [O-]N[O+] -> NO2
    • FORMAL_CHARGE

      public static final FormulaGenerationRule FORMAL_CHARGE
      Show the formal (total) charge at the end of the molecular formula, instead of showing the charge of each atom separately.
      If DOT_DISCONNECTED_FRAGMENTS is also applied, then the charge of each fragment will be shown separately.
      This rule has no effect if IGNORE_CHARGE is also applied.
      For example: [O-]NO -> NO2[-]
    • DOT_DISCONNECTED_FRAGMENTS

      public static final FormulaGenerationRule DOT_DISCONNECTED_FRAGMENTS
      Dot-disconnected molecular formula of a multifragment molecule.
      For example: C7H5O2.Na for sodium benzoate.
  • Method Details

    • values

      public static FormulaGenerationRule[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static FormulaGenerationRule valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • ignoreAtomCharges

      public static boolean ignoreAtomCharges(Set<FormulaGenerationRule> rules)
      Returns true if the charge of each atom should be ignored in the formula based on the given rules.
    • showFormalCharge

      public static boolean showFormalCharge(Set<FormulaGenerationRule> rules)
      Returns true if the formal charge should be shown at the end of the formula based on the given rules.