atomType.setFlag(CDKConstants.IS_HYDROGENBOND_ACCEPTOR, true); } else if ("D".equals(currentChars)) { atomType.setFlag(CDKConstants.IS_HYDROGENBOND_DONOR, true); } else { logger.warn("Unrecognized H-bond donor/acceptor pattern in config file: ", currentChars); atomType.setProperty(CDKConstants.CHEMICAL_GROUP_CONSTANT, Integer.valueOf(currentChars)); } else if (scalarType == SCALAR_ISAROMATIC) { atomType.setFlag(CDKConstants.ISAROMATIC, true); } else if (scalarType == SCALAR_PIBONDCOUNT) { atomType.setProperty(CDKConstants.PI_BOND_COUNT, Integer.valueOf(currentChars));
atomType.setFlag(CDKConstants.IS_HYDROGENBOND_ACCEPTOR, true); } else if ("D".equals(currentChars)) { atomType.setFlag(CDKConstants.IS_HYDROGENBOND_DONOR, true); } else { logger.warn("Unrecognized H-bond donor/acceptor pattern in config file: ", currentChars); atomType.setProperty(CDKConstants.CHEMICAL_GROUP_CONSTANT, Integer.valueOf(currentChars)); } else if (scalarType == SCALAR_ISAROMATIC) { atomType.setFlag(CDKConstants.ISAROMATIC, true); } else if (scalarType == SCALAR_PIBONDCOUNT) { atomType.setProperty(CDKConstants.PI_BOND_COUNT, Integer.valueOf(currentChars));
@Test public void testSetDonor_boolean() { boolean donor = true; IAtomType a = (IAtomType) newChemObject(); a.setFlag(CDKConstants.IS_HYDROGENBOND_DONOR, donor); Assert.assertTrue(a.getFlag(CDKConstants.IS_HYDROGENBOND_DONOR)); }
@Test public void testSetIsAromatic_boolean() { IAtomType a = (IAtomType) newChemObject(); a.setFlag(CDKConstants.ISAROMATIC, true); Assert.assertTrue(a.getFlag(CDKConstants.ISAROMATIC)); }
@Test public void testSetAcceptor_boolean() { boolean acceptor = true; IAtomType a = (IAtomType) newChemObject(); a.setFlag(CDKConstants.IS_HYDROGENBOND_ACCEPTOR, acceptor); Assert.assertTrue(a.getFlag(CDKConstants.IS_HYDROGENBOND_ACCEPTOR)); }
/** * @cdk.bug 1322 */ @Test public void aromaticityIsNotOverwritten() { IAtom atom = new Atom(Elements.CARBON); atom.setFlag(CDKConstants.ISAROMATIC, true); IAtomType atomType = new AtomType(Elements.Unknown.toIElement()); atomType.setFlag(CDKConstants.ISAROMATIC, false); atomType.setAtomTypeName("C.sp3"); AtomTypeManipulator.configure(atom, atomType); assertThat(atom.getFlag(CDKConstants.ISAROMATIC), is(true)); }
/** * @cdk.bug 1322 */ @Test public void aromaticitySetIfForType() { IAtom atom = new Atom(Elements.CARBON); atom.setFlag(CDKConstants.ISAROMATIC, false); IAtomType atomType = new AtomType(Elements.Unknown.toIElement()); atomType.setFlag(CDKConstants.ISAROMATIC, true); atomType.setAtomTypeName("C.am"); AtomTypeManipulator.configure(atom, atomType); assertThat(atom.getFlag(CDKConstants.ISAROMATIC), is(true)); } }
if (atom.getFlag(CDKConstants.ISAROMATIC)) atomType.setFlag(CDKConstants.ISAROMATIC, true);
@Test public void testConfigure_IAtom_IAtomType() { IAtom atom = new Atom(Elements.CARBON); IAtomType atomType = new AtomType(Elements.CARBON); atomType.setFlag(CDKConstants.IS_HYDROGENBOND_ACCEPTOR, true); AtomTypeManipulator.configure(atom, atomType); Assert.assertEquals(atomType.getFlag(CDKConstants.IS_HYDROGENBOND_ACCEPTOR), atom.getFlag(CDKConstants.IS_HYDROGENBOND_ACCEPTOR)); }