I'm trying to use a javaJava library called CDKCDK with Mathematica's J/Link.
Needs["JLink`"];
ReinstallJava[ClassPath -> $jar];
LoadJavaClass["org.openscience.cdk.silent.SilentChemObjectBuilder"];
sp = JavaNew["org.openscience.cdk.smiles.SmilesParser",
SilentChemObjectBuilder`getInstance[]];
vabcVolume = JavaNew["org.openscience.cdk.geometry.volume.VABCVolume"];
atom = sp@parseSmiles["C"]
This short code istis the javaJava equivalent to:
SmilesParser sp = new
SmilesParser(SilentChemObjectBuilder.getInstance());
IAtomContainer m = sp.parseSmiles("C");
SmilesParser sp = new
SmilesParser(SilentChemObjectBuilder.getInstance());
IAtomContainer m = sp.parseSmiles("C");
As Youyou can see, I need to convert the SmilesParserSmilesParser
object to IAtomContainerIAtomContainer
object. In Java, the compiler will do it for me. But I guess Mathematica can't do it automatically. Can someone tell me how I can get an IAtomContainerIAtomContainer
object (this is an Interface object, not class object) in Mathematica?