Class Ring

    • Constructor Detail

      • Ring

        public Ring()
        Constructs an empty ring.
      • Ring

        public Ring​(IAtomContainer atomContainer)
        Constructs a ring from the atoms in an IAtomContainer object.
        Parameters:
        atomContainer - The IAtomContainer object containing the atoms to form the ring
      • Ring

        public Ring​(int ringSize,
                    String elementSymbol)
        Constructs a ring that will have a certain number of atoms of the given elements.
        Parameters:
        ringSize - The number of atoms and bonds the ring will have
        elementSymbol - The element of the atoms the ring will have
      • Ring

        public Ring​(int ringSize)
        Constructs an empty ring that will have a certain size.
        Parameters:
        ringSize - The size (number of atoms) the ring will have
    • Method Detail

      • getRingSize

        public int getRingSize()
        Returns the number of atoms\edges in this ring.
        Specified by:
        getRingSize in interface IRing
        Returns:
        The number of atoms\edges in this ring
      • getNextBond

        public IBond getNextBond​(IBond bond,
                                 IAtom atom)
        Returns the next bond in order, relative to a given bond and atom. Example: Let the ring be composed of 0-1, 1-2, 2-3 and 3-0. A request getNextBond(1-2, 2) will return Bond 2-3.
        Specified by:
        getNextBond in interface IRing
        Parameters:
        bond - A bond for which an atom from a consecutive bond is sought
        atom - A atom from the bond above to assign a search direction
        Returns:
        The next bond in the order given by the above assignment
      • getBondOrderSum

        public int getBondOrderSum()
        Returns the sum of all bond orders in the ring.
        Specified by:
        getBondOrderSum in interface IRing
        Returns:
        the sum of all bond orders in the ring