JAL-1432 updated copyright notices
[jalview.git] / src / vamsas / objects / simple / Sequence.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
3  * Copyright (C) 2014 The Jalview Authors
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  * The Jalview Authors are detailed in the 'AUTHORS' file.
18  */
19 package vamsas.objects.simple;
20
21 public class Sequence implements java.io.Serializable
22 {
23   private java.lang.String id;
24
25   private java.lang.String seq;
26
27   public Sequence()
28   {
29   }
30
31   public Sequence(java.lang.String id, java.lang.String seq)
32   {
33     this.id = id;
34     this.seq = seq;
35   }
36
37   /**
38    * Gets the id value for this Sequence.
39    * 
40    * @return id
41    */
42   public java.lang.String getId()
43   {
44     return id;
45   }
46
47   /**
48    * Sets the id value for this Sequence.
49    * 
50    * @param id
51    */
52   public void setId(java.lang.String id)
53   {
54     this.id = id;
55   }
56
57   /**
58    * Gets the seq value for this Sequence.
59    * 
60    * @return seq
61    */
62   public java.lang.String getSeq()
63   {
64     return seq;
65   }
66
67   /**
68    * Sets the seq value for this Sequence.
69    * 
70    * @param seq
71    */
72   public void setSeq(java.lang.String seq)
73   {
74     this.seq = seq;
75   }
76
77   private java.lang.Object __equalsCalc = null;
78
79   public synchronized boolean equals(java.lang.Object obj)
80   {
81     if (!(obj instanceof Sequence))
82       return false;
83     Sequence other = (Sequence) obj;
84     if (obj == null)
85       return false;
86     if (this == obj)
87       return true;
88     if (__equalsCalc != null)
89     {
90       return (__equalsCalc == obj);
91     }
92     __equalsCalc = obj;
93     boolean _equals;
94     _equals = true
95             && ((this.id == null && other.getId() == null) || (this.id != null && this.id
96                     .equals(other.getId())))
97             && ((this.seq == null && other.getSeq() == null) || (this.seq != null && this.seq
98                     .equals(other.getSeq())));
99     __equalsCalc = null;
100     return _equals;
101   }
102
103   private boolean __hashCodeCalc = false;
104
105   public synchronized int hashCode()
106   {
107     if (__hashCodeCalc)
108     {
109       return 0;
110     }
111     __hashCodeCalc = true;
112     int _hashCode = 1;
113     if (getId() != null)
114     {
115       _hashCode += getId().hashCode();
116     }
117     if (getSeq() != null)
118     {
119       _hashCode += getSeq().hashCode();
120     }
121     __hashCodeCalc = false;
122     return _hashCode;
123   }
124
125 }