org.biojava.bio.seq.io
Class ProteinRefSeqFileFormer

java.lang.Object
  extended byorg.biojava.bio.seq.io.AbstractGenEmblFileFormer
      extended byorg.biojava.bio.seq.io.GenbankFileFormer
          extended byorg.biojava.bio.seq.io.ProteinRefSeqFileFormer
All Implemented Interfaces:
SeqFileFormer, SeqIOListener

public class ProteinRefSeqFileFormer
extends GenbankFileFormer

This class performs the detailed formatting of refseq protein entries. Functionality is essentially identical to GenbankFileFormer except that SimpleFeatures are created intead of StrandedFeatures

Author:
Greg Cox

Constructor Summary
protected ProteinRefSeqFileFormer()
           
protected ProteinRefSeqFileFormer(java.io.PrintStream theStream)
           
 
Method Summary
 void addSymbols(Alphabet theAlphabet, Symbol[] theSymbols, int theStart, int theLength)
          Notify the listener of symbol data.
protected  java.util.List breakSymbolArray(Alphabet theAlphabet, Symbol[] theSymbols, int theStart, int theLength)
          Converts the symbol list passed in into an array of strings.
 void startFeature(Feature.Template templ)
          Notify the listener that a new feature object is starting.
 
Methods inherited from class org.biojava.bio.seq.io.GenbankFileFormer
addFeatureProperty, addSequenceProperty, endFeature, endSequence, formatLocation, formatLocation, formatLocation, getPrintStream, getVectorNTISupport, setName, setPrintStream, setURI, setVectorNTISupport, startSequence
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.biojava.bio.seq.io.SeqFileFormer
formatLocation, formatLocation
 

Constructor Detail

ProteinRefSeqFileFormer

protected ProteinRefSeqFileFormer()

ProteinRefSeqFileFormer

protected ProteinRefSeqFileFormer(java.io.PrintStream theStream)
Method Detail

addSymbols

public void addSymbols(Alphabet theAlphabet,
                       Symbol[] theSymbols,
                       int theStart,
                       int theLength)
                throws IllegalAlphabetException
Description copied from interface: SeqIOListener
Notify the listener of symbol data. All symbols passed to this method are guarenteed to be contained within the specified alphabet. Generally all calls to a given Listener should have the same alphabet -- if not, the listener implementation is likely to throw an exception

Specified by:
addSymbols in interface SeqIOListener
Overrides:
addSymbols in class GenbankFileFormer
Throws:
IllegalAlphabetException

startFeature

public void startFeature(Feature.Template templ)
                  throws ParseException
Description copied from interface: SeqIOListener
Notify the listener that a new feature object is starting. Every call to startFeature should have a corresponding call to endFeature. If the listener is concerned with a hierarchy of features, it should maintain a stack of `open' features.

Specified by:
startFeature in interface SeqIOListener
Overrides:
startFeature in class GenbankFileFormer
Throws:
ParseException

breakSymbolArray

protected java.util.List breakSymbolArray(Alphabet theAlphabet,
                                          Symbol[] theSymbols,
                                          int theStart,
                                          int theLength)
                                   throws IllegalAlphabetException
Converts the symbol list passed in into an array of strings. The strings will be blocks of ten, with six blocks on a line.

Parameters:
theAlphabet - The alphabet of the symbol data
theSymbols - An array containing symbols
theStart - The start offset of valid data within the array
theLength - The number of valid symbols in the array
Returns:
The symbol list passed in broken into blocks of ten characters, six to a string.
Throws:
IllegalAlphabetException - if we can't cope with this alphabet.