@Override
    public double validate(IMolecularFormula formula) throws CDKException {
        logger.info("Start validation of ", formula);
        double isValid = 1.0;
        Iterator<IElement> itElem = MolecularFormulaManipulator.elements(formula).iterator();
        while (itElem.hasNext()) {
            IElement element = itElem.next();
            int occur = MolecularFormulaManipulator.getElementCount(formula, element);
            if (occur > hashMap.get(element.getSymbol())) {
                isValid = 0.0;
                break;
            }
        }

        return isValid;
    }
@ Override public double validate ( IMolecularFormula formula ) throws CDKException { logger . info ( "Start validation of " , formula ) ; double isValid = 1.0 ; Iterator < IElement > itElem = MolecularFormulaManipulator . elements ( formula ) . iterator ( ) ; while ( itElem . hasNext ( ) ) { IElement element = itElem . next ( ) ; int occur = MolecularFormulaManipulator . getElementCount ( formula , element ) ; if ( occur > hashMap . get ( element . getSymbol ( ) ) ) { isValid = 0.0 ; break ; } } return isValid ; }
Validate the occurrence of this IMolecularFormula.

@param formula   Parameter is the IMolecularFormula
@return          An ArrayList containing 9 elements in the order described above