]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.scl.runtime/src/org/simantics/scl/runtime/tuple/Tuple4.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.scl.runtime / src / org / simantics / scl / runtime / tuple / Tuple4.java
1 /**
2  * This code is generated in org.simantics.scl.runtime.generation.GenerateTuples.
3  * Do not edit manually!
4  */
5 package org.simantics.scl.runtime.tuple;
6
7 public class Tuple4 implements Tuple {
8     public final Object c0;
9     public final Object c1;
10     public final Object c2;
11     public final Object c3;
12
13     public Tuple4(Object c0, Object c1, Object c2, Object c3) {
14         this.c0 = c0;
15         this.c1 = c1;
16         this.c2 = c2;
17         this.c3 = c3;
18     }
19
20     public int length() {
21         return 4;
22     }
23
24     public Object get(int id) {
25         switch(id) {
26         case 0: return c0;
27         case 1: return c1;
28         case 2: return c2;
29         case 3: return c3;
30         default: throw new IndexOutOfBoundsException();
31         }
32     }
33
34     public Object[] toArray() {
35         return new Object[] { c0, c1, c2, c3 };
36     }
37
38     @Override
39     public boolean equals(Object obj) {
40         if(obj == this)
41             return true;
42         if(obj == null || obj.getClass() != getClass())
43             return false;
44         Tuple4 tuple = (Tuple4)obj;
45         if(c0 == null) {
46             if(tuple.c0 != null)
47                 return false;
48         }
49         else if(!c0.equals(tuple.c0))
50             return false;
51         if(c1 == null) {
52             if(tuple.c1 != null)
53                 return false;
54         }
55         else if(!c1.equals(tuple.c1))
56             return false;
57         if(c2 == null) {
58             if(tuple.c2 != null)
59                 return false;
60         }
61         else if(!c2.equals(tuple.c2))
62             return false;
63         if(c3 == null) {
64             if(tuple.c3 != null)
65                 return false;
66         }
67         else if(!c3.equals(tuple.c3))
68             return false;
69         return true;
70     }
71
72     @Override
73     public int hashCode() {
74         int result = c0 == null ? 0 : c0.hashCode();
75         result *= 31;
76         if(c1 != null)
77             result += c1.hashCode();
78         result *= 31;
79         if(c2 != null)
80             result += c2.hashCode();
81         result *= 31;
82         if(c3 != null)
83             result += c3.hashCode();
84         return result;
85     }
86
87     @Override
88     public String toString() {
89         StringBuilder b = new StringBuilder();
90         b.append('(');
91         b.append(c0);
92         b.append(',');
93         b.append(c1);
94         b.append(',');
95         b.append(c2);
96         b.append(',');
97         b.append(c3);
98         b.append(')');
99         return b.toString();
100     }
101 }