/** * Returns the most abundant (major) isotope whose symbol equals element. * *@param symbol the symbol of the element in question *@return The Major Isotope value */ public IIsotope getMajorIsotope(String symbol) { return getMajorIsotope(Elements.ofString(symbol).number()); }
private static double scaledAtomicMasses(IElement element) throws java.io.IOException, ClassNotFoundException { IsotopeFactory isofac = Isotopes.getInstance(); double realmasses = isofac.getNaturalMass(element); return (realmasses / CARBON_MASS); }
/** * @throws java.io.IOException if there is error in getting the {@link IsotopeFactory} */ public PubChemXMLHelper(IChemObjectBuilder builder) throws IOException { this.builder = builder; factory = Isotopes.getInstance(); }
/** * Method to create a default AtomTypeFactory, using the structgen atom type list. * * @see #getInstance(String, IChemObjectBuilder) * @param builder IChemObjectBuilder used to make IChemObject instances * @return The AtomTypeFactory for the given data file */ public static AtomTypeFactory getInstance(IChemObjectBuilder builder) { return getInstance("org/openscience/cdk/config/data/structgen_atomtypes.xml", builder); }
/** * Returns an element according to a given atomic number. * *@param atomicNumber The elements atomic number *@return The Element */ public IElement getElement(int atomicNumber) { return getMajorIsotope(atomicNumber); }
/** * Get the covalent radius for an element. * * @param symbol the symbol of the element * @return the covalent radius */ public static Double getCovalentRadius(String symbol) { return Elements.ofString(symbol).covalentRadius(); }
/** * Checks whether the given element exists. * * @param elementName The element name to test * @return True is the element exists, false otherwise */ public boolean isElement(String elementName) { return (getElement(elementName) != null); }
/** * Return the number of elements currently considered in the periodic * table. * * @return the number of elements in the periodic table */ public static int getElementCount() { return Elements.values().length; }
/** * Returns a singleton instance of this class. * * @return the singleton * @throws IOException when reading of the data file did not work */ public static Isotopes getInstance() throws IOException { if (myself == null) myself = new Isotopes(); return myself; }
@Override public boolean[] getFlags() { // could use a list a invoke .toArray() on the return boolean[] flagArray = new boolean[CDKConstants.MAX_FLAG_INDEX + 1]; for (int i = 0; i < CDKConstants.FLAG_MASKS.length; i++) { int mask = CDKConstants.FLAG_MASKS[i]; flagArray[i] = getFlag(mask); } return flagArray; }
/** * Returns the most abundant (major) isotope whose symbol equals element. * *@param symbol the symbol of the element in question *@return The Major Isotope value */ public IIsotope getMajorIsotope(String symbol) { return getMajorIsotope(Elements.ofString(symbol).number()); }
private static double scaledAtomicMasses(IElement element) throws java.io.IOException, ClassNotFoundException { IsotopeFactory isofac = Isotopes.getInstance(); double realmasses = isofac.getNaturalMass(element); return (realmasses / CARBON_MASS); }
/** * Returns an Element with a given element symbol. * *@param symbol The element symbol for the requested element *@return The configured element */ public IElement getElement(String symbol) { return getMajorIsotope(symbol); }