MolecularFormulaManipulator { public static String[] generateOrderEle() { return new String[]{ "C", "H", "O", "N", "Si", "P", "S", "F", "Cl", "Br", "I", "Sn", "B", "Pb", "Tl", "Ba", "In", "Pd", "Pt", "Os", "Ag", "Zr", "Se", "Zn", "Cu", "Ni", "Co", "Fe", "Cr", "Ti", "Ca", "K", "Al", "Mg", "Na", "Ce", "Hg", "Au", "Ir", "Re", "W", "Ta", "Hf", "Lu", "Yb", "Tm", "Er", "Ho", "Dy", "Tb", "Gd", "Eu", "Sm", "Pm", "Nd", "Pr", "La", "Cs", "Xe", "Te", "Sb", "Cd", "Rh", "Ru", "Tc", "Mo", "Nb", "Y", "Sr", "Rb", "Kr", "As", "Ge", "Ga", "Mn", "V", "Sc", "Ar", "Ne", "He", "Be", "Li", "Bi", "Po", "At", "Rn", "Fr", "Ra", "Ac", "Th", "Pa", "U", "Np", "Pu", "Am", "Cm", "Bk", "Cf", "Es", "Fm", "Md", "No", "Lr", "Rf", "Db", "Sg", "Bh", "Hs", "Mt", "Ds", "Rg", "Cn", "R"}; }  static int getAtomCount(IMolecularFormula formula); static int getElementCount(IMolecularFormula formula, IElement element); static int getElementCount(IMolecularFormula formula, IIsotope isotope); static int getElementCount(IMolecularFormula formula, String symbol); static List<IIsotope> getIsotopes(IMolecularFormula formula, IElement element); static List<IElement> elements(IMolecularFormula formula); static boolean containsElement(IMolecularFormula formula, IElement element); static IMolecularFormula removeElement(IMolecularFormula formula, IElement element); static String getString(IMolecularFormula formula, String[] orderElements,
                                   boolean setOne); static String getString(IMolecularFormula formula, String[] orderElements,
                                   boolean setOne, boolean setMassNumber); static String getString(IMolecularFormula formula); static String getString(IMolecularFormula formula, boolean setOne); static String getString(IMolecularFormula formula, boolean setOne, boolean setMassNumber); static List<IIsotope> putInOrder(String[] orderElements, IMolecularFormula formula); @Deprecated static String getHillString(IMolecularFormula formula); static String getHTML(IMolecularFormula formula); static String getHTML(IMolecularFormula formula, boolean chargeB, boolean isotopeB); static String getHTML(IMolecularFormula formula, String[] orderElements, boolean showCharge, boolean showIsotopes); static IMolecularFormula getMolecularFormula(String stringMF, IChemObjectBuilder builder); static IMolecularFormula getMajorIsotopeMolecularFormula(String stringMF, IChemObjectBuilder builder); static IMolecularFormula getMolecularFormula(String stringMF, IMolecularFormula formula); @Deprecated static double getTotalExactMass(IMolecularFormula formula); static double getTotalMassNumber(IMolecularFormula formula); static double getMass(IMolecularFormula mf, int flav); static double getMass(IMolecularFormula mf); @Deprecated static double getNaturalExactMass(IMolecularFormula formula); @Deprecated static double getMajorIsotopeMass(IMolecularFormula formula); static double getTotalNaturalAbundance(IMolecularFormula formula); static double getDBE(IMolecularFormula formula); static IMolecularFormula getMolecularFormula(IAtomContainer atomContainer); static IMolecularFormula getMolecularFormula(IAtomContainer atomContainer, IMolecularFormula formula); static IAtomContainer getAtomContainer(IMolecularFormula formula); static IAtomContainer getAtomContainer(IMolecularFormula formula, IAtomContainer atomContainer); static IAtomContainer getAtomContainer(String formulaString, IChemObjectBuilder builder); static String[] generateOrderEle(); static boolean compare(IMolecularFormula formula1, IMolecularFormula formula2); static List<IElement> getHeavyElements(IMolecularFormula formula); static String simplifyMolecularFormula(String formula); static boolean adjustProtonation(IMolecularFormula mf, int hcnt); static IMolecularFormula getMostAbundant(IMolecularFormula mf); static IMolecularFormula getMostAbundant(IAtomContainer mol); static final int MolWeight; static final int MolWeightIgnoreSpecified; static final int MonoIsotopic; static final int MostAbundant; static final Comparator<IIsotope> NAT_ABUN_COMP; }
@Test public void testGenerateOrderEle() { String[] listElements = new String[]{ "C", "H", "O", "N", "Si", "P", "S", "F", "Cl", "Br", "I", "Sn", "B", "Pb", "Tl", "Ba", "In", "Pd", "Pt", "Os", "Ag", "Zr", "Se", "Zn", "Cu", "Ni", "Co", "Fe", "Cr", "Ti", "Ca", "K", "Al", "Mg", "Na", "Ce", "Hg", "Au", "Ir", "Re", "W", "Ta", "Hf", "Lu", "Yb", "Tm", "Er", "Ho", "Dy", "Tb", "Gd", "Eu", "Sm", "Pm", "Nd", "Pr", "La", "Cs", "Xe", "Te", "Sb", "Cd", "Rh", "Ru", "Tc", "Mo", "Nb", "Y", "Sr", "Rb", "Kr", "As", "Ge", "Ga", "Mn", "V", "Sc", "Ar", "Ne", "He", "Be", "Li", "Bi", "Po", "At", "Rn", "Fr", "Ra", "Ac", "Th", "Pa", "U", "Np", "Pu", "Am", "Cm", "Bk", "Cf", "Es", "Fm", "Md", "No", "Lr", "Rf", "Db", "Sg", "Bh", "Hs", "Mt", "Ds", "Rg", "Cn", "R"}; String[] arrayGenerated = MolecularFormulaManipulator.generateOrderEle(); List<String> listGenerated = Arrays.asList(arrayGenerated); Assert.assertEquals(113, listGenerated.size()); for (int i = 0; i < listElements.length; i++) { String element = listElements[i]; Assert.assertTrue("Element missing from generateOrderEle: " + element, listGenerated.contains(element)); } }