Home
last modified time | relevance | path

Searched refs:era (Results 1 – 25 of 39) sorted by relevance

12

/libcore/ojluni/src/main/java/sun/util/calendar/
DLocalGregorianCalendar.java58 public Date setEra(Era era) { in setEra() argument
59 if (getEra() != era) { in setEra()
60 super.setEra(era); in setEra()
92 void setLocalEra(Era era) { in setLocalEra() argument
93 super.setEra(era); in setLocalEra()
105 Era era = getEra(); in toString() local
106 if (era != null) { in toString()
107 String abbr = era.getAbbreviation(); in toString()
166 Era era = new Era(eraName, abbr, since, localTime); in getLocalGregorianCalendar() local
167 eras.add(era); in getLocalGregorianCalendar()
[all …]
DJulianCalendar.java58 public Date setEra(Era era) { in setEra() argument
59 if (era == null) { in setEra()
62 if (era != eras[0] || era != eras[1]) { in setEra()
63 throw new IllegalArgumentException("unknown era: " + era); in setEra()
65 super.setEra(era); in setEra()
69 protected void setKnownEra(Era era) { in setKnownEra() argument
70 super.setEra(era); in setKnownEra()
98 Era era = getEra(); in toString() local
99 if (era != null) { in toString()
100 String n = era.getAbbreviation(); in toString()
DCalendarDate.java67 private Era era; field in CalendarDate
98 return era; in getEra()
113 public CalendarDate setEra(Era era) { in setEra() argument
114 if (this.era == era) { in setEra()
117 this.era = era; in setEra()
418 int era = 0; in hashCode() local
421 era = e.hashCode(); in hashCode()
424 return (int) hash * (int)(hash >> 32) ^ era ^ normalized ^ zone; in hashCode()
/libcore/ojluni/src/test/java/time/tck/java/time/chrono/
DTCKJapaneseEra.java91 public void test_valueOf(JapaneseEra era , String eraName, int eraValue) { in test_valueOf() argument
92 assertEquals(era.getValue(), eraValue); in test_valueOf()
93 assertEquals(JapaneseEra.of(eraValue), era); in test_valueOf() local
94 assertEquals(JapaneseEra.valueOf(eraName), era); in test_valueOf() local
105 for (JapaneseEra era : eras) { in test_values()
106 assertTrue(eraList.contains(era)); in test_values()
116 for (JapaneseEra era : JapaneseEra.values()) { in test_range()
117 assertEquals(era.range(ERA).getMinimum(), -1); in test_range()
118 assertEquals(era.range(ERA).getLargestMinimum(), -1); in test_range()
119 assertEquals(era.range(ERA).getSmallestMaximum(), era.range(ERA).getMaximum()); in test_range()
[all …]
DTCKHijrahEra.java86 public void test_valueOf(HijrahEra era , String eraName, int eraValue) { in test_valueOf() argument
87 assertEquals(era.getValue(), eraValue); in test_valueOf()
89 assertEquals(HijrahChronology.INSTANCE.eraOf(eraValue), era); in test_valueOf() local
90 assertEquals(HijrahEra.of(eraValue), era); in test_valueOf() local
91 assertEquals(HijrahEra.valueOf(eraName), era); in test_valueOf() local
102 for (HijrahEra era : eras) { in test_values()
103 assertTrue(eraList.contains(era)); in test_values()
112 for (HijrahEra era : HijrahEra.values()) { in test_range()
113 assertEquals(era.range(ERA), ValueRange.of(1, 1)); in test_range()
DTCKThaiBuddhistEra.java91 public void test_valueOf(ThaiBuddhistEra era , String eraName, int eraValue) { in test_valueOf() argument
92 assertEquals(era.getValue(), eraValue); in test_valueOf()
93 assertEquals(ThaiBuddhistEra.of(eraValue), era); in test_valueOf() local
94 assertEquals(ThaiBuddhistEra.valueOf(eraName), era); in test_valueOf() local
105 for (ThaiBuddhistEra era : eras) { in test_values()
106 assertTrue(eraList.contains(era)); in test_values()
115 for (ThaiBuddhistEra era : ThaiBuddhistEra.values()) { in test_range()
116 assertEquals(era.range(ERA), ValueRange.of(0, 1)); in test_range()
DTCKIsoEra.java87 public void test_valueOf(IsoEra era , String eraName, int eraValue) { in test_valueOf() argument
88 assertEquals(era.getValue(), eraValue); in test_valueOf()
89 assertEquals(IsoEra.of(eraValue), era); in test_valueOf() local
90 assertEquals(IsoEra.valueOf(eraName), era); in test_valueOf() local
101 for (IsoEra era : eras) { in test_values()
102 assertTrue(eraList.contains(era)); in test_values()
111 for (IsoEra era : IsoEra.values()) { in test_range()
112 assertEquals(era.range(ERA), ValueRange.of(0, 1)); in test_range()
DTCKMinguoEra.java91 public void test_valueOf(MinguoEra era , String eraName, int eraValue) { in test_valueOf() argument
92 assertEquals(era.getValue(), eraValue); in test_valueOf()
93 assertEquals(MinguoEra.of(eraValue), era); in test_valueOf() local
94 assertEquals(MinguoEra.valueOf(eraName), era); in test_valueOf() local
106 for (MinguoEra era : eras) { in test_values()
107 assertTrue(eraList.contains(era)); in test_values()
116 for (MinguoEra era : MinguoEra.values()) { in test_range()
117 assertEquals(era.range(ERA), ValueRange.of(0, 1)); in test_range()
DCopticEra.java98 public static CopticEra of(int era) { in of() argument
99 switch (era) { in of()
105 throw new DateTimeException("Invalid era: " + era); in of()
DTCKJapaneseChronology.java198 … public void test_createEymd(JapaneseEra era, int yoe, int moy, int dom, int doy, LocalDate iso) { in test_createEymd() argument
199 JapaneseDate dateByChronoFactory = JapaneseChronology.INSTANCE.date(era, yoe, moy, dom); in test_createEymd()
200 JapaneseDate dateByDateFactory = JapaneseDate.of(era, yoe, moy, dom); in test_createEymd()
206 public void test_createEyd(JapaneseEra era, int yoe, int moy, int dom, int doy, LocalDate iso) { in test_createEyd() argument
207 JapaneseDate dateByChronoFactory = JapaneseChronology.INSTANCE.dateYearDay(era, yoe, doy); in test_createEyd()
208 JapaneseDate dateByDateFactory = JapaneseDate.of(era, yoe, moy, dom); in test_createEyd()
214 …public void test_createByEra_isEqual(JapaneseEra era, int yoe, int moy, int dom, int doy, LocalDat… in test_createByEra_isEqual() argument
215 JapaneseDate test = JapaneseDate.of(era, yoe, moy, dom); in test_createByEra_isEqual()
221 …public void test_createByEra_chronologyTemporalFactory(JapaneseEra era, int yoe, int moy, int dom,… in test_createByEra_chronologyTemporalFactory() argument
222 JapaneseDate test = JapaneseDate.of(era, yoe, moy, dom); in test_createByEra_chronologyTemporalFactory()
[all …]
DTCKHijrahChronology.java172 for (Era era : eras) { in test_InvalidEras()
174 ChronoLocalDate date = HijrahChronology.INSTANCE.date(era, 1, 1, 1); in test_InvalidEras()
175 fail("HijrahChronology.date did not throw ClassCastException for Era: " + era); in test_InvalidEras()
192 int year = HijrahChronology.INSTANCE.prolepticYear(era, 1); in test_InvalidEras()
193 … fail("HijrahChronology.prolepticYear did not throw ClassCastException for Era: " + era); in test_InvalidEras()
208 for (HijrahEra era : HijrahEra.values()) { in data_resolve_styleByEra()
209 result[i++] = new Object[] {style, era}; in data_resolve_styleByEra()
216 public void test_resolve_yearOfEra_eraOnly_valid(ResolverStyle style, HijrahEra era) { in test_resolve_yearOfEra_eraOnly_valid() argument
218 fieldValues.put(ChronoField.ERA, (long) era.getValue()); in test_resolve_yearOfEra_eraOnly_valid()
221 assertEquals(fieldValues.get(ChronoField.ERA), (Long) (long) era.getValue()); in test_resolve_yearOfEra_eraOnly_valid()
[all …]
DCopticChronology.java212 public int prolepticYear(Era era, int yearOfEra) { in prolepticYear() argument
213 if (era instanceof CopticEra == false) { in prolepticYear()
216 return (era == CopticEra.AM ? yearOfEra : 1 - yearOfEra); in prolepticYear()
/libcore/ojluni/src/main/java/java/time/chrono/
DJapaneseChronology.java211 public JapaneseDate date(Era era, int yearOfEra, int month, int dayOfMonth) { in date() argument
212 if (era instanceof JapaneseEra == false) { in date()
215 return JapaneseDate.of((JapaneseEra) era, yearOfEra, month, dayOfMonth); in date()
259 public JapaneseDate dateYearDay(Era era, int yearOfEra, int dayOfYear) { in dateYearDay() argument
260 return JapaneseDate.ofYearDay((JapaneseEra) era, yearOfEra, dayOfYear); in dateYearDay()
351 public int prolepticYear(Era era, int yearOfEra) { in prolepticYear() argument
352 if (era instanceof JapaneseEra == false) { in prolepticYear()
356 JapaneseEra jera = (JapaneseEra) era; in prolepticYear()
441 JapaneseEra era = null; in resolveYearOfEra() local
443 era = eraOf(range(ERA).checkValidIntValue(eraLong, ERA)); // always validated in resolveYearOfEra()
[all …]
DJapaneseDate.java136 private transient JapaneseEra era; field in JapaneseDate
220 public static JapaneseDate of(JapaneseEra era, int yearOfEra, int month, int dayOfMonth) { in of() argument
221 Objects.requireNonNull(era, "era"); in of()
223 jdate.setEra(era.getPrivateEra()).setDate(yearOfEra, month, dayOfMonth); in of()
228 return new JapaneseDate(era, yearOfEra, date); in of()
277 static JapaneseDate ofYearDay(JapaneseEra era, int yearOfEra, int dayOfYear) { in ofYearDay() argument
278 Objects.requireNonNull(era, "era"); in ofYearDay()
279 CalendarDate firstDay = era.getPrivateEra().getSinceDate(); in ofYearDay()
281 jdate.setEra(era.getPrivateEra()); in ofYearDay()
288 if (era.getPrivateEra() != jdate.getEra() || yearOfEra != jdate.getYear()) { in ofYearDay()
[all …]
DIsoChronology.java187 public LocalDate date(Era era, int yearOfEra, int month, int dayOfMonth) { in date() argument
188 return date(prolepticYear(era, yearOfEra), month, dayOfMonth); in date()
218 public LocalDate dateYearDay(Era era, int yearOfEra, int dayOfYear) { in dateYearDay() argument
219 return dateYearDay(prolepticYear(era, yearOfEra), dayOfYear); in dateYearDay()
387 public int prolepticYear(Era era, int yearOfEra) { in prolepticYear() argument
388 if (era instanceof IsoEra == false) { in prolepticYear()
391 return (era == IsoEra.CE ? yearOfEra : 1 - yearOfEra); in prolepticYear()
514 Long era = fieldValues.remove(ERA); in resolveYearOfEra() local
515 if (era == null) { in resolveYearOfEra()
529 } else if (era.longValue() == 1L) { in resolveYearOfEra()
[all …]
DJapaneseEra.java258 for (JapaneseEra era : KNOWN_ERAS) { in valueOf()
259 if (era.getName().equals(japaneseEra)) { in valueOf()
260 return era; in valueOf()
315 JapaneseEra era = KNOWN_ERAS[i]; in from() local
316 if (date.compareTo(era.since) >= 0) { in from()
317 return era; in from()
334 JapaneseEra era = KNOWN_ERAS[i]; in privateEraFrom() local
335 if (isoDate.compareTo(era.since) >= 0) { in privateEraFrom()
DMinguoChronology.java176 public MinguoDate date(Era era, int yearOfEra, int month, int dayOfMonth) { in date() argument
177 return date(prolepticYear(era, yearOfEra), month, dayOfMonth); in date()
207 public MinguoDate dateYearDay(Era era, int yearOfEra, int dayOfYear) { in dateYearDay() argument
208 return dateYearDay(prolepticYear(era, yearOfEra), dayOfYear); in dateYearDay()
295 public int prolepticYear(Era era, int yearOfEra) { in prolepticYear() argument
296 if (era instanceof MinguoEra == false) { in prolepticYear()
299 return (era == MinguoEra.ROC ? yearOfEra : 1 - yearOfEra); in prolepticYear()
DThaiBuddhistChronology.java212 public ThaiBuddhistDate date(Era era, int yearOfEra, int month, int dayOfMonth) { in date() argument
213 return date(prolepticYear(era, yearOfEra), month, dayOfMonth); in date()
243 public ThaiBuddhistDate dateYearDay(Era era, int yearOfEra, int dayOfYear) { in dateYearDay() argument
244 return dateYearDay(prolepticYear(era, yearOfEra), dayOfYear); in dateYearDay()
331 public int prolepticYear(Era era, int yearOfEra) { in prolepticYear() argument
332 if (era instanceof ThaiBuddhistEra == false) { in prolepticYear()
335 return (era == ThaiBuddhistEra.BE ? yearOfEra : 1 - yearOfEra); in prolepticYear()
DChronology.java311 default ChronoLocalDate date(Era era, int yearOfEra, int month, int dayOfMonth) { in date() argument
312 return date(prolepticYear(era, yearOfEra), month, dayOfMonth); in date()
342 default ChronoLocalDate dateYearDay(Era era, int yearOfEra, int dayOfYear) { in dateYearDay() argument
343 return dateYearDay(prolepticYear(era, yearOfEra), dayOfYear); in dateYearDay()
564 int prolepticYear(Era era, int yearOfEra); in prolepticYear() argument
/libcore/ojluni/src/test/java/time/test/java/time/chrono/
DTestJapaneseChronology.java196 …public void test_transitions(JapaneseEra era, int yearOfEra, int month, int dayOfMonth, int gregor… in test_transitions() argument
197 assertEquals(JAPANESE.prolepticYear(era, yearOfEra), gregorianYear); in test_transitions()
199 JapaneseDate jdate1 = JapaneseDate.of(era, yearOfEra, month, dayOfMonth); in test_transitions()
214 …public void test_firstDayOfEra(JapaneseEra era, int yearOfEra, int dayOfYear, int month, int dayOf… in test_firstDayOfEra() argument
215 JapaneseDate date1 = JAPANESE.dateYearDay(era, yearOfEra, dayOfYear); in test_firstDayOfEra()
216 JapaneseDate date2 = JAPANESE.date(era, yearOfEra, month, dayOfMonth); in test_firstDayOfEra()
221 public void test_invalidDate(JapaneseEra era, int yearOfEra, int month, int dayOfMonth) { in test_invalidDate() argument
222 JapaneseDate jdate = JapaneseDate.of(era, yearOfEra, month, dayOfMonth); in test_invalidDate()
223 …System.out.printf("No DateTimeException with %s %d.%02d.%02d%n", era, yearOfEra, month, dayOfMonth… in test_invalidDate()
227 public void test_invalidEraYear(JapaneseEra era, int yearOfEra) { in test_invalidEraYear() argument
[all …]
DTestJapaneseChronoImpl.java132 for (JapaneseEra era : JapaneseEra.values()) { in test_dayOfYearVsCalendar()
134 JapaneseDate jd = JapaneseChronology.INSTANCE.dateYearDay(era, year, 1); in test_dayOfYearVsCalendar()
141 "different DAY_OF_YEAR values in " + era + ", year: " + year); in test_dayOfYearVsCalendar()
143 "different maximum for DAY_OF_YEAR in " + era + ", year: " + year); in test_dayOfYearVsCalendar()
145 "different minimum for DAY_OF_YEAR in " + era + ", year: " + year); in test_dayOfYearVsCalendar()
/libcore/ojluni/src/test/java/time/tck/java/time/chrono/serial/
DTCKEraSerialization.java113 public void test_eraSerialization(Era era) throws IOException, ClassNotFoundException { in test_eraSerialization() argument
114 assertSerializableSame(era); in test_eraSerialization()
122 for (JapaneseEra era : JapaneseEra.values()) { in test_JapaneseErasSerialization()
123 assertSerializableSame(era); in test_JapaneseErasSerialization()
128 dos.writeByte(era.getValue()); in test_JapaneseErasSerialization()
131 assertSerializedBySer(era, bytes); in test_JapaneseErasSerialization()
/libcore/luni/src/test/java/libcore/java/time/chrono/
DChronologyDisplayNameTest.java63 for (Era era : eras) { in testEras()
64 assertNotNull(era); in testEras()
65 String displayName = era.getDisplayName(TextStyle.FULL, Locale.ENGLISH); in testEras()
68 assertTrue("Era name for " + era + " not unique.", eraNames.add(displayName)); in testEras()
/libcore/ojluni/annotations/hiddenapi/sun/util/calendar/
DLocalGregorianCalendar.java81 private boolean validateEra(sun.util.calendar.Era era) { in validateEra() argument
102 public boolean isLeapYear(sun.util.calendar.Era era, int year) { in isLeapYear() argument
126 public sun.util.calendar.LocalGregorianCalendar.Date setEra(sun.util.calendar.Era era) { in setEra() argument
149 void setLocalEra(sun.util.calendar.Era era) { in setLocalEra() argument
/libcore/ojluni/src/main/java/java/util/
DJapaneseImperialCalendar.java436 int era = internalGet(ERA) + amount; in add() local
437 if (era < 0) { in add()
438 era = 0; in add()
439 } else if (era > eras.length - 1) { in add()
440 era = eras.length - 1; in add()
442 set(ERA, era); in add()
1005 Era era = eras[fieldValue]; in getDisplayName() local
1006 name = (style == SHORT) ? era.getAbbreviation() : era.getName(); in getDisplayName()
1034 Era era = eras[i]; in getDisplayNames() local
1037 names.put(era.getAbbreviation(), i); in getDisplayNames()
[all …]

12