java.lang.Object
org.xmlcml.noncml.SMILESAtom
- public class SMILESAtom
- extends java.lang.Object
parse a SMILES atom [....]. Interprets leading characters of a String as a SMILES atom (used for
parsing SMILES. Typical usage:
s = "[13C@H3-2]NOS"
SMILESAtom sa = new SMILESAtom(s);
String rest = s.substring(sa.getLength());
int isotope = sa.getIsotope();
String element = sa.getElementType();
String chiral = sa.getChiral();
int hCount = sa.getHydrogenCount();
int ch = sa.getFormalCharge()
At present SMARTS is not supported
UNMATCHED_BRACKET
public static final java.lang.String UNMATCHED_BRACKET
- See Also:
- Constant Field Values
UNKNOWN_ELEMENT
public static final java.lang.String UNKNOWN_ELEMENT
- See Also:
- Constant Field Values
UNPARSABLE_ATOM
public static final java.lang.String UNPARSABLE_ATOM
- See Also:
- Constant Field Values
aromatic
protected boolean aromatic
len
protected int len
elementType
protected java.lang.String elementType
isotope
protected int isotope
chiral
protected java.lang.String chiral
hydrogenCount
protected int hydrogenCount
formalCharge
protected int formalCharge
SMILESAtom
public SMILESAtom(java.lang.String s)
throws org.xmlcml.cml.CMLException
getLength
public int getLength()
getElementType
public java.lang.String getElementType()
getIsotope
public int getIsotope()
getChiral
public java.lang.String getChiral()
getHydrogenCount
public int getHydrogenCount()
getFormalCharge
public int getFormalCharge()
getAromatic
public boolean getAromatic()
toString
public java.lang.String toString()
- Description copied from class:
java.lang.Object
- Convert this Object to a human-readable String.
There are no limits placed on how long this String
should be or what it should contain. We suggest you
make it as intuitive as possible to be able to place
it into System.out.println() 55
and such.
It is typical, but not required, to ensure that this method
never completes abruptly with a java.lang.RuntimeException.
This method will be called when performing string
concatenation with this object. If the result is
null, string concatenation will instead
use "null".
The default implementation returns
getClass().getName() + "@" +
Integer.toHexString(hashCode()).
main
public static void main(java.lang.String[] args)
throws java.lang.Exception