Class AtomIterator

java.lang.Object
org.biojava.nbio.structure.AtomIterator
All Implemented Interfaces:
Iterator<Atom>

public class AtomIterator extends Object implements Iterator<Atom>
an iterator over all atoms of a structure / group.
Since:
1.4
Version:
%I% %G%
Author:
Andreas Prlic
  • Constructor Details

    • AtomIterator

      public AtomIterator(Structure struct)
      Constructs an AtomIterator object.
      Parameters:
      struct - a Structure object
    • AtomIterator

      public AtomIterator(Group g)
      Constructs an AtomIterator object.
      Parameters:
      g - a Group object
  • Method Details

    • getCurrentChain

      public Chain getCurrentChain()
      Get the chain that contains the current atom.
      Returns:
      a Chain object
    • getCurrentModel

      public int getCurrentModel()
      Get the model number of the model containing the current atom.
      Returns:
      the number of the model
    • hasNext

      public boolean hasNext()
      Is there a next atom ?
      Specified by:
      hasNext in interface Iterator<Atom>
      Returns:
      true if there is an atom after the current one
    • next

      public Atom next() throws NoSuchElementException
      Return next atom.
      Specified by:
      next in interface Iterator<Atom>
      Returns:
      the next Atom
      Throws:
      NoSuchElementException - if there is no atom after the current one
    • remove

      public void remove()
      does nothing.
      Specified by:
      remove in interface Iterator<Atom>