Interface IBond

    • Method Detail

      • setAtoms

        void setAtoms​(IAtom[] atoms)
        Sets the array of atoms making up this bond.
        Parameters:
        atoms - An array of atoms that forms this bond
        See Also:
        atoms()
      • getBegin

        IAtom getBegin()
        Access the begin (or first) atom of the bond.
        Returns:
        the begin atom
      • getEnd

        IAtom getEnd()
        Access the end (or second) atom of the bond.
        Returns:
        the end atom
      • getIndex

        int getIndex()
      • getAtomCount

        int getAtomCount()
        Returns the number of Atoms in this Bond.
        Returns:
        The number of Atoms in this Bond
      • getConnectedAtom

        @Deprecated
        IAtom getConnectedAtom​(IAtom atom)
        Deprecated.
        use the method getOther(IAtom)
        Returns the other atom in the bond, the atom is connected to the given atom. This method is only correct for two-centre bonds, for n-centre bonds the behaviour is undefined and the more correct getConnectedAtoms(IAtom) should be used.

        
         IAtom beg = bond.getBegin();
         IAtom end = bond.getEnd();
         // bond.getConnectedAtom(beg) == end
         // bond.getConnectedAtom(end) == beg
         
        Parameters:
        atom - The atom the bond partner is searched of
        Returns:
        the connected atom or null if the given atom is not part of the bond
      • getOther

        IAtom getOther​(IAtom atom)
        Returns the other atom in the bond, the atom is connected to the given atom.This method is only correct for two-centre bonds, for n-centre bonds the behaviour is undefined and the more correct getConnectedAtoms(IAtom) should be used.

        
         IAtom beg = bond.getBegin();
         IAtom end = bond.getEnd();
         // bond.getOther(beg) == end
         // bond.getOther(end) == beg
         
        Parameters:
        atom - The atom the bond partner is searched of
        Returns:
        the connected atom or null if the given atom is not part of the bond
      • getConnectedAtoms

        IAtom[] getConnectedAtoms​(IAtom atom)
        Returns all the atoms in the bond connected to the given atom.
        Parameters:
        atom - The atoms the bond partner is searched of
        Returns:
        the connected atoms or null if the given atom is not part of the bond
      • contains

        boolean contains​(IAtom atom)
        Returns true if the given atom participates in this bond.
        Parameters:
        atom - The atom to be tested if it participates in this bond
        Returns:
        true if the atom participates in this bond
      • setAtom

        void setAtom​(IAtom atom,
                     int position)
        Sets an Atom in this bond.
        Parameters:
        atom - The atom to be set
        position - The position in this bond where the atom is to be inserted
        See Also:
        getAtom(int)
      • setStereo

        void setStereo​(IBond.Stereo stereo)
        Sets the stereo descriptor for this bond. Note this function will also modify the bond display style.
        Parameters:
        stereo - The stereo descriptor to be assigned to this bond.
        See Also:
        getStereo(), setDisplay(Display)
      • getDisplay

        IBond.Display getDisplay()
        Access the bond display style.
        Returns:
        the bond display
      • setDisplay

        void setDisplay​(IBond.Display display)
        Set the bond display style.
        Parameters:
        display - the display
      • get2DCenter

        javax.vecmath.Point2d get2DCenter()
        Returns the geometric 2D center of the bond.
        Returns:
        The geometric 2D center of the bond
      • get3DCenter

        javax.vecmath.Point3d get3DCenter()
        Returns the geometric 3D center of the bond.
        Returns:
        The geometric 3D center of the bond
      • compare

        boolean compare​(Object object)
        Compares a bond with this bond.
        Parameters:
        object - Object of type Bond
        Returns:
        Return true, if the bond is equal to this bond
      • isConnectedTo

        boolean isConnectedTo​(IBond bond)
        Checks whether a bond is connected to another one. This can only be true if the bonds have an Atom in common.
        Parameters:
        bond - The bond which is checked to be connect with this one
        Returns:
        True, if the bonds share an atom, otherwise false
      • isAromatic

        boolean isAromatic()
        Access whether this bond has been marked as aromatic. The default value is false and you must explicitly perceive aromaticity with one of the available models.
        Returns:
        aromatic status
        See Also:
        IChemObject.getFlag(int), Aromaticity
      • setIsAromatic

        void setIsAromatic​(boolean arom)
        Mark this bond as being aromatic.
        Parameters:
        arom - aromatic status
        See Also:
        IChemObject.setFlag(int, boolean)
      • isInRing

        boolean isInRing()
        Access whether this bond has been flagged as in a ring. The default value is false and you must explicitly find rings first.
        Returns:
        ring status
        See Also:
        IChemObject.getFlag(int), RingSearch