use of org.openscience.cdk.isomorphism.matchers.smarts.HydrogenAtom in project cdk by cdk.
the class SmartsQueryVisitor method visit.
public Object visit(ASTExplicitAtom node, Object data) {
IQueryAtom atom;
String symbol = node.getSymbol();
if ("*".equals(symbol)) {
atom = new AnyAtom(builder);
} else if ("A".equals(symbol)) {
atom = new AliphaticAtom(builder);
} else if ("a".equals(symbol)) {
atom = new AromaticAtom(builder);
} else if ("o".equals(symbol) || "n".equals(symbol) || "c".equals(symbol) || "s".equals(symbol) || "p".equals(symbol) || "as".equals(symbol) || "se".equals(symbol)) {
String atomSymbol = symbol.substring(0, 1).toUpperCase() + symbol.substring(1);
atom = new AromaticSymbolAtom(atomSymbol, builder);
} else if ("H".equals(symbol)) {
atom = new HydrogenAtom(builder);
atom.setSymbol(symbol.toUpperCase());
atom.setMassNumber(1);
} else if ("D".equals(symbol)) {
atom = new HydrogenAtom(builder);
atom.setSymbol(symbol.toUpperCase());
atom.setMassNumber(2);
} else if ("T".equals(symbol)) {
atom = new HydrogenAtom(builder);
atom.setSymbol(symbol.toUpperCase());
atom.setMassNumber(3);
} else {
atom = new AliphaticSymbolAtom(symbol, builder);
}
return atom;
}
Aggregations