Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / j2s / java / text / FieldPosition.js
1 Clazz.declarePackage ("java.text");
2 Clazz.load (["java.text.Format"], "java.text.FieldPosition", null, function () {
3 c$ = Clazz.decorateAsClass (function () {
4 this.field = 0;
5 this.endIndex = 0;
6 this.beginIndex = 0;
7 this.attribute = null;
8 if (!Clazz.isClassDefined ("java.text.FieldPosition.Delegate")) {
9 java.text.FieldPosition.$FieldPosition$Delegate$ ();
10 }
11 Clazz.instantialize (this, arguments);
12 }, java.text, "FieldPosition");
13 Clazz.makeConstructor (c$, 
14 function (field) {
15 this.field = field;
16 }, "~N");
17 Clazz.makeConstructor (c$, 
18 function (attribute) {
19 this.construct (attribute, -1);
20 }, "java.text.Format.Field");
21 Clazz.makeConstructor (c$, 
22 function (attribute, fieldID) {
23 this.attribute = attribute;
24 this.field = fieldID;
25 }, "java.text.Format.Field,~N");
26 Clazz.defineMethod (c$, "getFieldAttribute", 
27 function () {
28 return this.attribute;
29 });
30 Clazz.defineMethod (c$, "getField", 
31 function () {
32 return this.field;
33 });
34 Clazz.defineMethod (c$, "getBeginIndex", 
35 function () {
36 return this.beginIndex;
37 });
38 Clazz.defineMethod (c$, "getEndIndex", 
39 function () {
40 return this.endIndex;
41 });
42 Clazz.defineMethod (c$, "setBeginIndex", 
43 function (bi) {
44 this.beginIndex = bi;
45 }, "~N");
46 Clazz.defineMethod (c$, "setEndIndex", 
47 function (ei) {
48 this.endIndex = ei;
49 }, "~N");
50 Clazz.defineMethod (c$, "getFieldDelegate", 
51 function () {
52 return Clazz.innerTypeInstance (java.text.FieldPosition.Delegate, this, null);
53 });
54 Clazz.overrideMethod (c$, "equals", 
55 function (obj) {
56 if (obj == null) return false;
57 if (!(Clazz.instanceOf (obj, java.text.FieldPosition))) return false;
58 var other = obj;
59 if (this.attribute == null) {
60 if (other.attribute != null) {
61 return false;
62 }} else if (!this.attribute.equals (other.attribute)) {
63 return false;
64 }return (this.beginIndex == other.beginIndex && this.endIndex == other.endIndex && this.field == other.field);
65 }, "~O");
66 Clazz.overrideMethod (c$, "hashCode", 
67 function () {
68 return (this.field << 24) | (this.beginIndex << 16) | this.endIndex;
69 });
70 Clazz.overrideMethod (c$, "toString", 
71 function () {
72 return this.getClass ().getName () + "[field=" + this.field + ",attribute=" + this.attribute + ",beginIndex=" + this.beginIndex + ",endIndex=" + this.endIndex + ']';
73 });
74 Clazz.defineMethod (c$, "matchesField", 
75  function (attribute) {
76 if (this.attribute != null) {
77 return this.attribute.equals (attribute);
78 }return false;
79 }, "java.text.Format.Field");
80 Clazz.defineMethod (c$, "matchesField", 
81  function (attribute, field) {
82 if (this.attribute != null) {
83 return this.attribute.equals (attribute);
84 }return (field == this.field);
85 }, "java.text.Format.Field,~N");
86 c$.$FieldPosition$Delegate$ = function () {
87 Clazz.pu$h(self.c$);
88 c$ = Clazz.decorateAsClass (function () {
89 Clazz.prepareCallback (this, arguments);
90 this.encounteredField = false;
91 Clazz.instantialize (this, arguments);
92 }, java.text.FieldPosition, "Delegate", null, java.text.Format.FieldDelegate);
93 Clazz.defineMethod (c$, "formatted", 
94 function (a, b, c, d, e) {
95 if (!this.encounteredField && this.b$["java.text.FieldPosition"].matchesField (a)) {
96 this.b$["java.text.FieldPosition"].setBeginIndex (c);
97 this.b$["java.text.FieldPosition"].setEndIndex (d);
98 this.encounteredField = (c != d);
99 }}, "java.text.Format.Field,~O,~N,~N,StringBuffer");
100 Clazz.defineMethod (c$, "formatted", 
101 function (a, b, c, d, e, f) {
102 if (!this.encounteredField && this.b$["java.text.FieldPosition"].matchesField (b, a)) {
103 this.b$["java.text.FieldPosition"].setBeginIndex (d);
104 this.b$["java.text.FieldPosition"].setEndIndex (e);
105 this.encounteredField = (d != e);
106 }}, "~N,java.text.Format.Field,~O,~N,~N,StringBuffer");
107 c$ = Clazz.p0p ();
108 };
109 });