final int FIRST_INDEX = 0;
final String HOSE_CODE_DESCRIPTOR = "HOSE_CODE";
final String TEMPLATE_FILE = "Template.sdf";
final String MOLECULE_NAME_DESCRIPTOR = "cdk:Title";
IMoleculeSet theMoleculeSet = new MoleculeSet();
String theDescriptorValue = new String();
Ring_Perception.setAromaticityBond(theMolecule);
theMoleculeSet.addMolecule(theMolecule);
for (int li = 1; li <= theLevelOfHoseCode; li++) {
IMoleculeSet theTemplateMolecule = new MoleculeSet();
StringBuilder theDescriptorName = new StringBuilder();
try {
runProgram(theMoleculeSet, li);
} catch (Exception ex) {
StringBuilder theErrorMessage = new StringBuilder();
theErrorMessage.append(theMolecule.getProperty(MOLECULE_NAME_DESCRIPTOR).toString()).append(" ").append("Error!!");
JOptionPane.showMessageDialog(null, theErrorMessage.toString(), "Error", JOptionPane.ERROR_MESSAGE);
}
theTemplateMolecule = SDFReader.openMoleculeFile(new File(TEMPLATE_FILE));
theDescriptorName.append(HOSE_CODE_DESCRIPTOR).append("_").append(li);
theDescriptorValue = theTemplateMolecule.getMolecule(FIRST_INDEX).getProperty(HOSE_CODE_DESCRIPTOR).toString();
theMolecule.setProperty(theDescriptorName.toString(), theDescriptorValue);
}
File theFile = new File(TEMPLATE_FILE);
theFile.delete();
}