The Octet Molecular Representation Framework v0.8.2

net.sf.octet.collection
Interface NucleusIterator


public interface NucleusIterator

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

 
 NucleusCollection nuclei = ...
 NucleusIterator it = nuclei.iterateNuclei();
 
 while (it.hasNext())
 {
   Nucleus nucleus = it.nextNucleus();
 }
 
 

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

Method Summary
 boolean hasNext()
          Returns true if the iterator has another Nucleus.
 Nucleus nextNucleus()
          Returns the next Nucleus.
 

Method Detail

hasNext

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

Returns:
true if another Nucleus is available, false otherwise

nextNucleus

public Nucleus nextNucleus()
Returns the next Nucleus.

Returns:
the next Nucleus
Throws:
NoSuchNucleusException - if this iterator has no more elements

The Octet Molecular Representation Framework v0.8.2