1 Clazz.declarePackage ("jssun.util.calendar");
2 Clazz.load (null, "jssun.util.calendar.Era", ["java.lang.StringBuilder", "jssun.util.calendar.CalendarSystem", "$.ImmutableGregorianDate"], function () {
3 c$ = Clazz.decorateAsClass (function () {
8 this.localTime = false;
10 Clazz.instantialize (this, arguments);
11 }, jssun.util.calendar, "Era");
12 Clazz.makeConstructor (c$,
13 function (name, abbr, since, localTime) {
17 this.localTime = localTime;
18 var gcal = jssun.util.calendar.CalendarSystem.getGregorianCalendar ();
19 var d = gcal.newCalendarDate (null);
20 gcal.getCalendarDate (since, d);
21 this.sinceDate = new jssun.util.calendar.ImmutableGregorianDate (d);
23 Clazz.defineMethod (c$, "getName",
27 Clazz.defineMethod (c$, "getDisplayName",
30 }, "java.util.Locale");
31 Clazz.defineMethod (c$, "getAbbreviation",
35 Clazz.defineMethod (c$, "getDiaplayAbbreviation",
38 }, "java.util.Locale");
39 Clazz.defineMethod (c$, "getSince",
41 if (zone == null || !this.localTime) {
43 }var offset = zone.getOffset (this.since);
44 return this.since - offset;
45 }, "java.util.TimeZone");
46 Clazz.defineMethod (c$, "getSinceDate",
48 return this.sinceDate;
50 Clazz.defineMethod (c$, "isLocalTime",
52 return this.localTime;
54 Clazz.overrideMethod (c$, "equals",
56 if (!(Clazz.instanceOf (o, jssun.util.calendar.Era))) {
59 return this.name.equals (that.name) && this.abbr.equals (that.abbr) && this.since == that.since && this.localTime == that.localTime;
61 Clazz.overrideMethod (c$, "hashCode",
64 this.hash = this.name.hashCode () ^ this.abbr.hashCode () ^ this.since ^ (this.since >> 32) ^ (this.localTime ? 1 : 0);
67 Clazz.overrideMethod (c$, "toString",
69 var sb = new StringBuilder ();
71 sb.append (this.getName ()).append (" (");
72 sb.append (this.getAbbreviation ()).append (')');
73 sb.append (" since ").append (this.getSinceDate ());
75 sb.setLength (sb.length () - 1);
76 sb.append (" local time");
78 return sb.toString ();