From: Egon W. <ewi...@un...> - 2006-08-10 09:44:13
|
(moved this thread to cdk...@li...) Hi Takayuki, On Thursday 10 August 2006 10:53, Takayuki KOTANI wrote: > To calculate such as XLogPDescriptor, cdk-20060714 uses IAtomContainer > class though cdk-20050826 uses AtomContainer. > On the other hands, IteratingSMILESReader returns Molecule. > > I am not familiar with JAVA and CDK, I really appreciate if some one teach > me a method for convert Molecule to IMolecule or IAtomContainer. Java, like several other programming languages, has a concept for interfaces. These interfaces define the programming interface for certain types of objects, which actually provide some implementation. Molecule is an implementation of the IMolecule interface, and hence *is* a IMolecule. So, there is no need to convert a Molecule into an IMolecule. Java also is a object-oriented programming language, and therefore provide a concept for 'extending' objects. In the CDK, the Molecule class extends the AtomContainer class (and the IMolecule interface extends the IAtomContainer interface). So, there is neither the need to convert a Molecule into an AtomContainer as it already *is* an AtomContainer (by extending it). > Thanks in advance. I hope this helps. Egon -- CUBIC blog: http://chem-bla-ics.blogspot.com/ |