jebl.evolution.io
Interface TreeImporter

All Superinterfaces:
Iterable<Tree>
All Known Implementing Classes:
NewickImporter, NexusImporter

public interface TreeImporter
extends Iterable<Tree>

Interface for importers that do trees

Author:
Andrew Rambaut, Alexei Drummond

Method Summary
 boolean hasTree()
          This can be used to read one tree at a time in a loop: List trees = new ArrayList(); while (hasTree()) { trees.add(importNextTree()); } return whether another tree is available.
 Tree importNextTree()
          Import a single tree
 List<Tree> importTrees()
          Import all the trees
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

hasTree

boolean hasTree()
                throws IOException,
                       ImportException
This can be used to read one tree at a time in a loop: List trees = new ArrayList(); while (hasTree()) { trees.add(importNextTree()); } return whether another tree is available.

Throws:
IOException
ImportException

importNextTree

Tree importNextTree()
                    throws IOException,
                           ImportException
Import a single tree

Returns:
the tree
Throws:
IOException
ImportException

importTrees

List<Tree> importTrees()
                       throws IOException,
                              ImportException
Import all the trees

Returns:
the list of trees
Throws:
IOException
ImportException - Any type of tree is fine.