1 Clazz.declarePackage ("java.text");
\r
2 Clazz.load (["java.util.Hashtable"], "java.text.DateFormatSymbols", ["java.lang.IllegalArgumentException", "$.InternalError", "java.util.Arrays", "java.util.Locale", "jssun.util.resources.LocaleData"], function () {
\r
3 c$ = Clazz.decorateAsClass (function () {
\r
6 this.shortMonths = null;
\r
7 this.weekdays = null;
\r
8 this.shortWeekdays = null;
\r
10 this.zoneStrings = null;
\r
11 this.isZoneStringsSet = false;
\r
12 this.localPatternChars = null;
\r
14 Clazz.instantialize (this, arguments);
\r
15 }, java.text, "DateFormatSymbols", null, Cloneable);
\r
16 Clazz.makeConstructor (c$,
\r
18 this.initializeData (java.util.Locale.getDefault ());
\r
20 Clazz.makeConstructor (c$,
\r
22 this.initializeData (locale);
\r
23 }, "java.util.Locale");
\r
24 c$.getInstance = Clazz.defineMethod (c$, "getInstance",
\r
26 return java.text.DateFormatSymbols.getInstance (java.util.Locale.getDefault ());
\r
28 c$.getInstance = Clazz.defineMethod (c$, "getInstance",
\r
30 return new java.text.DateFormatSymbols (locale);
\r
31 }, "java.util.Locale");
\r
32 Clazz.defineMethod (c$, "getEras",
\r
34 return this.duplicate (this.eras);
\r
36 Clazz.defineMethod (c$, "setEras",
\r
37 function (newEras) {
\r
38 this.eras = this.duplicate (newEras);
\r
40 Clazz.defineMethod (c$, "getMonths",
\r
42 return this.duplicate (this.months);
\r
44 Clazz.defineMethod (c$, "setMonths",
\r
45 function (newMonths) {
\r
46 this.months = this.duplicate (newMonths);
\r
48 Clazz.defineMethod (c$, "getShortMonths",
\r
50 return this.duplicate (this.shortMonths);
\r
52 Clazz.defineMethod (c$, "setShortMonths",
\r
53 function (newShortMonths) {
\r
54 this.shortMonths = this.duplicate (newShortMonths);
\r
56 Clazz.defineMethod (c$, "getWeekdays",
\r
58 return this.duplicate (this.weekdays);
\r
60 Clazz.defineMethod (c$, "setWeekdays",
\r
61 function (newWeekdays) {
\r
62 this.weekdays = this.duplicate (newWeekdays);
\r
64 Clazz.defineMethod (c$, "getShortWeekdays",
\r
66 return this.duplicate (this.shortWeekdays);
\r
68 Clazz.defineMethod (c$, "setShortWeekdays",
\r
69 function (newShortWeekdays) {
\r
70 this.shortWeekdays = this.duplicate (newShortWeekdays);
\r
72 Clazz.defineMethod (c$, "getAmPmStrings",
\r
74 return this.duplicate (this.ampms);
\r
76 Clazz.defineMethod (c$, "setAmPmStrings",
\r
77 function (newAmpms) {
\r
78 this.ampms = this.duplicate (newAmpms);
\r
80 Clazz.defineMethod (c$, "setZoneStrings",
\r
81 function (newZoneStrings) {
\r
82 var aCopy = new Array (newZoneStrings.length);
\r
83 for (var i = 0; i < newZoneStrings.length; ++i) {
\r
84 if (newZoneStrings[i].length < 5) {
\r
85 throw new IllegalArgumentException ();
\r
86 }aCopy[i] = this.duplicate (newZoneStrings[i]);
\r
88 this.zoneStrings = aCopy;
\r
89 this.isZoneStringsSet = true;
\r
91 Clazz.defineMethod (c$, "getLocalPatternChars",
\r
93 return String.instantialize (this.localPatternChars);
\r
95 Clazz.defineMethod (c$, "setLocalPatternChars",
\r
96 function (newLocalPatternChars) {
\r
97 this.localPatternChars = String.instantialize (newLocalPatternChars);
\r
99 Clazz.defineMethod (c$, "clone",
\r
102 var other = Clazz.superCall (this, java.text.DateFormatSymbols, "clone", []);
\r
103 this.copyMembers (this, other);
\r
106 if (Clazz.exceptionOf (e, CloneNotSupportedException)) {
\r
107 throw new InternalError ();
\r
113 Clazz.overrideMethod (c$, "hashCode",
\r
118 Clazz.defineMethod (c$, "equals",
\r
120 if (this === obj) return true;
\r
121 if (obj == null || this.getClass () !== obj.getClass ()) return false;
\r
123 return (java.util.Arrays.equals (this.eras, that.eras) && java.util.Arrays.equals (this.months, that.months) && java.util.Arrays.equals (this.shortMonths, that.shortMonths) && java.util.Arrays.equals (this.weekdays, that.weekdays) && java.util.Arrays.equals (this.shortWeekdays, that.shortWeekdays) && java.util.Arrays.equals (this.ampms, that.ampms) && ((this.localPatternChars != null && this.localPatternChars.equals (that.localPatternChars)) || (this.localPatternChars == null && that.localPatternChars == null)));
\r
125 c$.cacheLookup = Clazz.defineMethod (c$, "cacheLookup",
\r
126 function (desiredLocale) {
\r
127 var rb = java.text.DateFormatSymbols.cachedLocaleData.get (desiredLocale);
\r
129 rb = jssun.util.resources.LocaleData.getDateFormatData (desiredLocale);
\r
130 java.text.DateFormatSymbols.cachedLocaleData.put (desiredLocale, rb);
\r
132 }, "java.util.Locale");
\r
133 Clazz.defineMethod (c$, "initializeData",
\r
134 function (desiredLocale) {
\r
136 var resource = java.text.DateFormatSymbols.cacheLookup (desiredLocale);
\r
137 this.eras = resource.getObject ("Eras");
\r
138 this.months = resource.getStringArray ("MonthNames");
\r
139 this.shortMonths = resource.getStringArray ("MonthAbbreviations");
\r
140 var lWeekdays = resource.getStringArray ("DayNames");
\r
141 this.weekdays = new Array (8);
\r
142 this.weekdays[0] = "";
\r
143 for (i = 0; i < lWeekdays.length; i++) this.weekdays[i + 1] = lWeekdays[i];
\r
145 var sWeekdays = resource.getStringArray ("DayAbbreviations");
\r
146 this.shortWeekdays = new Array (8);
\r
147 this.shortWeekdays[0] = "";
\r
148 for (i = 0; i < sWeekdays.length; i++) this.shortWeekdays[i + 1] = sWeekdays[i];
\r
150 this.ampms = resource.getStringArray ("AmPmMarkers");
\r
151 this.localPatternChars = resource.getString ("DateTimePatternChars");
\r
152 this.locale = desiredLocale;
\r
153 }, "java.util.Locale");
\r
154 Clazz.defineMethod (c$, "duplicate",
\r
155 function (srcArray) {
\r
156 var dstArray = new Array (srcArray.length);
\r
157 System.arraycopy (srcArray, 0, dstArray, 0, srcArray.length);
\r
160 Clazz.defineMethod (c$, "copyMembers",
\r
161 function (src, dst) {
\r
162 dst.eras = this.duplicate (src.eras);
\r
163 dst.months = this.duplicate (src.months);
\r
164 dst.shortMonths = this.duplicate (src.shortMonths);
\r
165 dst.weekdays = this.duplicate (src.weekdays);
\r
166 dst.shortWeekdays = this.duplicate (src.shortWeekdays);
\r
167 dst.ampms = this.duplicate (src.ampms);
\r
168 if (src.zoneStrings != null) {
\r
169 if (dst.zoneStrings == null) {
\r
170 dst.zoneStrings = new Array (src.zoneStrings.length);
\r
171 }for (var i = 0; i < dst.zoneStrings.length; ++i) {
\r
172 dst.zoneStrings[i] = this.duplicate (src.zoneStrings[i]);
\r
175 dst.zoneStrings = null;
\r
176 }dst.localPatternChars = String.instantialize (src.localPatternChars);
\r
177 }, "java.text.DateFormatSymbols,java.text.DateFormatSymbols");
\r
178 Clazz.defineStatics (c$,
\r
179 "patternChars", "GyMdkHmsSEDFwWahKzZ",
\r
180 "millisPerHour", 3600000);
\r
181 c$.cachedLocaleData = c$.prototype.cachedLocaleData = new java.util.Hashtable (3);
\r