JAL-1807 update
[jalviewjs.git] / site / j2s / java / text / ParsePosition.js
1 Clazz.declarePackage ("java.text");
2 c$ = Clazz.decorateAsClass (function () {
3 this.index = 0;
4 this.errorIndex = -1;
5 Clazz.instantialize (this, arguments);
6 }, java.text, "ParsePosition");
7 Clazz.defineMethod (c$, "getIndex", 
8 function () {
9 return this.index;
10 });
11 Clazz.defineMethod (c$, "setIndex", 
12 function (index) {
13 this.index = index;
14 }, "~N");
15 Clazz.makeConstructor (c$, 
16 function (index) {
17 this.index = index;
18 }, "~N");
19 Clazz.defineMethod (c$, "setErrorIndex", 
20 function (ei) {
21 this.errorIndex = ei;
22 }, "~N");
23 Clazz.defineMethod (c$, "getErrorIndex", 
24 function () {
25 return this.errorIndex;
26 });
27 Clazz.overrideMethod (c$, "equals", 
28 function (obj) {
29 if (obj == null) return false;
30 if (!(Clazz.instanceOf (obj, java.text.ParsePosition))) return false;
31 var other = obj;
32 return (this.index == other.index && this.errorIndex == other.errorIndex);
33 }, "~O");
34 Clazz.overrideMethod (c$, "hashCode", 
35 function () {
36 return (this.errorIndex << 16) | this.index;
37 });
38 Clazz.overrideMethod (c$, "toString", 
39 function () {
40 return this.getClass ().getName () + "[index=" + this.index + ",errorIndex=" + this.errorIndex + ']';
41 });