1 Clazz.declarePackage ("java.text");
\r
2 Clazz.load (["java.text.Format"], "java.text.FieldPosition", null, function () {
\r
3 c$ = Clazz.decorateAsClass (function () {
\r
7 this.attribute = null;
\r
8 if (!Clazz.isClassDefined ("java.text.FieldPosition.Delegate")) {
\r
9 java.text.FieldPosition.$FieldPosition$Delegate$ ();
\r
11 Clazz.instantialize (this, arguments);
\r
12 }, java.text, "FieldPosition");
\r
13 Clazz.makeConstructor (c$,
\r
17 Clazz.makeConstructor (c$,
\r
18 function (attribute) {
\r
19 this.construct (attribute, -1);
\r
20 }, "java.text.Format.Field");
\r
21 Clazz.makeConstructor (c$,
\r
22 function (attribute, fieldID) {
\r
23 this.attribute = attribute;
\r
24 this.field = fieldID;
\r
25 }, "java.text.Format.Field,~N");
\r
26 Clazz.defineMethod (c$, "getFieldAttribute",
\r
28 return this.attribute;
\r
30 Clazz.defineMethod (c$, "getField",
\r
34 Clazz.defineMethod (c$, "getBeginIndex",
\r
36 return this.beginIndex;
\r
38 Clazz.defineMethod (c$, "getEndIndex",
\r
40 return this.endIndex;
\r
42 Clazz.defineMethod (c$, "setBeginIndex",
\r
44 this.beginIndex = bi;
\r
46 Clazz.defineMethod (c$, "setEndIndex",
\r
50 Clazz.defineMethod (c$, "getFieldDelegate",
\r
52 return Clazz.innerTypeInstance (java.text.FieldPosition.Delegate, this, null);
\r
54 Clazz.overrideMethod (c$, "equals",
\r
56 if (obj == null) return false;
\r
57 if (!(Clazz.instanceOf (obj, java.text.FieldPosition))) return false;
\r
59 if (this.attribute == null) {
\r
60 if (other.attribute != null) {
\r
62 }} else if (!this.attribute.equals (other.attribute)) {
\r
64 }return (this.beginIndex == other.beginIndex && this.endIndex == other.endIndex && this.field == other.field);
\r
66 Clazz.overrideMethod (c$, "hashCode",
\r
68 return (this.field << 24) | (this.beginIndex << 16) | this.endIndex;
\r
70 Clazz.overrideMethod (c$, "toString",
\r
72 return this.getClass ().getName () + "[field=" + this.field + ",attribute=" + this.attribute + ",beginIndex=" + this.beginIndex + ",endIndex=" + this.endIndex + ']';
\r
74 Clazz.defineMethod (c$, "matchesField",
\r
75 function (attribute) {
\r
76 if (this.attribute != null) {
\r
77 return this.attribute.equals (attribute);
\r
79 }, "java.text.Format.Field");
\r
80 Clazz.defineMethod (c$, "matchesField",
\r
81 function (attribute, field) {
\r
82 if (this.attribute != null) {
\r
83 return this.attribute.equals (attribute);
\r
84 }return (field == this.field);
\r
85 }, "java.text.Format.Field,~N");
\r
86 c$.$FieldPosition$Delegate$ = function () {
\r
87 Clazz.pu$h(self.c$);
\r
88 c$ = Clazz.decorateAsClass (function () {
\r
89 Clazz.prepareCallback (this, arguments);
\r
90 this.encounteredField = false;
\r
91 Clazz.instantialize (this, arguments);
\r
92 }, java.text.FieldPosition, "Delegate", null, java.text.Format.FieldDelegate);
\r
93 Clazz.defineMethod (c$, "formatted",
\r
94 function (a, b, c, d, e) {
\r
95 if (!this.encounteredField && this.b$["java.text.FieldPosition"].matchesField (a)) {
\r
96 this.b$["java.text.FieldPosition"].setBeginIndex (c);
\r
97 this.b$["java.text.FieldPosition"].setEndIndex (d);
\r
98 this.encounteredField = (c != d);
\r
99 }}, "java.text.Format.Field,~O,~N,~N,StringBuffer");
\r
100 Clazz.defineMethod (c$, "formatted",
\r
101 function (a, b, c, d, e, f) {
\r
102 if (!this.encounteredField && this.b$["java.text.FieldPosition"].matchesField (b, a)) {
\r
103 this.b$["java.text.FieldPosition"].setBeginIndex (d);
\r
104 this.b$["java.text.FieldPosition"].setEndIndex (e);
\r
105 this.encounteredField = (d != e);
\r
106 }}, "~N,java.text.Format.Field,~O,~N,~N,StringBuffer");
\r