JAL-3438 spotless for 2.11.2.0
[jalview.git] / src / vamsas / objects / simple / SequenceSet.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3  * Copyright (C) $$Year-Rel$$ 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
10  * of the License, or (at your option) any later version.
11  *  
12  * Jalview is distributed in the hope that it will be useful, but 
13  * WITHOUT ANY WARRANTY; without even the implied warranty 
14  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
15  * PURPOSE.  See the GNU General Public License for more details.
16  * 
17  * You should have received a copy of the GNU General Public License
18  * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
19  * The Jalview Authors are detailed in the 'AUTHORS' file.
20  */
21 package vamsas.objects.simple;
22
23 public class SequenceSet implements java.io.Serializable
24 {
25   private vamsas.objects.simple.Sequence[] seqs;
26
27   public SequenceSet()
28   {
29   }
30
31   public SequenceSet(vamsas.objects.simple.Sequence[] seqs)
32   {
33     this.seqs = seqs;
34   }
35
36   /**
37    * Gets the seqs value for this SequenceSet.
38    * 
39    * @return seqs
40    */
41   public vamsas.objects.simple.Sequence[] getSeqs()
42   {
43     return seqs;
44   }
45
46   /**
47    * Sets the seqs value for this SequenceSet.
48    * 
49    * @param seqs
50    */
51   public void setSeqs(vamsas.objects.simple.Sequence[] seqs)
52   {
53     this.seqs = seqs;
54   }
55
56   private java.lang.Object __equalsCalc = null;
57
58   @Override
59   public synchronized boolean equals(java.lang.Object obj)
60   {
61     if (obj == null)
62     {
63       return false;
64     }
65     if (!(obj instanceof SequenceSet))
66     {
67       return false;
68     }
69     SequenceSet other = (SequenceSet) obj;
70     if (this == obj)
71     {
72       return true;
73     }
74     if (__equalsCalc != null)
75     {
76       return (__equalsCalc == obj);
77     }
78     __equalsCalc = obj;
79     boolean _equals;
80     _equals = true && ((this.seqs == null && other.getSeqs() == null)
81             || (this.seqs != null && java.util.Arrays.equals(this.seqs,
82                     other.getSeqs())));
83     __equalsCalc = null;
84     return _equals;
85   }
86
87   private boolean __hashCodeCalc = false;
88
89   @Override
90   public synchronized int hashCode()
91   {
92     if (__hashCodeCalc)
93     {
94       return 0;
95     }
96     __hashCodeCalc = true;
97     int _hashCode = 1;
98     if (getSeqs() != null)
99     {
100       for (int i = 0; i < java.lang.reflect.Array.getLength(getSeqs()); i++)
101       {
102         java.lang.Object obj = java.lang.reflect.Array.get(getSeqs(), i);
103         if (obj != null && !obj.getClass().isArray())
104         {
105           _hashCode += obj.hashCode();
106         }
107       }
108     }
109     __hashCodeCalc = false;
110     return _hashCode;
111   }
112
113 }