]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.scl.runtime/src/org/simantics/scl/runtime/tuple/Tuple5.java
Fixed multiple issues causing dangling references to discarded queries
[simantics/platform.git] / bundles / org.simantics.scl.runtime / src / org / simantics / scl / runtime / tuple / Tuple5.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 Tuple5 implements Tuple {
8     public final Object c0;
9     public final Object c1;
10     public final Object c2;
11     public final Object c3;
12     public final Object c4;
13
14     public Tuple5(Object c0, Object c1, Object c2, Object c3, Object c4) {
15         this.c0 = c0;
16         this.c1 = c1;
17         this.c2 = c2;
18         this.c3 = c3;
19         this.c4 = c4;
20     }
21
22     public int length() {
23         return 5;
24     }
25
26     public Object get(int id) {
27         switch(id) {
28         case 0: return c0;
29         case 1: return c1;
30         case 2: return c2;
31         case 3: return c3;
32         case 4: return c4;
33         default: throw new IndexOutOfBoundsException();
34         }
35     }
36
37     public Object[] toArray() {
38         return new Object[] { c0, c1, c2, c3, c4 };
39     }
40
41     @Override
42     public boolean equals(Object obj) {
43         if(obj == this)
44             return true;
45         if(obj == null || obj.getClass() != getClass())
46             return false;
47         Tuple5 tuple = (Tuple5)obj;
48         if(c0 == null) {
49             if(tuple.c0 != null)
50                 return false;
51         }
52         else if(!c0.equals(tuple.c0))
53             return false;
54         if(c1 == null) {
55             if(tuple.c1 != null)
56                 return false;
57         }
58         else if(!c1.equals(tuple.c1))
59             return false;
60         if(c2 == null) {
61             if(tuple.c2 != null)
62                 return false;
63         }
64         else if(!c2.equals(tuple.c2))
65             return false;
66         if(c3 == null) {
67             if(tuple.c3 != null)
68                 return false;
69         }
70         else if(!c3.equals(tuple.c3))
71             return false;
72         if(c4 == null) {
73             if(tuple.c4 != null)
74                 return false;
75         }
76         else if(!c4.equals(tuple.c4))
77             return false;
78         return true;
79     }
80
81     @Override
82     public int hashCode() {
83         int result = c0 == null ? 0 : c0.hashCode();
84         result *= 31;
85         if(c1 != null)
86             result += c1.hashCode();
87         result *= 31;
88         if(c2 != null)
89             result += c2.hashCode();
90         result *= 31;
91         if(c3 != null)
92             result += c3.hashCode();
93         result *= 31;
94         if(c4 != null)
95             result += c4.hashCode();
96         return result;
97     }
98
99     @Override
100     public String toString() {
101         StringBuilder b = new StringBuilder();
102         b.append('(');
103         b.append(c0);
104         b.append(',');
105         b.append(c1);
106         b.append(',');
107         b.append(c2);
108         b.append(',');
109         b.append(c3);
110         b.append(',');
111         b.append(c4);
112         b.append(')');
113         return b.toString();
114     }
115 }