Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / j2s / java / text / DecimalFormatSymbols.js
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 () {
4 this.zeroDigit = '\0';
5 this.groupingSeparator = '\0';
6 this.decimalSeparator = '\0';
7 this.perMill = '\0';
8 this.percent = '\0';
9 this.digit = '\0';
10 this.patternSeparator = '\0';
11 this.infinity = null;
12 this.NaN = null;
13 this.minusSign = '\0';
14 this.currencySymbol = null;
15 this.intlCurrencySymbol = null;
16 this.monetarySeparator = '\0';
17 this.exponential = '\0';
18 this.exponentialSeparator = null;
19 this.locale = null;
20 this.serialVersionOnStream = 3;
21 Clazz.instantialize (this, arguments);
22 }, java.text, "DecimalFormatSymbols", null, Cloneable);
23 Clazz.makeConstructor (c$, 
24 function () {
25 this.initialize (java.util.Locale.getDefault ());
26 });
27 Clazz.makeConstructor (c$, 
28 function (locale) {
29 this.initialize (locale);
30 }, "java.util.Locale");
31 c$.getInstance = Clazz.defineMethod (c$, "getInstance", 
32 function () {
33 return java.text.DecimalFormatSymbols.getInstance (java.util.Locale.getDefault ());
34 });
35 c$.getInstance = Clazz.defineMethod (c$, "getInstance", 
36 function (locale) {
37 return  new java.text.DecimalFormatSymbols (locale);
38 }, "java.util.Locale");
39 Clazz.defineMethod (c$, "getZeroDigit", 
40 function () {
41 return this.zeroDigit;
42 });
43 Clazz.defineMethod (c$, "setZeroDigit", 
44 function (zeroDigit) {
45 this.zeroDigit = zeroDigit;
46 }, "~S");
47 Clazz.defineMethod (c$, "getGroupingSeparator", 
48 function () {
49 return this.groupingSeparator;
50 });
51 Clazz.defineMethod (c$, "setGroupingSeparator", 
52 function (groupingSeparator) {
53 this.groupingSeparator = groupingSeparator;
54 }, "~S");
55 Clazz.defineMethod (c$, "getDecimalSeparator", 
56 function () {
57 return this.decimalSeparator;
58 });
59 Clazz.defineMethod (c$, "setDecimalSeparator", 
60 function (decimalSeparator) {
61 this.decimalSeparator = decimalSeparator;
62 }, "~S");
63 Clazz.defineMethod (c$, "getPerMill", 
64 function () {
65 return this.perMill;
66 });
67 Clazz.defineMethod (c$, "setPerMill", 
68 function (perMill) {
69 this.perMill = perMill;
70 }, "~S");
71 Clazz.defineMethod (c$, "getPercent", 
72 function () {
73 return this.percent;
74 });
75 Clazz.defineMethod (c$, "setPercent", 
76 function (percent) {
77 this.percent = percent;
78 }, "~S");
79 Clazz.defineMethod (c$, "getDigit", 
80 function () {
81 return this.digit;
82 });
83 Clazz.defineMethod (c$, "setDigit", 
84 function (digit) {
85 this.digit = digit;
86 }, "~S");
87 Clazz.defineMethod (c$, "getPatternSeparator", 
88 function () {
89 return this.patternSeparator;
90 });
91 Clazz.defineMethod (c$, "setPatternSeparator", 
92 function (patternSeparator) {
93 this.patternSeparator = patternSeparator;
94 }, "~S");
95 Clazz.defineMethod (c$, "getInfinity", 
96 function () {
97 return this.infinity;
98 });
99 Clazz.defineMethod (c$, "setInfinity", 
100 function (infinity) {
101 this.infinity = infinity;
102 }, "~S");
103 Clazz.defineMethod (c$, "getNaN", 
104 function () {
105 return this.NaN;
106 });
107 Clazz.defineMethod (c$, "setNaN", 
108 function (NaN) {
109 this.NaN = NaN;
110 }, "~S");
111 Clazz.defineMethod (c$, "getMinusSign", 
112 function () {
113 return this.minusSign;
114 });
115 Clazz.defineMethod (c$, "setMinusSign", 
116 function (minusSign) {
117 this.minusSign = minusSign;
118 }, "~S");
119 Clazz.defineMethod (c$, "getCurrencySymbol", 
120 function () {
121 return this.currencySymbol;
122 });
123 Clazz.defineMethod (c$, "setCurrencySymbol", 
124 function (currency) {
125 this.currencySymbol = currency;
126 }, "~S");
127 Clazz.defineMethod (c$, "getInternationalCurrencySymbol", 
128 function () {
129 return this.intlCurrencySymbol;
130 });
131 Clazz.defineMethod (c$, "setInternationalCurrencySymbol", 
132 function (currencyCode) {
133 this.intlCurrencySymbol = currencyCode;
134 }, "~S");
135 Clazz.defineMethod (c$, "getMonetaryDecimalSeparator", 
136 function () {
137 return this.monetarySeparator;
138 });
139 Clazz.defineMethod (c$, "setMonetaryDecimalSeparator", 
140 function (sep) {
141 this.monetarySeparator = sep;
142 }, "~S");
143 Clazz.defineMethod (c$, "getExponentialSymbol", 
144 function () {
145 return this.exponential;
146 });
147 Clazz.defineMethod (c$, "getExponentSeparator", 
148 function () {
149 return this.exponentialSeparator;
150 });
151 Clazz.defineMethod (c$, "setExponentialSymbol", 
152 function (exp) {
153 this.exponential = exp;
154 }, "~S");
155 Clazz.defineMethod (c$, "setExponentSeparator", 
156 function (exp) {
157 if (exp == null) {
158 throw  new NullPointerException ();
159 }this.exponentialSeparator = exp;
160 }, "~S");
161 Clazz.defineMethod (c$, "clone", 
162 function () {
163 try {
164 return Clazz.superCall (this, java.text.DecimalFormatSymbols, "clone", []);
165 } catch (e) {
166 if (Clazz.exceptionOf (e, CloneNotSupportedException)) {
167 throw  new InternalError ();
168 } else {
169 throw e;
170 }
171 }
172 });
173 Clazz.overrideMethod (c$, "equals", 
174 function (obj) {
175 if (obj == null) return false;
176 if (this === obj) return true;
177 if (this.getClass () !== obj.getClass ()) return false;
178 var other = obj;
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));
180 }, "~O");
181 Clazz.overrideMethod (c$, "hashCode", 
182 function () {
183 var result = (this.zeroDigit).charCodeAt (0);
184 result = result * 37 + this.groupingSeparator.charCodeAt (0);
185 result = result * 37 + this.decimalSeparator.charCodeAt (0);
186 return result;
187 });
188 Clazz.defineMethod (c$, "initialize", 
189  function (locale) {
190 this.locale = locale;
191 var needCacheUpdate = false;
192 var data = java.text.DecimalFormatSymbols.cachedLocaleData.get (locale);
193 if (data == null) {
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);
220 });