The Octet Molecular Representation Framework v0.8.2

net.sf.octet.collection
Interface AtomIterator


public interface AtomIterator

An iterator for an AtomCollection. The code fragment below illustrates a typical use:

 
 AtomCollection atoms = ...
 AtomIterator it = atoms.iterateAtoms();
 
 while (it.hasNext())
 {
   Atom atom = it.nextAtom();
 }
 
 

Author:
Richard Apodaca
See Also:
"Iterator Pattern [GoF95]"

Method Summary
 boolean hasNext()
          Returns true if the iterator has another Atom.
 Atom nextAtom()
          Returns the next Atom.
 

Method Detail

hasNext

public boolean hasNext()
Returns true if the iterator has another Atom.

Returns:
true if another Atom is available, false otherwise

nextAtom

public Atom nextAtom()
Returns the next Atom.

Returns:
the next Atom
Throws:
NoSuchElementException - if this iterator has no more elements

The Octet Molecular Representation Framework v0.8.2