mirror of
https://github.com/openbabel/openbabel.git
synced 2025-02-25 18:55:23 -06:00
* scripts/*: Copied + pasted the scripts directory from 22x as a number of commits were never merged.
31 lines
475 B
Java
31 lines
475 B
Java
import org.openbabel.*;
|
|
|
|
public class OBTest
|
|
{
|
|
public OBTest()
|
|
{
|
|
System.loadLibrary("openbabel_java");
|
|
}
|
|
|
|
public void run()
|
|
{
|
|
OBConversion c = new OBConversion();
|
|
OBMol mol = new OBMol();
|
|
|
|
c.SetInFormat("smi");
|
|
c.ReadString(mol, "c1ccccc1");
|
|
|
|
System.out.println("Benzene has " + mol.NumAtoms()
|
|
+ " atoms.");
|
|
}
|
|
|
|
public static void main(String[] args)
|
|
{
|
|
System.out.println("Running OBTest...");
|
|
|
|
OBTest test = new OBTest();
|
|
|
|
test.run();
|
|
}
|
|
}
|