JAL-1807 test
[jalviewjs.git] / bin / jalview / datamodel / AlignedCodon.js
1 Clazz.declarePackage ("jalview.datamodel");
2 Clazz.load (null, "jalview.datamodel.AlignedCodon", ["java.lang.IllegalArgumentException", "$.StringBuilder"], function () {
3 c$ = Clazz.decorateAsClass (function () {
4 this.pos1 = 0;
5 this.pos2 = 0;
6 this.pos3 = 0;
7 this.product = null;
8 Clazz.instantialize (this, arguments);
9 }, jalview.datamodel, "AlignedCodon");
10 Clazz.makeConstructor (c$, 
11 function (i, j, k) {
12 this.construct (i, j, k, null);
13 }, "~N,~N,~N");
14 Clazz.makeConstructor (c$, 
15 function (i, j, k, prod) {
16 this.pos1 = i;
17 this.pos2 = j;
18 this.pos3 = k;
19 this.product = prod;
20 }, "~N,~N,~N,~S");
21 Clazz.defineMethod (c$, "getBaseColumn", 
22 function (base) {
23 if (base < 1 || base > 3) {
24 throw  new IllegalArgumentException (Integer.toString (base));
25 }return base == 1 ? this.pos1 : (base == 2 ? this.pos2 : this.pos3);
26 }, "~N");
27 Clazz.overrideMethod (c$, "equals", 
28 function (o) {
29 if (o == null) {
30 return true;
31 }if (!(Clazz.instanceOf (o, jalview.datamodel.AlignedCodon))) {
32 return false;
33 }var ac = o;
34 return (this.pos1 == ac.pos1 && this.pos2 == ac.pos2 && this.pos3 == ac.pos3);
35 }, "~O");
36 Clazz.overrideMethod (c$, "toString", 
37 function () {
38 var sb =  new StringBuilder ();
39 sb.append ("[").append (this.pos1).append (", ").append (this.pos2).append (", ").append (this.pos3).append ("]");
40 return sb.toString ();
41 });
42 });