001/*
002
003 *                    BioJava development code
004
005 *
006
007 * This code may be freely distributed and modified under the
008
009 * terms of the GNU Lesser General Public Licence.  This should
010
011 * be distributed with the code.  If you do not have a copy,
012
013 * see:
014
015 *
016
017 *      http://www.gnu.org/copyleft/lesser.html
018
019 *
020
021 * Copyright for this code is held jointly by the individual
022
023 * authors.  These should be listed in @author doc comments.
024
025 *
026
027 * For more information on the BioJava project and its aims,
028
029 * or to join the biojava-l mailing list, visit the home page
030
031 * at:
032
033 *
034
035 *      http://www.biojava.org/
036
037 *
038
039 */
040
041package org.biojava.bio.seq.io.agave;
042
043
044
045/**
046
047 * match_region
048
049 *
050
051 * @author Hanning Ni    Doubletwist Inc
052  * @author Greg Cox
053
054 */
055
056public class AGAVEMatchRegion
057
058{
059
060    private int start ;
061
062    private int end ;
063
064    private String element_id ;
065
066    private AGAVEDbId db_id ;
067
068
069
070    //ignore bio_sequence
071
072
073
074    public void setStart(int start)
075
076    {
077
078        this.start = start ;
079
080    }
081
082
083
084    public void setEnd(int end)
085
086    {
087
088        this.end = end ;
089
090    }
091
092    public void setElementId(String id)
093
094    {
095
096        this.element_id = id ;
097
098    }
099
100    public void setDbId(AGAVEDbId id)
101
102    {
103
104        this.db_id = id ;
105
106    }
107
108
109
110    public int getStart()
111
112    {
113
114        return start ;
115
116    }
117
118    public int getEnd()
119
120    {
121
122        return end ;
123
124    }
125
126    public String getElementId()
127
128    {
129
130        return element_id ;
131
132    }
133
134    public AGAVEDbId getDbId()
135
136    {
137
138        return db_id ;
139
140    }
141
142
143
144    public String toString(String indent, String indent_unit)
145
146    {
147
148        StringBuffer sb = new StringBuffer();
149
150        sb.append(indent + "<match_region start=\"" + start + "\" end=\"" + end +"\">" + "\n" ) ;
151
152        sb.append( indent + indent_unit + "<element_id id=\"" + element_id + "\"/>" + "\n" );
153
154        if( db_id != null )
155
156           sb.append( db_id.toString( indent + indent_unit, indent_unit)) ;
157
158        sb.append( indent + "</match_region>" + "\n" ) ;
159
160        return  sb.substring(0) ;
161
162    }
163
164    public String toString()
165
166    {
167
168        return "<match_region start=\"" + start + "\" end=\"" + end +"\">" + "\n"
169
170               + "<element_id id=\"" + element_id + "\"/>" + "\n"
171
172               + db_id + "\n"
173
174               + "</match_region>" + "\n" ;
175
176    }
177
178}
179