@ Override public Object [ ] toArray ( ) { IAtomContainer [ ] ret = new IAtomContainer [ coordinates . size ( ) ] ; int index = 0 ; for ( Point3d [ ] coords : coordinates ) { try { IAtomContainer conf = ( IAtomContainer ) atomContainer . clone ( ) ; for ( int i = 0 ; i < coords . length ; i ++ ) { IAtom atom = conf . getAtom ( i ) ; atom . setPoint3d ( coords [ i ] ) ; } ret [ index ++ ] = conf ; } catch ( CloneNotSupportedException e ) { e . printStackTrace ( ) ; } } return ret ; }
Returns the conformers in the form of an array of IAtomContainers .