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.CDKConstants; 22 import org.openscience.cdk.interfaces.IBond; 23 import org.openscience.cdk.interfaces.IChemObjectBuilder; 24 import org.openscience.cdk.isomorphism.matchers.IQueryAtom; 25 26 /** 27 * This matches an aromatic or a single bond, used when no bond is specified between an atom. 28 * 29 * @cdk.module smarts 30 * @cdk.githash 31 * @cdk.keyword SMARTS 32 */ 33 @Deprecated 34 public class AromaticOrSingleQueryBond extends SMARTSBond { 35 36 private static final long serialVersionUID = 6941220923564432716L; 37 38 /** 39 * Creates a new instance. 40 * 41 */ AromaticOrSingleQueryBond(IChemObjectBuilder builder)42 public AromaticOrSingleQueryBond(IChemObjectBuilder builder) { 43 super(builder); 44 setIsAromatic(true); 45 } 46 47 /** 48 * Creates a new instance 49 * 50 */ AromaticOrSingleQueryBond(IQueryAtom atom1, IQueryAtom atom2, Order order, IChemObjectBuilder builder)51 public AromaticOrSingleQueryBond(IQueryAtom atom1, IQueryAtom atom2, Order order, IChemObjectBuilder builder) { 52 super(atom1, atom2, order, builder); 53 setIsAromatic(true); 54 } 55 56 /* 57 * (non-Javadoc) 58 * @see 59 * org.openscience.cdk.isomorphism.matchers.smarts.SMARTSBond#matches(org 60 * .openscience.cdk.interfaces.IBond) 61 */ 62 @Override matches(IBond bond)63 public boolean matches(IBond bond) { 64 return bond.isAromatic() || bond.getOrder() == IBond.Order.SINGLE; 65 } 66 67 /* 68 * (non-Javadoc) 69 * @see org.openscience.cdk.Bond#toString() 70 */ 71 @Override toString()72 public String toString() { 73 return "AromaticOrSingleQueryBond()"; 74 } 75 } 76