Class LevelOrderTreeIterator

    • Constructor Summary

      Constructors 
      Constructor Description
      LevelOrderTreeIterator​(Phylogeny phylogeny)
      Creates a new LevelOrderTreeIterator for iterating over all the nodes of Phylogeny phylogeny
      LevelOrderTreeIterator​(PhylogenyNode node)
      Creates a new LevelOrderTreeIterator for iterating over all the child nodes of PhylogenyNode node (including node itself).
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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
      • Methods inherited from interface java.util.Iterator

        forEachRemaining
    • Constructor Detail

      • LevelOrderTreeIterator

        public LevelOrderTreeIterator​(Phylogeny phylogeny)
                               throws java.lang.IllegalArgumentException
        Creates a new LevelOrderTreeIterator for iterating over all the nodes of Phylogeny phylogeny
        Parameters:
        phylogeny - the Phylogeny to iterate over
        Throws:
        java.lang.IllegalArgumentException - if phylogeny is empty
      • LevelOrderTreeIterator

        public LevelOrderTreeIterator​(PhylogenyNode node)
        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 Detail

      • hasNext

        public boolean hasNext()
        Returns true is this iterator has at least one more element, false otherwise.
        Specified by:
        hasNext in interface java.util.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 java.util.NoSuchElementException
        Returns the next PhylogenyNode.
        Specified by:
        next in interface java.util.Iterator<PhylogenyNode>
        Specified by:
        next in interface PhylogenyNodeIterator
        Returns:
        the next PhylogenyNode
        Throws:
        java.util.NoSuchElementException - if iteration is complete
      • remove

        public void remove()
        Not supported.
        Specified by:
        remove in interface java.util.Iterator<PhylogenyNode>