PharmacophoreQueryAtom extends Atom implements IQueryAtom { @Override public boolean matches(IAtom atom) { PharmacophoreAtom patom = PharmacophoreAtom.get(atom); return patom.getSymbol().equals(getSymbol()); } PharmacophoreQueryAtom(String symbol, String smarts); @Override String getSymbol(); @Override void setSymbol(String symbol); String getSmarts(); @Override boolean matches(IAtom atom); @Override String toString();  }
@Test public void testMatches() { PharmacophoreQueryAtom qatom = new PharmacophoreQueryAtom("aromatic", "c1ccccc1"); PharmacophoreAtom patom1 = new PharmacophoreAtom("c1ccccc1", "aromatic", new Point3d(0, 0, 0)); PharmacophoreAtom patom2 = new PharmacophoreAtom("c1ccccc1", "hydrophobic", new Point3d(0, 0, 0)); PharmacophoreAtom patom3 = new PharmacophoreAtom("Cc1ccccc1", "aromatic", new Point3d(0, 0, 0)); PharmacophoreAtom patom4 = new PharmacophoreAtom("[CX2]N", "amine", new Point3d(0, 0, 0)); Assert.assertTrue(qatom.matches(patom1)); Assert.assertFalse(qatom.matches(patom2)); Assert.assertTrue(qatom.matches(patom3)); Assert.assertFalse(qatom.matches(patom4)); }