Interface Bond

  • All Superinterfaces:
    Serializable
    All Known Implementing Classes:
    BondImpl

    public interface Bond
    extends Serializable
    A simple bond -- it stores information about two atoms as well as information about its bond order.
    Author:
    Jules Jacobsen , Ulysse Carion
    • Method Detail

      • getAtomA

        Atom getAtomA()
        Gets atom 'A' of this bond. There is no meaning to which atom is 'A' and which is 'B'; the atoms are labeled 'A' or 'B' based on the order in which they are passed to this class's constructor.
        Returns:
        one of the two atoms in this bond
        See Also:
        getAtomB()
      • getAtomB

        Atom getAtomB()
        Gets atom 'B' of this bond. There is no meaning to which atom is 'A' and which is 'B'; the atoms are labeled 'A' or 'B' based on the order in which they are passed to this class's constructor.
        Returns:
        one of the two atoms in this bond
        See Also:
        getAtomA()
      • getOther

        Atom getOther​(Atom exclude)
        A utility method to get the other atom in a bond, given one of its atoms. If the atom passed is one of the atoms in this bond, then this method is essentially equivalent to saying atom == bond.getAtomA() ? bond.getAtomB() : bond.getAtomA().

        Note: Comparison of atoms in this method is done with ==, not equals.

        Parameters:
        exclude - the atom of the bond to not return
        Returns:
        the atom in this bond that was not passed as an argument
        Throws:
        IllegalArgumentException - if the passed atom is not in this bond
      • getBondOrder

        int getBondOrder()
        Gets the bond order of this bond. A return value of '1' corresponds to a single bond, '2' to a double bond, etc.
        Returns:
        this bond's bond order
      • getLength

        double getLength()
        Gets the distance between the two atoms of this bond.

        This distance is calculated by Calc.getDistance(Atom, Atom), but this method will suppress the empty threat of a StructureException that method makes.

        Returns:
        the distance between the two atoms of this bond.