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

org::openscience::cdk::AtomContainer::AtomContainer ( IAtomContainer  container  )  [inline]

Constructs an AtomContainer with a copy of the atoms and electronContainers of another AtomContainer (A shallow copy, i.e., with the same objects as in the original AtomContainer).

Parameters:
container An AtomContainer to copy the atoms and electronContainers from

Definition at line 128 of file AtomContainer.java.

References org::openscience::cdk::interfaces::IChemObject::addListener(), atomCount, atomParities, atoms(), bondCount, bonds(), org::openscience::cdk::interfaces::IAtomContainer::getAtom(), org::openscience::cdk::interfaces::IAtomContainer::getAtomCount(), org::openscience::cdk::interfaces::IAtomContainer::getBond(), org::openscience::cdk::interfaces::IAtomContainer::getBondCount(), org::openscience::cdk::interfaces::IAtomContainer::getLonePair(), org::openscience::cdk::interfaces::IAtomContainer::getLonePairCount(), org::openscience::cdk::interfaces::IAtomContainer::getSingleElectron(), org::openscience::cdk::interfaces::IAtomContainer::getSingleElectronCount(), lonePairCount, lonePairs(), singleElectronCount, and singleElectrons().

      {
            this.atomCount = container.getAtomCount();
            this.bondCount = container.getBondCount();
            this.lonePairCount = container.getLonePairCount();
            this.singleElectronCount = container.getSingleElectronCount();
            this.atoms = new IAtom[this.atomCount];
            this.bonds = new IBond[this.bondCount];
            this.lonePairs = new ILonePair[this.lonePairCount];
            this.singleElectrons = new ISingleElectron[this.singleElectronCount];
            
            atomParities = new Hashtable(atomCount/2);

            for (int f = 0; f < container.getAtomCount(); f++) {
                  atoms[f] = container.getAtom(f);
                  container.getAtom(f).addListener(this);
            }
            for (int f = 0; f < this.bondCount; f++) {
                  bonds[f] = container.getBond(f);
                  container.getBond(f).addListener(this);
            }
            for (int f = 0; f < this.lonePairCount; f++) {
                  lonePairs[f] = container.getLonePair(f);
                  container.getLonePair(f).addListener(this);
            }
            for (int f = 0; f < this.singleElectronCount; f++) {
                  singleElectrons[f] = container.getSingleElectron(f);
                  container.getSingleElectron(f).addListener(this);
            }
      }


Generated by  Doxygen 1.6.0   Back to index