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