Package org.forester.phylogeny.iterators
Class LevelOrderTreeIterator
java.lang.Object
org.forester.phylogeny.iterators.LevelOrderTreeIterator
- All Implemented Interfaces:
 Iterator<PhylogenyNode>,PhylogenyNodeIterator
- 
Constructor Summary
ConstructorsConstructorDescriptionLevelOrderTreeIterator(Phylogeny phylogeny) Creates a new LevelOrderTreeIterator for iterating over all the nodes of Phylogeny phylogenyCreates a new LevelOrderTreeIterator for iterating over all the child nodes of PhylogenyNode node (including node itself). - 
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining 
- 
Constructor Details
- 
LevelOrderTreeIterator
Creates a new LevelOrderTreeIterator for iterating over all the nodes of Phylogeny phylogeny- Parameters:
 phylogeny- the Phylogeny to iterate over- Throws:
 IllegalArgumentException- if phylogeny is empty
 - 
LevelOrderTreeIterator
Creates a new LevelOrderTreeIterator for iterating over all the child nodes of PhylogenyNode node (including node itself).- Parameters:
 node- the parent of the nodes to iterate over
 
 - 
 - 
Method Details
- 
hasNext
public boolean hasNext()Returns true is this iterator has at least one more element, false otherwise.- Specified by:
 hasNextin interfaceIterator<PhylogenyNode>- Specified by:
 hasNextin interfacePhylogenyNodeIterator- Returns:
 - true is this iterator has at least one more element, false otherwise
 
 - 
next
Returns the next PhylogenyNode.- Specified by:
 nextin interfaceIterator<PhylogenyNode>- Specified by:
 nextin interfacePhylogenyNodeIterator- Returns:
 - the next PhylogenyNode
 - Throws:
 NoSuchElementException- if iteration is complete
 - 
remove
public void remove()Not supported.- Specified by:
 removein interfaceIterator<PhylogenyNode>
 - 
reset
public void reset()Resets the iterator.- Specified by:
 resetin interfacePhylogenyNodeIterator
 
 -