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 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 alignmentvoid
startFile()
About to start a new file.
-
-
-
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 interfacePHYLIPFileListener
-
endFile
public void endFile() throws ParseException
Description copied from interface:PHYLIPFileListener
Finished reading a file.- Specified by:
endFile
in interfacePHYLIPFileListener
- 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 interfacePHYLIPFileListener
- 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 interfacePHYLIPFileListener
- 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 interfacePHYLIPFileListener
- 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 interfacePHYLIPFileListener
- Parameters:
sequence
- sequence text for the current sequence
-
getAlignment
public Alignment getAlignment()
-
-