Package jebl.evolution.io

# Class NexusExporter

java.lang.Object
jebl.evolution.io.NexusExporter

All Implemented Interfaces:
  `AlignmentExporter`, `SequenceExporter`, `TreeExporter`

public class NexusExporter extends Object implements AlignmentExporter, SequenceExporter, TreeExporter
Export sequences and trees to Nexus format.

Version:
  $Id: NexusExporter.java 1060 2010-06-01 08:52:55Z rambaut $
Author:
  Andrew Rambaut, Alexei Drummond, Joseph Heled

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String[]`
`exportExcludeKeys`
`static final int`
`MAX_ROW_LENGTH`
`static final String`
`treeNameAttributeKey`

## Constructor Summary

Constructors
Constructor
Description
`NexusExporter(Writer writer)`
`NexusExporter(Writer writer, boolean writeMetaComments)`
`NexusExporter(Writer writer, boolean writeMetaComments, boolean interleave)`

## Method Summary

Modifier and Type
Method
Description
`void`
`close()`
`void`
`closeBlock()`
close an existing open trees block
`void`
`exportAlignment(Alignment alignment)`
exportAlignment.
`void`
`exportMatrix(DistanceMatrix distanceMatrix)`
`void`
`exportSequences(Collection<? extends Sequence> sequences)`
export alignment.
`void`
`exportTree(Tree tree)`
Export a single tree
`void`
`exportTrees(Collection<? extends Tree> trees)`
Export a collection of trees
`void`
`exportTrees(Collection<? extends Tree> trees, boolean writeTaxa)`
`void`
`exportTreesWithTranslation(Collection<? extends Tree> trees, Map<String,String> translationMap)`
`static boolean`
`isGeneratedTreeName(String name)`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### treeNameAttributeKey

public static final String treeNameAttributeKey

See Also:
  - Constant Field Values

### exportExcludeKeys

public static final String[] exportExcludeKeys

### MAX_ROW_LENGTH

public static final int MAX_ROW_LENGTH

See Also:
  - Constant Field Values

## Constructor Details

### NexusExporter

public NexusExporter(Writer writer)

### NexusExporter

public NexusExporter(Writer writer, boolean writeMetaComments)

Parameters:
  `writer` - where export text goes

### NexusExporter

public NexusExporter(Writer writer, boolean writeMetaComments, boolean interleave)

Parameters:
  `writer` - where export text goes

## Method Details

### exportAlignment

public void exportAlignment(Alignment alignment)
exportAlignment.

Specified by:
  `exportAlignment` in interface `AlignmentExporter`
Parameters:
  `alignment` - to export

### exportSequences

public void exportSequences(Collection<? extends Sequence> sequences) throws IllegalArgumentException
export alignment.

Specified by:
  `exportSequences` in interface `SequenceExporter`
Throws:
  `IllegalArgumentException`

### closeBlock

public void closeBlock()
close an existing open trees block

### exportTree

public void exportTree(Tree tree)
Export a single tree

Specified by:
  `exportTree` in interface `TreeExporter`
Parameters:
  `tree` -
Throws:
  `IOException`

### exportTrees

public void exportTrees(Collection<? extends Tree> trees)
Description copied from interface: `TreeExporter`
Export a collection of trees

Specified by:
  `exportTrees` in interface `TreeExporter`
Parameters:
  `trees` -

### exportTrees

public void exportTrees(Collection<? extends Tree> trees, boolean writeTaxa)

### exportTreesWithTranslation

public void exportTreesWithTranslation(Collection<? extends Tree> trees, Map<String,String> translationMap) throws IOException

Throws:
  `IOException`

### close

public void close()

Specified by:
  `close` in interface `TreeExporter`

### exportMatrix

public void exportMatrix(DistanceMatrix distanceMatrix)

### isGeneratedTreeName

public static boolean isGeneratedTreeName(String name)