Package org.biojavax.bio.phylo.io.nexus
Class NexusFile
java.lang.Object
org.biojavax.bio.phylo.io.nexus.NexusFile
Represents Nexus files.
- Since:
- 1.6
- Author:
- Richard Holland, Tobias Thierer, Jim Balhoff
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addObject
(NexusObject object) Appends an object to the end of the file.Iterate over all blocks in the file in order.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.Iterate over all objects in the file in order.void
removeObject
(NexusObject object) Removes an object from the file.
-
Constructor Details
-
NexusFile
public NexusFile()
-
-
Method Details
-
addObject
Appends an object to the end of the file.- Parameters:
object
- the NexusObject to append.
-
insertObject
Inserts an object at the given position.- Parameters:
object
- the NexusObject to insert.pos
- the position (0-indexed) to add it at.
-
removeObject
Removes an object from the file.- Parameters:
object
- the NexusObject to remove.
-
containsObject
Checks to see if we contain an object.- Parameters:
object
- the NexusObject to check.- Returns:
- true if we contain it.
-
objectIterator
Iterate over all objects in the file in order.- Returns:
- an iterator of NexusObjects.
-
commentIterator
Iterate over all comments in the file in order.- Returns:
- an iterator of NexusComments.
-
blockIterator
Iterate over all blocks in the file in order.- Returns:
- an iterator of NexusBlocks.
-