Package org.biojavax.bio.phylo.io.phylip
Class PHYLIPFileBuilder
- java.lang.Object
-
- 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
Constructors Constructor Description PHYLIPFileBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidendFile()Finished reading a file.AlignmentgetAlignment()voidreceiveSequence(String sequence)Receive sequence data for the current sequence.voidsetCurrentSequenceName(String name)Set the name of the sequence which is about to be received.voidsetSequenceCount(int count)Set the number of sequences in the alignment.voidsetSitesCount(int count)Set the number of sites in the alignmentvoidstartFile()About to start a new file.
-
-
-
Constructor Detail
-
PHYLIPFileBuilder
public PHYLIPFileBuilder()
-
-
Method Detail
-
startFile
public void startFile()
Description copied from interface:PHYLIPFileListenerAbout to start a new file.- Specified by:
startFilein interfacePHYLIPFileListener
-
endFile
public void endFile() throws ParseException
Description copied from interface:PHYLIPFileListenerFinished reading a file.- Specified by:
endFilein interfacePHYLIPFileListener- Throws:
ParseException
-
setSequenceCount
public void setSequenceCount(int count)
Description copied from interface:PHYLIPFileListenerSet the number of sequences in the alignment.- Specified by:
setSequenceCountin interfacePHYLIPFileListener- Parameters:
count- the expected number of sequences
-
setSitesCount
public void setSitesCount(int count)
Description copied from interface:PHYLIPFileListenerSet the number of sites in the alignment- Specified by:
setSitesCountin interfacePHYLIPFileListener- Parameters:
count- the expected number of sites
-
setCurrentSequenceName
public void setCurrentSequenceName(String name)
Description copied from interface:PHYLIPFileListenerSet 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:
setCurrentSequenceNamein interfacePHYLIPFileListener- Parameters:
name- the label for the current sequence
-
receiveSequence
public void receiveSequence(String sequence)
Description copied from interface:PHYLIPFileListenerReceive sequence data for the current sequence.- Specified by:
receiveSequencein interfacePHYLIPFileListener- Parameters:
sequence- sequence text for the current sequence
-
getAlignment
public Alignment getAlignment()
-
-