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 TypeMethodDescriptionboolean
hasTree()
This can be used to read one tree at a time in a loop:List
return 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, wait
Methods 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:TreeImporter
This can be used to read one tree at a time in a loop:List
return whether another tree is available.trees = new ArrayList (); while (hasTree()) { trees.add(importNextTree()); } - Specified by:
hasTree
in interfaceTreeImporter
- Throws:
IOException
ImportException
-
importNextTree
Description copied from interface:TreeImporter
Import a single tree- Specified by:
importNextTree
in interfaceTreeImporter
- Returns:
- the tree
- Throws:
IOException
ImportException
-
importTrees
Description copied from interface:TreeImporter
Import all the trees- Specified by:
importTrees
in interfaceTreeImporter
- Returns:
- the list of trees
- Throws:
IOException
ImportException
- Any type of tree is fine.
-