27806ffdd1edc6ac81ef539a5cf628eb6d63c3f6
[jalview.git] / src / jalview / datamodel / xdb / embl / Qualifier.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4)
3  * Copyright (C) 2008 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
4  * 
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.
9  * 
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  * 
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
18  */
19 package jalview.datamodel.xdb.embl;
20
21 public class Qualifier
22 {
23   String name;
24
25   String[] values;
26
27   String[] evidence;
28
29   /**
30    * @return the name
31    */
32   public String getName()
33   {
34     return name;
35   }
36
37   /**
38    * @param name
39    *                the name to set
40    */
41   public void setName(String name)
42   {
43     this.name = name;
44   }
45
46   /**
47    * @return the values
48    */
49   public String[] getValues()
50   {
51     return values;
52   }
53
54   /**
55    * @param values
56    *                the values to set
57    */
58   public void setValues(String[] values)
59   {
60     this.values = values;
61   }
62
63   public void addEvidence(String qevidence)
64   {
65     if (evidence == null)
66     {
67       evidence = new String[1];
68     }
69     else
70     {
71       String[] temp = new String[evidence.length + 1];
72       System.arraycopy(evidence, 0, temp, 0, evidence.length);
73       evidence = temp;
74     }
75     evidence[evidence.length - 1] = qevidence;
76   }
77
78   public void addValues(String value)
79   {
80     if (values == null)
81     {
82       values = new String[1];
83     }
84     else
85     {
86       String[] temp = new String[values.length + 1];
87       System.arraycopy(values, 0, temp, 0, values.length);
88       values = temp;
89     }
90     values[values.length - 1] = value;
91   }
92
93   /**
94    * @return the evidence
95    */
96   public String[] getEvidence()
97   {
98     return evidence;
99   }
100
101   /**
102    * @param evidence
103    *                the evidence to set
104    */
105   public void setEvidence(String[] evidence)
106   {
107     this.evidence = evidence;
108   }
109 }