1 /* Copyright (C) 2004-2007  The Chemistry Development Kit (CDK) project
2  *
3  * Contact: cdk-devel@lists.sourceforge.net
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public License
7  * as published by the Free Software Foundation; either version 2.1
8  * of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 package org.openscience.cdk.isomorphism.matchers.smarts;
20 
21 import org.openscience.cdk.interfaces.IAtom;
22 import org.openscience.cdk.interfaces.IChemObjectBuilder;
23 
24 /**
25  * This matcher any heavy atom that is not C or H.
26  *
27  * @cdk.module  smarts
28  * @cdk.githash
29  * @cdk.keyword SMARTS
30  */
31 @Deprecated
32 public class NonCHHeavyAtom extends SMARTSAtom {
33 
34     private static final long serialVersionUID = 5145049891214205622L;
35 
36     /**
37      * Creates a new instance
38      *
39      */
NonCHHeavyAtom(IChemObjectBuilder builder)40     public NonCHHeavyAtom(IChemObjectBuilder builder) {
41         super(builder);
42     }
43 
44     /*
45      * (non-Javadoc)
46      * @see
47      * org.openscience.cdk.isomorphism.matchers.smarts.SMARTSAtom#matches(org
48      * .openscience.cdk.interfaces.IAtom)
49      */
50     @Override
matches(IAtom atom)51     public boolean matches(IAtom atom) {
52         String symbol = atom.getSymbol();
53         return !(symbol.equals("C") || symbol.equals("H"));
54 
55     }
56 
57     /*
58      * (non-Javadoc)
59      * @see org.openscience.cdk.PseudoAtom#toString()
60      */
61     @Override
toString()62     public String toString() {
63         return "NonCHHeavyAtom()";
64     }
65 }
66