org.biojavax.bio.phylo.io.phylip
Class PHYLIPFileBuilder

java.lang.Object
  extended by org.biojavax.bio.phylo.io.phylip.PHYLIPFileBuilder
All Implemented Interfaces:
PHYLIPFileListener

public class PHYLIPFileBuilder
extends Object
implements PHYLIPFileListener

Builds a PHYLIP file by listening to events.

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

Constructor Summary
PHYLIPFileBuilder()
           
 
Method Summary
 void endFile()
          Finished reading a file.
 Alignment getAlignment()
           
 void receiveSequence(String sequence)
          Receive sequence data for the current sequence.
 void setCurrentSequenceName(String name)
          Set the name of the sequence which is about to be received.
 void setSequenceCount(int count)
          Set the number of sequences in the alignment.
 void setSitesCount(int count)
          Set the number of sites in the alignment
 void startFile()
          About to start a new file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PHYLIPFileBuilder

public PHYLIPFileBuilder()
Method Detail

startFile

public void startFile()
Description copied from interface: PHYLIPFileListener
About to start a new file.

Specified by:
startFile in interface PHYLIPFileListener

endFile

public void endFile()
             throws ParseException
Description copied from interface: PHYLIPFileListener
Finished reading a file.

Specified by:
endFile in interface PHYLIPFileListener
Throws:
ParseException

setSequenceCount

public void setSequenceCount(int count)
Description copied from interface: PHYLIPFileListener
Set the number of sequences in the alignment.

Specified by:
setSequenceCount in interface PHYLIPFileListener
Parameters:
count - the expected number of sequences

setSitesCount

public void setSitesCount(int count)
Description copied from interface: PHYLIPFileListener
Set the number of sites in the alignment

Specified by:
setSitesCount in interface PHYLIPFileListener
Parameters:
count - the expected number of sites

setCurrentSequenceName

public void setCurrentSequenceName(String name)
Description copied from interface: PHYLIPFileListener
Set the name of the sequence which is about to be received. If the name has already been seen, the sequence should be appended.

Specified by:
setCurrentSequenceName in interface PHYLIPFileListener
Parameters:
name - the label for the current sequence

receiveSequence

public void receiveSequence(String sequence)
Description copied from interface: PHYLIPFileListener
Receive sequence data for the current sequence.

Specified by:
receiveSequence in interface PHYLIPFileListener
Parameters:
sequence - sequence text for the current sequence

getAlignment

public Alignment getAlignment()