java.lang.Iterable<Tree>
, TreeImporter
public class NewickImporter extends java.lang.Object implements TreeImporter
Constructor | Description |
---|---|
NewickImporter(java.io.Reader reader,
boolean unquotedLabels) |
Constructor
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
hasTree() |
This can be used to read one tree at a time in a loop:
List
return whether another tree is available. |
Tree |
importNextTree() |
Import a single tree
|
java.util.List<Tree> |
importTrees() |
Import all the trees
|
java.util.Iterator<Tree> |
iterator() |
Returns an iterator over a set of elements of type T.
|
public NewickImporter(java.io.Reader reader, boolean unquotedLabels)
reader
- tree textunquotedLabels
- if true, try to read unqouted lables containing spacespublic java.util.Iterator<Tree> iterator()
iterator
in interface java.lang.Iterable<Tree>
public boolean hasTree() throws java.io.IOException, ImportException
TreeImporter
List trees = new ArrayList();
while (hasTree()) {
trees.add(importNextTree());
}
return whether another tree is available.hasTree
in interface TreeImporter
java.io.IOException
ImportException
public Tree importNextTree() throws java.io.IOException, ImportException
TreeImporter
importNextTree
in interface TreeImporter
java.io.IOException
ImportException
public java.util.List<Tree> importTrees() throws java.io.IOException, ImportException
TreeImporter
importTrees
in interface TreeImporter
java.io.IOException
ImportException
- Any type of tree is fine.http://code.google.com/p/jebl2/