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 */ 021 022package org.biojava.bio.seq; 023 024import java.io.Serializable; 025 026/** 027 * Title: FramedFeature.<p> 028 * Description: An feature that includes the concept of frame 029 * by extending stranded.<p> 030 * Copyright: Copyright (c) 2001<p> 031 * @author Mark Schreiber 032 * @version 1.0 033 */ 034 035public interface FramedFeature extends StrandedFeature { 036 037 public static ReadingFrame FRAME_0 = new ReadingFrame("FRAME_0",Frame.FRAME_0); 038 public static ReadingFrame FRAME_1 = new ReadingFrame("FRAME_1",Frame.FRAME_1); 039 public static ReadingFrame FRAME_2 = new ReadingFrame("FRAME_2",Frame.FRAME_2); 040 041 /** 042 * return the reading frame of the feature. 043 */ 044 ReadingFrame getReadingFrame(); 045 046 /** 047 * @return the Strand that the feature is found on 048 */ 049 Strand getStrand(); 050 051 public static class Template extends StrandedFeature.Template{ 052 public ReadingFrame readingFrame; 053 } 054 055 /** 056 * A singleton to hold the frame information 057 */ 058 public static class ReadingFrame implements Frame, Serializable{ 059 private final String text; 060 private final int frame; 061 062 private ReadingFrame(String text,int frame){ 063 this.text = text; 064 this.frame = frame; 065 } 066 067 public String toString(){ 068 return text; 069 } 070 071 public int getFrame(){ 072 return frame; 073 } 074 } 075}