1 Clazz.declarePackage ("java.text");
\r
2 Clazz.load (["java.util.Hashtable"], "java.text.DecimalFormatSymbols", ["java.lang.InternalError", "$.NullPointerException", "java.util.Locale", "jssun.util.resources.LocaleData"], function () {
\r
3 c$ = Clazz.decorateAsClass (function () {
\r
4 this.zeroDigit = '\0';
\r
5 this.groupingSeparator = '\0';
\r
6 this.decimalSeparator = '\0';
\r
10 this.patternSeparator = '\0';
\r
11 this.infinity = null;
\r
13 this.minusSign = '\0';
\r
14 this.currencySymbol = null;
\r
15 this.intlCurrencySymbol = null;
\r
16 this.monetarySeparator = '\0';
\r
17 this.exponential = '\0';
\r
18 this.exponentialSeparator = null;
\r
20 this.serialVersionOnStream = 3;
\r
21 Clazz.instantialize (this, arguments);
\r
22 }, java.text, "DecimalFormatSymbols", null, Cloneable);
\r
23 Clazz.makeConstructor (c$,
\r
25 this.initialize (java.util.Locale.getDefault ());
\r
27 Clazz.makeConstructor (c$,
\r
29 this.initialize (locale);
\r
30 }, "java.util.Locale");
\r
31 c$.getInstance = Clazz.defineMethod (c$, "getInstance",
\r
33 return java.text.DecimalFormatSymbols.getInstance (java.util.Locale.getDefault ());
\r
35 c$.getInstance = Clazz.defineMethod (c$, "getInstance",
\r
37 return new java.text.DecimalFormatSymbols (locale);
\r
38 }, "java.util.Locale");
\r
39 Clazz.defineMethod (c$, "getZeroDigit",
\r
41 return this.zeroDigit;
\r
43 Clazz.defineMethod (c$, "setZeroDigit",
\r
44 function (zeroDigit) {
\r
45 this.zeroDigit = zeroDigit;
\r
47 Clazz.defineMethod (c$, "getGroupingSeparator",
\r
49 return this.groupingSeparator;
\r
51 Clazz.defineMethod (c$, "setGroupingSeparator",
\r
52 function (groupingSeparator) {
\r
53 this.groupingSeparator = groupingSeparator;
\r
55 Clazz.defineMethod (c$, "getDecimalSeparator",
\r
57 return this.decimalSeparator;
\r
59 Clazz.defineMethod (c$, "setDecimalSeparator",
\r
60 function (decimalSeparator) {
\r
61 this.decimalSeparator = decimalSeparator;
\r
63 Clazz.defineMethod (c$, "getPerMill",
\r
65 return this.perMill;
\r
67 Clazz.defineMethod (c$, "setPerMill",
\r
68 function (perMill) {
\r
69 this.perMill = perMill;
\r
71 Clazz.defineMethod (c$, "getPercent",
\r
73 return this.percent;
\r
75 Clazz.defineMethod (c$, "setPercent",
\r
76 function (percent) {
\r
77 this.percent = percent;
\r
79 Clazz.defineMethod (c$, "getDigit",
\r
83 Clazz.defineMethod (c$, "setDigit",
\r
87 Clazz.defineMethod (c$, "getPatternSeparator",
\r
89 return this.patternSeparator;
\r
91 Clazz.defineMethod (c$, "setPatternSeparator",
\r
92 function (patternSeparator) {
\r
93 this.patternSeparator = patternSeparator;
\r
95 Clazz.defineMethod (c$, "getInfinity",
\r
97 return this.infinity;
\r
99 Clazz.defineMethod (c$, "setInfinity",
\r
100 function (infinity) {
\r
101 this.infinity = infinity;
\r
103 Clazz.defineMethod (c$, "getNaN",
\r
107 Clazz.defineMethod (c$, "setNaN",
\r
111 Clazz.defineMethod (c$, "getMinusSign",
\r
113 return this.minusSign;
\r
115 Clazz.defineMethod (c$, "setMinusSign",
\r
116 function (minusSign) {
\r
117 this.minusSign = minusSign;
\r
119 Clazz.defineMethod (c$, "getCurrencySymbol",
\r
121 return this.currencySymbol;
\r
123 Clazz.defineMethod (c$, "setCurrencySymbol",
\r
124 function (currency) {
\r
125 this.currencySymbol = currency;
\r
127 Clazz.defineMethod (c$, "getInternationalCurrencySymbol",
\r
129 return this.intlCurrencySymbol;
\r
131 Clazz.defineMethod (c$, "setInternationalCurrencySymbol",
\r
132 function (currencyCode) {
\r
133 this.intlCurrencySymbol = currencyCode;
\r
135 Clazz.defineMethod (c$, "getMonetaryDecimalSeparator",
\r
137 return this.monetarySeparator;
\r
139 Clazz.defineMethod (c$, "setMonetaryDecimalSeparator",
\r
141 this.monetarySeparator = sep;
\r
143 Clazz.defineMethod (c$, "getExponentialSymbol",
\r
145 return this.exponential;
\r
147 Clazz.defineMethod (c$, "getExponentSeparator",
\r
149 return this.exponentialSeparator;
\r
151 Clazz.defineMethod (c$, "setExponentialSymbol",
\r
153 this.exponential = exp;
\r
155 Clazz.defineMethod (c$, "setExponentSeparator",
\r
158 throw new NullPointerException ();
\r
159 }this.exponentialSeparator = exp;
\r
161 Clazz.defineMethod (c$, "clone",
\r
164 return Clazz.superCall (this, java.text.DecimalFormatSymbols, "clone", []);
\r
166 if (Clazz.exceptionOf (e, CloneNotSupportedException)) {
\r
167 throw new InternalError ();
\r
173 Clazz.overrideMethod (c$, "equals",
\r
175 if (obj == null) return false;
\r
176 if (this === obj) return true;
\r
177 if (this.getClass () !== obj.getClass ()) return false;
\r
179 return (this.zeroDigit == other.zeroDigit && this.groupingSeparator == other.groupingSeparator && this.decimalSeparator == other.decimalSeparator && this.percent == other.percent && this.perMill == other.perMill && this.digit == other.digit && this.minusSign == other.minusSign && this.patternSeparator == other.patternSeparator && this.infinity.equals (other.infinity) && this.NaN.equals (other.NaN) && this.currencySymbol.equals (other.currencySymbol) && this.intlCurrencySymbol.equals (other.intlCurrencySymbol) && this.monetarySeparator == other.monetarySeparator && this.exponentialSeparator.equals (other.exponentialSeparator) && this.locale.equals (other.locale));
\r
181 Clazz.overrideMethod (c$, "hashCode",
\r
183 var result = (this.zeroDigit).charCodeAt (0);
\r
184 result = result * 37 + this.groupingSeparator.charCodeAt (0);
\r
185 result = result * 37 + this.decimalSeparator.charCodeAt (0);
\r
188 Clazz.defineMethod (c$, "initialize",
\r
189 function (locale) {
\r
190 this.locale = locale;
\r
191 var needCacheUpdate = false;
\r
192 var data = java.text.DecimalFormatSymbols.cachedLocaleData.get (locale);
\r
193 if (data == null) {
\r
194 data = new Array (3);
\r
195 var rb = jssun.util.resources.LocaleData.getNumberFormatData (locale);
\r
196 data[0] = rb.getStringArray ("NumberElements");
\r
197 needCacheUpdate = true;
\r
198 }var numberElements = data[0];
\r
199 this.decimalSeparator = numberElements[0].charAt (0);
\r
200 this.groupingSeparator = numberElements[1].charAt (0);
\r
201 this.patternSeparator = numberElements[2].charAt (0);
\r
202 this.percent = numberElements[3].charAt (0);
\r
203 this.zeroDigit = numberElements[4].charAt (0);
\r
204 this.digit = numberElements[5].charAt (0);
\r
205 this.minusSign = numberElements[6].charAt (0);
\r
206 this.exponential = numberElements[7].charAt (0);
\r
207 this.exponentialSeparator = numberElements[7];
\r
208 this.perMill = numberElements[8].charAt (0);
\r
209 this.infinity = numberElements[9];
\r
210 this.NaN = numberElements[10];
\r
211 this.intlCurrencySymbol = "XXX";
\r
212 this.currencySymbol = "\u00A4";
\r
213 this.monetarySeparator = this.decimalSeparator;
\r
214 if (needCacheUpdate) {
\r
215 java.text.DecimalFormatSymbols.cachedLocaleData.put (locale, data);
\r
216 }}, "java.util.Locale");
\r
217 Clazz.defineStatics (c$,
\r
218 "currentSerialVersion", 3);
\r
219 c$.cachedLocaleData = c$.prototype.cachedLocaleData = new java.util.Hashtable (3);
\r