1 Clazz.declarePackage ("java.text");
2 Clazz.load (["java.text.Format"], "java.text.FieldPosition", null, function () {
3 c$ = Clazz.decorateAsClass (function () {
8 if (!Clazz.isClassDefined ("java.text.FieldPosition.Delegate")) {
9 java.text.FieldPosition.$FieldPosition$Delegate$ ();
11 Clazz.instantialize (this, arguments);
12 }, java.text, "FieldPosition");
13 Clazz.makeConstructor (c$,
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;
25 }, "java.text.Format.Field,~N");
26 Clazz.defineMethod (c$, "getFieldAttribute",
28 return this.attribute;
30 Clazz.defineMethod (c$, "getField",
34 Clazz.defineMethod (c$, "getBeginIndex",
36 return this.beginIndex;
38 Clazz.defineMethod (c$, "getEndIndex",
42 Clazz.defineMethod (c$, "setBeginIndex",
46 Clazz.defineMethod (c$, "setEndIndex",
50 Clazz.defineMethod (c$, "getFieldDelegate",
52 return Clazz.innerTypeInstance (java.text.FieldPosition.Delegate, this, null);
54 Clazz.overrideMethod (c$, "equals",
56 if (obj == null) return false;
57 if (!(Clazz.instanceOf (obj, java.text.FieldPosition))) return false;
59 if (this.attribute == null) {
60 if (other.attribute != null) {
62 }} else if (!this.attribute.equals (other.attribute)) {
64 }return (this.beginIndex == other.beginIndex && this.endIndex == other.endIndex && this.field == other.field);
66 Clazz.overrideMethod (c$, "hashCode",
68 return (this.field << 24) | (this.beginIndex << 16) | this.endIndex;
70 Clazz.overrideMethod (c$, "toString",
72 return this.getClass ().getName () + "[field=" + this.field + ",attribute=" + this.attribute + ",beginIndex=" + this.beginIndex + ",endIndex=" + this.endIndex + ']';
74 Clazz.defineMethod (c$, "matchesField",
75 function (attribute) {
76 if (this.attribute != null) {
77 return this.attribute.equals (attribute);
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 () {
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");