Class SmilesBond

java.lang.Object
org.jmol.util.Edge
org.jmol.smiles.SmilesBond
All Implemented Interfaces:
SimpleEdge

public class SmilesBond extends Edge
Bond in a SmilesMolecule
  • Field Details

  • Constructor Details

    • SmilesBond

      public SmilesBond(SmilesAtom atom1, SmilesAtom atom2, int bondType, boolean isNot)
      SmilesBond constructor
      Parameters:
      atom1 - First atom
      atom2 - Second atom
      bondType - Bond type
      isNot -
  • Method Details

    • getBondOrderString

      static String getBondOrderString(int order)
    • getBondTypeFromCode

      static int getBondTypeFromCode(char code)
      Parameters:
      code - Bond code
      Returns:
      Bond type
    • getAtom1

      public SmilesAtom getAtom1()
    • set

      void set(SmilesBond bond)
    • setAtropType

      void setAtropType(int nn)
    • setPrimitive

      public SmilesBond setPrimitive(int i)
    • addBondOr

      SmilesBond addBondOr()
    • addPrimitive

      SmilesBond addPrimitive()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • set2

      public void set2(int bondType, boolean isNot)
    • set2a

      void set2a(SmilesAtom a1, SmilesAtom a2)
    • setAtom2

      void setAtom2(SmilesAtom atom, SmilesSearch molecule)
      from parse ring
      Parameters:
      atom -
      molecule -
    • isFromPreviousTo

      boolean isFromPreviousTo(SmilesAtom atom)
      Check to see if this is the bond to the previous atom
      Parameters:
      atom -
      Returns:
      TRUE if other atom is previous atom
    • isBondType

      static int isBondType(char ch, boolean isSearch, boolean isBioSequence) throws InvalidSmilesException
      Throws:
      InvalidSmilesException
    • getValence

      public int getValence()
    • getOtherAtom

      public SmilesAtom getOtherAtom(SmilesAtom a)
    • getAtomIndex1

      public int getAtomIndex1()
      Specified by:
      getAtomIndex1 in class Edge
    • getAtomIndex2

      public int getAtomIndex2()
      Specified by:
      getAtomIndex2 in class Edge
    • getCovalentOrder

      public int getCovalentOrder()
      Specified by:
      getCovalentOrder in interface SimpleEdge
      Specified by:
      getCovalentOrder in class Edge
      Returns:
      the bond order 1-4 if it is covalent, or 0 if not.
    • getOtherNode

      public SimpleNode getOtherNode(SimpleNode atom)
    • isCovalent

      public boolean isCovalent()
      Specified by:
      isCovalent in interface SimpleEdge
      Specified by:
      isCovalent in class Edge
    • isPartial

      public boolean isPartial()
      Specified by:
      isPartial in class Edge
    • isHydrogen

      public boolean isHydrogen()
      Specified by:
      isHydrogen in class Edge
    • switchAtoms

      void switchAtoms()
      Ensure that atom ordering is proper. possibly not fully tested
    • getRealCovalentOrder

      public int getRealCovalentOrder()
    • getMatchingBond

      public Edge getMatchingBond()
    • getAtom

      public SimpleNode getAtom(int i)
      Description copied from interface: SimpleEdge
      Get the respective atom, 0 or 1
      Returns:
      SimpleNode