update author list in license for (JAL-826)
[jalview.git] / src / vamsas / objects / simple / Sequence.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
3  * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
4  * 
5  * This file is part of Jalview.
6  * 
7  * Jalview is free software: you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License 
9  * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
10  * 
11  * Jalview is distributed in the hope that it will be useful, but 
12  * WITHOUT ANY WARRANTY; without even the implied warranty 
13  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
14  * PURPOSE.  See the GNU General Public License for more details.
15  * 
16  * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
17  */
18 package vamsas.objects.simple;
19
20 public class Sequence implements java.io.Serializable
21 {
22   private java.lang.String id;
23
24   private java.lang.String seq;
25
26   public Sequence()
27   {
28   }
29
30   public Sequence(java.lang.String id, java.lang.String seq)
31   {
32     this.id = id;
33     this.seq = seq;
34   }
35
36   /**
37    * Gets the id value for this Sequence.
38    * 
39    * @return id
40    */
41   public java.lang.String getId()
42   {
43     return id;
44   }
45
46   /**
47    * Sets the id value for this Sequence.
48    * 
49    * @param id
50    */
51   public void setId(java.lang.String id)
52   {
53     this.id = id;
54   }
55
56   /**
57    * Gets the seq value for this Sequence.
58    * 
59    * @return seq
60    */
61   public java.lang.String getSeq()
62   {
63     return seq;
64   }
65
66   /**
67    * Sets the seq value for this Sequence.
68    * 
69    * @param seq
70    */
71   public void setSeq(java.lang.String seq)
72   {
73     this.seq = seq;
74   }
75
76   private java.lang.Object __equalsCalc = null;
77
78   public synchronized boolean equals(java.lang.Object obj)
79   {
80     if (!(obj instanceof Sequence))
81       return false;
82     Sequence other = (Sequence) obj;
83     if (obj == null)
84       return false;
85     if (this == obj)
86       return true;
87     if (__equalsCalc != null)
88     {
89       return (__equalsCalc == obj);
90     }
91     __equalsCalc = obj;
92     boolean _equals;
93     _equals = true
94             && ((this.id == null && other.getId() == null) || (this.id != null && this.id
95                     .equals(other.getId())))
96             && ((this.seq == null && other.getSeq() == null) || (this.seq != null && this.seq
97                     .equals(other.getSeq())));
98     __equalsCalc = null;
99     return _equals;
100   }
101
102   private boolean __hashCodeCalc = false;
103
104   public synchronized int hashCode()
105   {
106     if (__hashCodeCalc)
107     {
108       return 0;
109     }
110     __hashCodeCalc = true;
111     int _hashCode = 1;
112     if (getId() != null)
113     {
114       _hashCode += getId().hashCode();
115     }
116     if (getSeq() != null)
117     {
118       _hashCode += getSeq().hashCode();
119     }
120     __hashCodeCalc = false;
121     return _hashCode;
122   }
123
124 }