Package jebl.evolution.io
Class NewickImporter
java.lang.Object
jebl.evolution.io.NewickImporter
- All Implemented Interfaces:
Iterable<Tree>,TreeImporter
- Version:
- $Id: NewickImporter.java 967 2009-01-07 19:37:06Z matt_kearse $
- Author:
- Andrew Rambaut, Alexei Drummond
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanhasTree()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()); } Import a single treeImport all the treesiterator()Returns an iterator over a set of elements of type T.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
NewickImporter
Constructor- Parameters:
reader- tree textunquotedLabels- if true, try to read unqouted lables containing spaces
-
-
Method Details
-
iterator
Returns an iterator over a set of elements of type T. -
hasTree
Description 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:
IOExceptionImportException
-
importNextTree
Description copied from interface:TreeImporterImport a single tree- Specified by:
importNextTreein interfaceTreeImporter- Returns:
- the tree
- Throws:
IOExceptionImportException
-
importTrees
Description copied from interface:TreeImporterImport all the trees- Specified by:
importTreesin interfaceTreeImporter- Returns:
- the list of trees
- Throws:
IOExceptionImportException- Any type of tree is fine.
-