Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / j2s / JU / T4.js
1 Clazz.declarePackage ("JU");
2 Clazz.load (["JU.T3"], "JU.T4", null, function () {
3 c$ = Clazz.decorateAsClass (function () {
4 this.w = 0;
5 Clazz.instantialize (this, arguments);
6 }, JU, "T4", JU.T3);
7 Clazz.defineMethod (c$, "set4", 
8 function (x, y, z, w) {
9 this.x = x;
10 this.y = y;
11 this.z = z;
12 this.w = w;
13 }, "~N,~N,~N,~N");
14 Clazz.defineMethod (c$, "scale4", 
15 function (s) {
16 this.scale (s);
17 this.w *= s;
18 }, "~N");
19 Clazz.overrideMethod (c$, "hashCode", 
20 function () {
21 return JU.T3.floatToIntBits0 (this.x) ^ JU.T3.floatToIntBits0 (this.y) ^ JU.T3.floatToIntBits0 (this.z) ^ JU.T3.floatToIntBits0 (this.w);
22 });
23 Clazz.overrideMethod (c$, "equals", 
24 function (o) {
25 if (!(Clazz.instanceOf (o, JU.T4))) return false;
26 var t = o;
27 return (this.x == t.x && this.y == t.y && this.z == t.z && this.w == t.w);
28 }, "~O");
29 Clazz.overrideMethod (c$, "toString", 
30 function () {
31 return "(" + this.x + ", " + this.y + ", " + this.z + ", " + this.w + ")";
32 });
33 Clazz.overrideMethod (c$, "toJSON", 
34 function () {
35 return "[" + this.x + ", " + this.y + ", " + this.z + ", " + this.w + "]";
36 });
37 });