// Path: source/org/helm/notation/NotationException.java
// public class NotationException extends Exception {
// 
// 	/**
// 	 * Creates a new instance of <code>NotationException</code> without detail
// 	 * message.
// 	 */
// 	public NotationException() {
// 	}
// 
// 	/**
// 	 * Constructs an instance of <code>NotationException</code> with the
// 	 * specified detail message.
// 	 * 
// 	 * @param msg
// 	 *            the detail message.
// 	 */
// 	public NotationException(String msg) {
// 		super(msg);
// 	}
// 
// 	public NotationException(String msg, Throwable err) {
// 		super(msg, err);
// 	}
// }
// 
// Path: source/org/helm/notation/StructureException.java
// public class StructureException extends Exception {
// 
// 	/**
// 	 * Creates a new instance of <code>StructureException</code> without detail
// 	 * message.
// 	 */
// 	public StructureException() {
// 	}
// 
// 	/**
// 	 * Constructs an instance of <code>StructureException</code> with the
// 	 * specified detail message.
// 	 * 
// 	 * @param msg
// 	 *            the detail message.
// 	 */
// 	public StructureException(String msg) {
// 		super(msg);
// 	}
// 
// 	public StructureException(String msg, Throwable err) {
// 		super(msg, err);
// 	}
// }
// 
// Path: source/org/helm/notation/model/MoleculeInfo.java
// public class MoleculeInfo {
// 	private double molecularWeight;
// 	private String molecularFormula;
// 	private double exactMass;
// 
// 	public double getMolecularWeight() {
// 		return molecularWeight;
// 	}
// 
// 	public void setMolecularWeight(double molecularWeight) {
// 		this.molecularWeight = molecularWeight;
// 	}
// 
// 	public String getMolecularFormula() {
// 		return molecularFormula;
// 	}
// 
// 	public void setMolecularFormula(String molecularFormula) {
// 		this.molecularFormula = molecularFormula;
// 	}
// 
// 	public double getExactMass() {
// 		return exactMass;
// 	}
// 
// 	public void setExactMass(double exactMass) {
// 		this.exactMass = exactMass;
// 	}
// }


import org.helm.notation.model.MoleculeInfo;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.TreeMap;
import chemaxon.formats.MolImporter;
import chemaxon.marvin.calculations.ElementalAnalyserPlugin;
import chemaxon.marvin.plugin.PluginException;
import chemaxon.struc.MolAtom;
import chemaxon.struc.MolBond;
import chemaxon.struc.Molecule;
import org.helm.notation.NotationException;
import org.helm.notation.StructureException;

     * @return true or false
     * @throws StructureException
     */
    protected static boolean isSingleStereo(MolAtom rAtom) throws StructureException {
        int bondCount = rAtom.getBondCount();
        if (bondCount != 1) {
            throw new StructureException("RGroup is allowed to have single connection to other atom");
        }

        MolBond bond = rAtom.getBond(0);
        int bondType = bond.getFlags() & MolBond.STEREO1_MASK;

        return bondType == MolBond.UP || bondType == MolBond.DOWN || bondType == MolBond.WAVY;
    }



	/**
	 * This method should be used by SimpleNotationParser and
	 * ComplexNotationParser, not exposed to public
	 * 
	 * @param chunks
	 *            - list of main MoleculeInfo
	 * @param caps
	 *            - list of cap MoleculeInfo
	 * @return MoleculeInfo after processing
	 * @throws NotationException
	 */
	protected static MoleculeInfo processMoleculeInfo(
			List<MoleculeInfo> chunks, List<MoleculeInfo> caps)

// Path: source/org/helm/notation/NotationException.java
// public class NotationException extends Exception {
// 
// 	/**
// 	 * Creates a new instance of <code>NotationException</code> without detail
// 	 * message.
// 	 */
// 	public NotationException() {
// 	}
// 
// 	/**
// 	 * Constructs an instance of <code>NotationException</code> with the
// 	 * specified detail message.
// 	 * 
// 	 * @param msg
// 	 *            the detail message.
// 	 */
// 	public NotationException(String msg) {
// 		super(msg);
// 	}
// 
// 	public NotationException(String msg, Throwable err) {
// 		super(msg, err);
// 	}
// }
// 
// Path: source/org/helm/notation/StructureException.java
// public class StructureException extends Exception {
// 
// 	/**
// 	 * Creates a new instance of <code>StructureException</code> without detail
// 	 * message.
// 	 */
// 	public StructureException() {
// 	}
// 
// 	/**
// 	 * Constructs an instance of <code>StructureException</code> with the
// 	 * specified detail message.
// 	 * 
// 	 * @param msg
// 	 *            the detail message.
// 	 */
// 	public StructureException(String msg) {
// 		super(msg);
// 	}
// 
// 	public StructureException(String msg, Throwable err) {
// 		super(msg, err);
// 	}
// }
// 
// Path: source/org/helm/notation/model/MoleculeInfo.java
// public class MoleculeInfo {
// 	private double molecularWeight;
// 	private String molecularFormula;
// 	private double exactMass;
// 
// 	public double getMolecularWeight() {
// 		return molecularWeight;
// 	}
// 
// 	public void setMolecularWeight(double molecularWeight) {
// 		this.molecularWeight = molecularWeight;
// 	}
// 
// 	public String getMolecularFormula() {
// 		return molecularFormula;
// 	}
// 
// 	public void setMolecularFormula(String molecularFormula) {
// 		this.molecularFormula = molecularFormula;
// 	}
// 
// 	public double getExactMass() {
// 		return exactMass;
// 	}
// 
// 	public void setExactMass(double exactMass) {
// 		this.exactMass = exactMass;
// 	}
// }


// Path: source/org/helm/notation/tools/StructureParser.java
import org.helm.notation.model.MoleculeInfo;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.TreeMap;
import chemaxon.formats.MolImporter;
import chemaxon.marvin.calculations.ElementalAnalyserPlugin;
import chemaxon.marvin.plugin.PluginException;
import chemaxon.struc.MolAtom;
import chemaxon.struc.MolBond;
import chemaxon.struc.Molecule;
import org.helm.notation.NotationException;
import org.helm.notation.StructureException;

     * @return true or false
     * @throws StructureException
     */
    protected static boolean isSingleStereo(MolAtom rAtom) throws StructureException {
        int bondCount = rAtom.getBondCount();
        if (bondCount != 1) {
            throw new StructureException("RGroup is allowed to have single connection to other atom");
        }

        MolBond bond = rAtom.getBond(0);
        int bondType = bond.getFlags() & MolBond.STEREO1_MASK;

        return bondType == MolBond.UP || bondType == MolBond.DOWN || bondType == MolBond.WAVY;
    }



	/**
	 * This method should be used by SimpleNotationParser and
	 * ComplexNotationParser, not exposed to public
	 * 
	 * @param chunks
	 *            - list of main MoleculeInfo
	 * @param caps
	 *            - list of cap MoleculeInfo
	 * @return MoleculeInfo after processing
	 * @throws NotationException
	 */
	protected static MoleculeInfo processMoleculeInfo(
			List<MoleculeInfo> chunks, List<MoleculeInfo> caps)

			throws NotationException {
