Files
openbabel/scripts/java/OBTest.java
Noel O'Boyle afb12d1eb7 2009-09-21 Noel O'Boyle <baoilleach@gmail.com>
* scripts/*: Copied + pasted the scripts directory from 22x as a number
	of commits were never merged.
2009-09-21 11:12:00 +00:00

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();
}
}