Class IteratorFactory.BondIterator

  • All Implemented Interfaces:
    Iterator<MolBond>
    Enclosing class:
    IteratorFactory

    public class IteratorFactory.BondIterator
    extends Object
    implements Iterator<MolBond>
    The BondIterator class provides an iterator to process the bonds of the specified molecule in this factory according to the bond related behavior of this factory.
    • Field Detail

      • secondaryBonds

        protected List<MolBond> secondaryBonds
        Secondary bonds that replace a coordinate bond to the multicenter with coordinate bonds from the metal to the represented atoms (in the MulticenterSgroup of the multicenter). These secondary bonds are not added to the molecule of the factory, so do not use Molecule.indexOf for the secondary bonds! In the future, secondary bonds may be implemented for other types of connections too.
    • Constructor Detail

      • BondIterator

        public BondIterator()
        Constructs an iterator to process the bonds of the specified molecule in this factory according to the bond related behavior of this factory.
    • Method Detail

      • getBond

        protected MolBond getBond​(int index)
        Returns a bond of a specified index.
        Parameters:
        index - the specified index of the bond
        Returns:
        the bond of the specified index
      • remove

        public void remove()
        Removes the next bond in the iteration. This method can be called only once per call to next.
        Specified by:
        remove in interface Iterator<MolBond>
        Throws:
        IllegalStateException - if the next method has not yet been called, or the remove method has already been called after the last call to the next method.
      • hasNext

        public boolean hasNext()
        Decides whether the iteration has more element.
        Specified by:
        hasNext in interface Iterator<MolBond>
        Returns:
        true if the iteration has more element, false otherwise.
      • nextBond

        @Deprecated
        public MolBond nextBond()
        Deprecated.
        As of Marvin 6.2, Use next() instead.
        Returns the next bond in the iteration.
        Returns:
        the next bond in the iteration