JAL-1807 includes ?j2sdebug flag and DebugJS._(msg)
[jalviewjs.git] / bin / com / stevesoft / pat / patInt.js
1 Clazz.declarePackage ("com.stevesoft.pat");
2 c$ = Clazz.decorateAsClass (function () {
3 this.i = 0;
4 this.inf = false;
5 Clazz.instantialize (this, arguments);
6 }, com.stevesoft.pat, "patInt");
7 Clazz.makeConstructor (c$, 
8 function () {
9 this.i = 0;
10 this.inf = false;
11 });
12 Clazz.makeConstructor (c$, 
13 function (init) {
14 this.i = init;
15 this.inf = false;
16 }, "~N");
17 Clazz.makeConstructor (c$, 
18 function (p) {
19 this.i = p.i;
20 this.inf = p.inf;
21 }, "com.stevesoft.pat.patInt");
22 Clazz.defineMethod (c$, "setInf", 
23 function (b) {
24 this.inf = b;
25 if (b) {
26 this.i = 2147483647;
27 }}, "~B");
28 Clazz.defineMethod (c$, "inc", 
29 function () {
30 if (!this.inf) {
31 this.i++;
32 }});
33 Clazz.defineMethod (c$, "dec", 
34 function () {
35 if (!this.inf) {
36 this.i--;
37 }});
38 Clazz.defineMethod (c$, "lessEq", 
39 function (j) {
40 return !this.inf && (j.inf || this.i <= j.i);
41 }, "com.stevesoft.pat.patInt");
42 Clazz.defineMethod (c$, "equals", 
43 function (j) {
44 return !j.inf && !this.inf && this.i == j.i;
45 }, "com.stevesoft.pat.patInt");
46 Clazz.overrideMethod (c$, "toString", 
47 function () {
48 if (this.inf) {
49 return "";
50 } else {
51 return "" + this.i;
52 }});
53 Clazz.defineMethod (c$, "pluseq", 
54 function (p) {
55 if (this.inf || p.inf) {
56 this.setInf (true);
57 } else {
58 this.i += p.i;
59 }return this;
60 }, "com.stevesoft.pat.patInt");
61 Clazz.defineMethod (c$, "mul", 
62 function (p) {
63 if (this.inf || p.inf) {
64 return  new com.stevesoft.pat.patInf ();
65 }return  new com.stevesoft.pat.patInt (this.i * p.i);
66 }, "com.stevesoft.pat.patInt");
67 Clazz.defineMethod (c$, "mineq", 
68 function (p) {
69 if (p.inf) {
70 return this;
71 }if (this.inf) {
72 this.i = p.i;
73 } else if (p.i < this.i) {
74 this.i = p.i;
75 }this.setInf (false);
76 return this;
77 }, "com.stevesoft.pat.patInt");
78 Clazz.defineMethod (c$, "maxeq", 
79 function (p) {
80 if (this.inf || p.inf) {
81 this.setInf (true);
82 return this;
83 }if (p.i > this.i) {
84 this.i = p.i;
85 }return this;
86 }, "com.stevesoft.pat.patInt");
87 Clazz.defineMethod (c$, "finite", 
88 function () {
89 return !this.inf;
90 });
91 Clazz.defineMethod (c$, "intValue", 
92 function () {
93 return this.inf ? 2147483647 : this.i;
94 });