X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.scl.runtime%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fruntime%2Ftuple%2FTuple2.java;h=edc0cd6983447e770e41697426e0681f70276041;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hp=9c9061da9f52e71ce6c4c97dd26250b01c2fdacf;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scl.runtime/src/org/simantics/scl/runtime/tuple/Tuple2.java b/bundles/org.simantics.scl.runtime/src/org/simantics/scl/runtime/tuple/Tuple2.java old mode 100755 new mode 100644 index 9c9061da9..edc0cd698 --- a/bundles/org.simantics.scl.runtime/src/org/simantics/scl/runtime/tuple/Tuple2.java +++ b/bundles/org.simantics.scl.runtime/src/org/simantics/scl/runtime/tuple/Tuple2.java @@ -1,73 +1,73 @@ /** * This code is generated in org.simantics.scl.runtime.generation.GenerateTuples. * Do not edit manually! - */ -package org.simantics.scl.runtime.tuple; - -public class Tuple2 implements Tuple { - public final Object c0; - public final Object c1; - - public Tuple2(Object c0, Object c1) { - this.c0 = c0; - this.c1 = c1; - } - - public int length() { - return 2; - } - - public Object get(int id) { - switch(id) { - case 0: return c0; - case 1: return c1; - default: throw new IndexOutOfBoundsException(); - } - } - - public Object[] toArray() { - return new Object[] { c0, c1 }; - } - - @Override - public boolean equals(Object obj) { - if(obj == this) - return true; - if(obj == null || obj.getClass() != getClass()) - return false; - Tuple2 tuple = (Tuple2)obj; - if(c0 == null) { - if(tuple.c0 != null) - return false; - } - else if(!c0.equals(tuple.c0)) - return false; - if(c1 == null) { - if(tuple.c1 != null) - return false; - } - else if(!c1.equals(tuple.c1)) - return false; - return true; - } - - @Override - public int hashCode() { - int result = c0 == null ? 0 : c0.hashCode(); - result *= 31; - if(c1 != null) - result += c1.hashCode(); - return result; - } - - @Override - public String toString() { - StringBuilder b = new StringBuilder(); - b.append('('); - b.append(c0); - b.append(','); - b.append(c1); - b.append(')'); - return b.toString(); - } -} + */ +package org.simantics.scl.runtime.tuple; + +public class Tuple2 implements Tuple { + public final Object c0; + public final Object c1; + + public Tuple2(Object c0, Object c1) { + this.c0 = c0; + this.c1 = c1; + } + + public int length() { + return 2; + } + + public Object get(int id) { + switch(id) { + case 0: return c0; + case 1: return c1; + default: throw new IndexOutOfBoundsException(); + } + } + + public Object[] toArray() { + return new Object[] { c0, c1 }; + } + + @Override + public boolean equals(Object obj) { + if(obj == this) + return true; + if(obj == null || obj.getClass() != getClass()) + return false; + Tuple2 tuple = (Tuple2)obj; + if(c0 == null) { + if(tuple.c0 != null) + return false; + } + else if(!c0.equals(tuple.c0)) + return false; + if(c1 == null) { + if(tuple.c1 != null) + return false; + } + else if(!c1.equals(tuple.c1)) + return false; + return true; + } + + @Override + public int hashCode() { + int result = c0 == null ? 0 : c0.hashCode(); + result *= 31; + if(c1 != null) + result += c1.hashCode(); + return result; + } + + @Override + public String toString() { + StringBuilder b = new StringBuilder(); + b.append('('); + b.append(c0); + b.append(','); + b.append(c1); + b.append(')'); + return b.toString(); + } +}