# Interface TreeImporter

All Superinterfaces:
  `Iterable<Tree>`

All Known Implementing Classes:
  `NewickImporter, NexusImporter`

public interface TreeImporter extends Iterable<Tree>
Interface for importers that do trees

Version:
  $Id: TreeImporter.java 301 2006-04-17 15:35:01Z rambaut $
Author:
  Andrew Rambaut, Alexei Drummond

## Method Summary

Modifier and Type
Method
Description
`boolean`
`hasTree()`
This can be used to read one tree at a time in a loop: `List<Tree> trees = new ArrayList<Tree>(); 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 Iterable

`forEach, iterator, spliterator`

## Method Details

### hasTree

boolean hasTree() throws IOException, ImportException
This can be used to read one tree at a time in a loop: `List<Tree> trees = new ArrayList<Tree>(); 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.