Logo Search packages:      
Sourcecode: cdk version File versions  Download package

boolean org::openscience::cdk::ConformerContainer::add ( IAtomContainer  atomContainer ) [inline]

Add a conformer to the end of the list.

This method allows you to add a IAtomContainer object as another conformer. Before adding it ensures that the title of specific object matches the stored title for these conformers. It will also check that the number of atoms in the specified molecule match the number of atoms in the current set of conformers.

This method will not check for duplicate conformers.

atomContainerThe new conformer to add.

Definition at line 240 of file ConformerContainer.java.

References org::openscience::cdk::CDKConstants::TITLE.

        if (this.atomContainer == null) {
            this.atomContainer = atomContainer;
            title = (String) atomContainer.getProperty(CDKConstants.TITLE);
        if (title==null){
            throw new IllegalArgumentException(
                                               "At least one of the input molecules does not have a title");
        if (!title.equals(atomContainer.getProperty(CDKConstants.TITLE)))
            throw new IllegalArgumentException(
                  "The input molecules does not have the same title ('" + title + 
                  "') as the other conformers ('" + atomContainer.getProperty(CDKConstants.TITLE) + "')");

        if (atomContainer.getAtomCount() != this.atomContainer.getAtomCount())
            throw new IllegalArgumentException("Doesn't have the same number of atoms as the rest of the conformers");

        return true;

Generated by  Doxygen 1.6.0   Back to index