class MMElementRule implements IRule {

    @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;
    }

    public  MMElementRule();

}