org.forester.phylogeny.iterators
Class ChildNodeIteratorForward

java.lang.Object
  extended by org.forester.phylogeny.iterators.ChildNodeIteratorForward
All Implemented Interfaces:
Iterator<PhylogenyNode>, PhylogenyNodeIterator

public class ChildNodeIteratorForward
extends Object
implements PhylogenyNodeIterator


Constructor Summary
ChildNodeIteratorForward(PhylogenyNode node)
          Creates a new ChildNodeIteratorForward.
 
Method Summary
 boolean hasNext()
          Returns true is this iterator has at least one more element, false otherwise.
 PhylogenyNode next()
          Returns the next PhylogenyNode.
 void remove()
          Not supported.
 void reset()
          Resets the iterator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChildNodeIteratorForward

public ChildNodeIteratorForward(PhylogenyNode node)
                         throws IllegalArgumentException
Creates a new ChildNodeIteratorForward.

Parameters:
node - the parent of the PhylogenyNodes to iterate over.
Throws:
IllegalArgumentException - if node has no child nodes
Method Detail

hasNext

public boolean hasNext()
Returns true is this iterator has at least one more element, false otherwise.

Specified by:
hasNext in interface Iterator<PhylogenyNode>
Specified by:
hasNext in interface PhylogenyNodeIterator
Returns:
true is this iterator has at least one more element, false otherwise

next

public PhylogenyNode next()
                   throws NoSuchElementException
Returns the next PhylogenyNode.

Specified by:
next in interface Iterator<PhylogenyNode>
Specified by:
next in interface PhylogenyNodeIterator
Returns:
the next PhylogenyNode
Throws:
NoSuchElementException - if iteration is complete

remove

public void remove()
Not supported.

Specified by:
remove in interface Iterator<PhylogenyNode>

reset

public void reset()
Resets the iterator.

Specified by:
reset in interface PhylogenyNodeIterator