001/*
002 *                    BioJava development code
003 *
004 * This code may be freely distributed and modified under the
005 * terms of the GNU Lesser General Public Licence.  This should
006 * be distributed with the code.  If you do not have a copy,
007 * see:
008 *
009 *      http://www.gnu.org/copyleft/lesser.html
010 *
011 * Copyright for this code is held jointly by the individual
012 * authors.  These should be listed in @author doc comments.
013 *
014 * For more information on the BioJava project and its aims,
015 * or to join the biojava-l mailing list, visit the home page
016 * at:
017 *
018 *      http://www.biojava.org/
019 *
020 */
021package org.biojavax.bio.phylo.io.phylip;
022
023import org.biojava.bio.seq.io.ParseException;
024
025/**
026 * Listens to events fired by the PHYLIP parser. Use these events to handle data
027 * directly or construct objects.
028 * 
029 * @author Richard Holland
030 * @author Tobias Thierer
031 * @author Jim Balhoff
032 * @since 1.6
033 */
034
035public interface PHYLIPFileListener {
036  
037  /**
038   * About to start a new file.
039   */
040  public void startFile();
041
042  /**
043   * Finished reading a file.
044   */
045  public void endFile() throws ParseException;
046
047  /**
048   * Set the number of sequences in the alignment.
049   * 
050   * @param count
051   *        the expected number of sequences
052   */
053  public void setSequenceCount(int count);
054  
055  /**
056   * Set the number of sites in the alignment
057   * 
058   * @param count
059   *        the expected number of sites
060   */
061  public void setSitesCount(int count);
062  
063  /**
064   * Set the name of the sequence which is about to be received.  If the name has already
065   * been seen, the sequence should be appended.
066   * 
067   * @param name
068   *        the label for the current sequence
069   */
070  public void setCurrentSequenceName(String name);
071  
072  /**
073   * Receive sequence data for the current sequence.
074   * 
075   * @param sequence
076   *        sequence text for the current sequence
077   */
078  public void receiveSequence(String sequence);
079
080}