Package jebl.evolution.io
Class NewickImporter
- java.lang.Object
-
- jebl.evolution.io.NewickImporter
-
- All Implemented Interfaces:
java.lang.Iterable<Tree>,TreeImporter
public class NewickImporter extends java.lang.Object implements TreeImporter
- Version:
- $Id: NewickImporter.java 967 2009-01-07 19:37:06Z matt_kearse $
- Author:
- Andrew Rambaut, Alexei Drummond
-
-
Constructor Summary
Constructors Constructor Description NewickImporter(java.io.Reader reader, boolean unquotedLabels)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasTree()This can be used to read one tree at a time in a loop:Listreturn whether another tree is available.trees = new ArrayList (); while (hasTree()) { trees.add(importNextTree()); } TreeimportNextTree()Import a single treejava.util.List<Tree>importTrees()Import all the treesjava.util.Iterator<Tree>iterator()Returns an iterator over a set of elements of type T.
-
-
-
Method Detail
-
iterator
public java.util.Iterator<Tree> iterator()
Returns an iterator over a set of elements of type T.- Specified by:
iteratorin interfacejava.lang.Iterable<Tree>- Returns:
- an Iterator.
-
hasTree
public boolean hasTree() throws java.io.IOException, ImportExceptionDescription copied from interface:TreeImporterThis can be used to read one tree at a time in a loop:Listreturn whether another tree is available.trees = new ArrayList (); while (hasTree()) { trees.add(importNextTree()); } - Specified by:
hasTreein interfaceTreeImporter- Throws:
java.io.IOExceptionImportException
-
importNextTree
public Tree importNextTree() throws java.io.IOException, ImportException
Description copied from interface:TreeImporterImport a single tree- Specified by:
importNextTreein interfaceTreeImporter- Returns:
- the tree
- Throws:
java.io.IOExceptionImportException
-
importTrees
public java.util.List<Tree> importTrees() throws java.io.IOException, ImportException
Description copied from interface:TreeImporterImport all the trees- Specified by:
importTreesin interfaceTreeImporter- Returns:
- the list of trees
- Throws:
java.io.IOExceptionImportException- Any type of tree is fine.
-
-