## org.biojavax.bio.phylo.io.nexus
Class NexusFile

    java.lang.Object
      org.biojavax.bio.phylo.io.nexus.NexusFile

    public class NexusFile

extends Object

Represents Nexus files.

Since:
  1.6
Author:
  Richard Holland, Tobias Thierer, Jim Balhoff

Constructor Summary
`NexusFile()`

Method Summary
`void` `addObject(NexusObject object)` Appends an object to the end of the file.
`Iterator` `blockIterator()` Iterate over all blocks in the file in order.
`Iterator` `commentIterator()` Iterate over all comments in the file in order.
`boolean` `containsObject(NexusObject object)` Checks to see if we contain an object.
`void` `insertObject(NexusObject object, int pos)` Inserts an object at the given position.
`Iterator` `objectIterator()` Iterate over all objects in the file in order.
`void` `removeObject(NexusObject object)` Removes an object from the file.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### NexusFile

    public NexusFile()

Method Detail

### addObject

    public void addObject(NexusObject object)

  Appends an object to the end of the file.

  Parameters:
    `object` - the NexusObject to append.

### insertObject

    public void insertObject(NexusObject object,
                             int pos)

  Inserts an object at the given position.

  Parameters:
    `object` - the NexusObject to insert.
    `pos` - the position (0-indexed) to add it at.

### removeObject

    public void removeObject(NexusObject object)

  Removes an object from the file.

  Parameters:
    `object` - the NexusObject to remove.

### containsObject

    public boolean containsObject(NexusObject object)

  Checks to see if we contain an object.

  Parameters:
    `object` - the NexusObject to check.
  Returns:
    `true` if we contain it.

### objectIterator

    public Iterator objectIterator()

  Iterate over all objects in the file in order.

  Returns:
    an iterator of NexusObjects.

### commentIterator

    public Iterator commentIterator()

  Iterate over all comments in the file in order.

  Returns:
    an iterator of NexusComments.

### blockIterator

    public Iterator blockIterator()

  Iterate over all blocks in the file in order.

  Returns:
    an iterator of NexusBlocks.