/* * BioJava development code * * This code may be freely distributed and modified under the * terms of the GNU Lesser General Public Licence. This should * be distributed with the code. If you do not have a copy, * see: * * http://www.gnu.org/copyleft/lesser.html * * Copyright for this code is held jointly by the individual * authors. These should be listed in @author doc comments. * * For more information on the BioJava project and its aims, * or to join the biojava-l mailing list, visit the home page * at: * * http://www.biojava.org/ * */ package org.biojava.bio.seq.io; import java.io.PrintStream; import org.biojava.bio.seq.Feature; import org.biojava.bio.seq.StrandedFeature; import org.biojava.bio.symbol.Location; /** * Objects implementing the SeqFileFormer interface are * responsible for the detailed formatting of sequence data prior to * writing to a PrintStream. Some file formats, such as * Fasta, are very simple and don't require a * SeqFileFormer. * * @author Keith James * @since 1.2 * @deprecated Use org.biojavax.bio.seq.io framework instead */ public interface SeqFileFormer extends SeqIOListener { /** * getPrintStream returns the * PrintStream to which an instance will write the * formatted data. If this has not been set, an implementation * should default to System.out. * * @return the PrintStream which will be written to. */ public PrintStream getPrintStream(); /** * setPrintStream informs an instance which * PrintStream to use. * * @param stream a PrintStream to write to. */ public void setPrintStream(PrintStream stream); /** * formatLocation creates a String representation of * a Location. The strand may not be relevant for all * formats (e.g. it is relevant for Genbank and EMBL, but not for * SwissProt). In such cases the implementation may accept a * strand of 'unknown', '0' or '.'. A StringBuffer is * used to allow avoidance of expensive String * manipulations on (potentially very large numbers of) locations. * * @param sb a StringBuffer to append the location * to. * @param loc a Location to format. * @param strand a StrandedFeature.Strand indicating * any relevant strandedness. * * @return a StringBuffer with the location appended. */ public StringBuffer formatLocation(StringBuffer sb, Location loc, StrandedFeature.Strand strand); /** * Formats the location of a feature. This version is required when * formatting remote locations, since the location field of a remote * feature is the projection of that feature on the sequence. When a * distinction is made between 'order' and 'join' this method will likely * be extended for that also. * * @param theFeature The feature with the location to format * @return String The formatted location */ public String formatLocation(Feature theFeature); }