Home
last modified time | relevance | path

Searched refs:YEAR (Results 1 – 25 of 101) sorted by relevance

12345

/libcore/ojluni/src/test/java/time/test/java/time/format/
DTestReducedParser.java65 import static java.time.temporal.ChronoField.YEAR;
115 {YEAR, 2, 2010, "12", -1, IndexOutOfBoundsException.class}, in data_error()
116 {YEAR, 2, 2010, "12", 3, IndexOutOfBoundsException.class}, in data_error()
145 {YEAR, 1, 2010, "-0", 0, 0, null}, in provider_parseAll()
148 {YEAR, 2, 2010, "Xxx12Xxx", 3, 5, 2012}, in provider_parseAll()
149 {YEAR, 2, 2010, "12-45", 0, 2, 2012}, in provider_parseAll()
152 {YEAR, 2, 2010, "A0", 0, 0, null}, in provider_parseAll()
153 {YEAR, 2, 2010, " 1", 0, 0, null}, in provider_parseAll()
154 {YEAR, 2, 2010, "-1", 0, 0, null}, in provider_parseAll()
155 {YEAR, 2, 2010, "-10", 0, 0, null}, in provider_parseAll()
[all …]
DTestReducedPrinter.java62 import static java.time.temporal.ChronoField.YEAR;
98 getFormatter0(YEAR, 2, 2010).formatTo(EMPTY_DTA, buf); in test_print_emptyCalendrical()
104 getFormatter0(YEAR, 2, 2010).formatTo(LocalDate.of(2012, 1, 1), buf); in test_print_append()
181 … getFormatter0(YEAR, minWidth, maxWidth, baseValue).formatTo(new MockFieldValue(YEAR, value), buf); in test_pivot()
188 assertEquals(ex.getMessage().contains(YEAR.toString()), true); in test_pivot()
198 …getFormatterBaseDate(YEAR, minWidth, maxWidth, baseValue).formatTo(new MockFieldValue(YEAR, value)… in test_pivot_baseDate()
205 assertEquals(ex.getMessage().contains(YEAR.toString()), true); in test_pivot_baseDate()
215 DateTimeFormatter f = getFormatterBaseDate(YEAR, 2, 2, 2021); in test_minguoChrono_fixedWidth()
232 DateTimeFormatter f = getFormatterBaseDate(YEAR, 2, 4, 2021); in test_minguoChrono_extendedWidth()
249 assertEquals(getFormatter0(YEAR, 2, 2, 2005).toString(), "ReducedValue(Year,2,2,2005)"); in test_toString()
/libcore/ojluni/src/main/java/java/time/chrono/
DAbstractChronology.java75 import static java.time.temporal.ChronoField.YEAR;
439 if (fieldValues.containsKey(YEAR)) { in resolveDate()
479 addFieldValue(fieldValues, YEAR, chronoDate.get(YEAR)); in resolveProlepticMonth()
495 addFieldValue(fieldValues, YEAR, prolepticYear(eraObj, yoe)); in resolveYearOfEra()
497 if (fieldValues.containsKey(YEAR)) { in resolveYearOfEra()
498 int year = range(YEAR).checkValidIntValue(fieldValues.get(YEAR), YEAR); in resolveYearOfEra()
500 addFieldValue(fieldValues, YEAR, prolepticYear(chronoDate.getEra(), yoe)); in resolveYearOfEra()
508 addFieldValue(fieldValues, YEAR, yoe); in resolveYearOfEra()
511 addFieldValue(fieldValues, YEAR, prolepticYear(eraObj, yoe)); in resolveYearOfEra()
522 int y = range(YEAR).checkValidIntValue(fieldValues.remove(YEAR), YEAR); in resolveYMD()
[all …]
DIsoChronology.java71 import static java.time.temporal.ChronoField.YEAR;
294 YEAR.checkValidValue(prolepticYear); in epochSecond()
597 addFieldValue(fieldValues, YEAR, Math.floorDiv(pMonth, 12)); in resolveProlepticMonth()
610 Long year = fieldValues.get(YEAR); in resolveYearOfEra()
614 … addFieldValue(fieldValues, YEAR, (year > 0 ? yoeLong: Math.subtractExact(1, yoeLong))); in resolveYearOfEra()
621 …addFieldValue(fieldValues, YEAR, (year == null || year > 0 ? yoeLong: Math.subtractExact(1, yoeLon… in resolveYearOfEra()
624 addFieldValue(fieldValues, YEAR, yoeLong); in resolveYearOfEra()
626 addFieldValue(fieldValues, YEAR, Math.subtractExact(1, yoeLong)); in resolveYearOfEra()
638 int y = YEAR.checkValidIntValue(fieldValues.remove(YEAR)); in resolveYMD()
DThaiBuddhistDate.java62 import static java.time.temporal.ChronoField.YEAR;
264 ValueRange range = YEAR.range(); in range()
286 case YEAR: in getLong()
316 case YEAR: in with()
322 case YEAR: in with()
500 out.writeInt(this.get(YEAR)); in writeExternal()
/libcore/luni/src/test/java/libcore/java/time/chrono/
DThaiBuddhistChronologyTest.java54 .of(1, -ChronoField.YEAR.range().getMinimum() + 1 - YEARS_AHEAD, in test_range()
55 ChronoField.YEAR.range().getMaximum() + YEARS_AHEAD); in test_range()
57 case YEAR: in test_range()
59 expected = ValueRange.of(ChronoField.YEAR.range().getMinimum() + YEARS_AHEAD, in test_range()
60 ChronoField.YEAR.range().getMaximum() + YEARS_AHEAD); in test_range()
107 assertEquals(ValueRange.of(1, ChronoField.YEAR.range().getMaximum() + YEARS_AHEAD), in test_ThaiBuddhistDate_range_yeaOfEra()
109 assertEquals(ValueRange.of(1, -ChronoField.YEAR.range().getMinimum() + 1 - YEARS_AHEAD), in test_ThaiBuddhistDate_range_yeaOfEra()
117 assertEquals(10, date.getLong(ChronoField.YEAR)); in test_ThaiBuddhistDate_getLong()
DMinguoChronologyTest.java55 … expected = ValueRange.of(1, ChronoField.YEAR.range().getMaximum() - YEARS_BEHIND, in test_range()
56 -ChronoField.YEAR.range().getMinimum() + 1 + YEARS_BEHIND); in test_range()
58 case YEAR: in test_range()
60 expected = ValueRange.of(ChronoField.YEAR.range().getMinimum() - YEARS_BEHIND, in test_range()
61 ChronoField.YEAR.range().getMaximum() - YEARS_BEHIND); in test_range()
107 assertEquals(ValueRange.of(1, ChronoField.YEAR.range().getMaximum() - YEARS_BEHIND), in test_MinguoDate_range_yeaOfEra()
109 assertEquals(ValueRange.of(1, -ChronoField.YEAR.range().getMinimum() + 1 + YEARS_BEHIND), in test_MinguoDate_range_yeaOfEra()
117 assertEquals(10, date.getLong(ChronoField.YEAR)); in test_MinguoDate_getLong()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/
DCalendarTest.java44 cal.set(Calendar.YEAR, 2002); in test_setII()
49 cal.set(Calendar.YEAR, 2002); in test_setII()
55 cal.set(Calendar.YEAR, 2002); in test_setII()
73 cal.set(Calendar.YEAR, 2002); in test_setII()
79 cal.set(Calendar.YEAR, 2002); in test_setII()
85 cal.set(Calendar.YEAR, 2002); in test_setII()
91 cal.set(Calendar.YEAR, 2002); in test_setII()
97 cal.set(Calendar.YEAR, 2002); in test_setII()
103 cal.set(Calendar.YEAR, 2002); in test_setII()
109 cal.set(Calendar.YEAR, 2002); in test_setII()
[all …]
DGregorianCalendarTest.java66 1972, gc.get(Calendar.YEAR)); in test_ConstructorIII()
84 1972, gc.get(Calendar.YEAR)); in test_ConstructorIIIII()
100 5983, gc.get(Calendar.YEAR)); in test_ConstructorIIIII()
113 1972, gc.get(Calendar.YEAR)); in test_ConstructorIIIIII()
167 c1.set(Calendar.YEAR, 1999); in test_ConstructorLjava_util_TimeZone()
206 gc1.add(GregorianCalendar.YEAR, 1); in test_addII()
208 1999, gc1.get(GregorianCalendar.YEAR)); in test_addII()
212 assertEquals("Wrong result year 1", 2000, gc1.get(Calendar.YEAR)); in test_addII()
217 gc1.add(Calendar.YEAR, -1); in test_addII()
218 assertEquals("Wrong result year 2", 1999, gc1.get(Calendar.YEAR)); in test_addII()
[all …]
/libcore/ojluni/src/test/java/time/test/java/time/temporal/
DTestDateTimeBuilderCombinations.java72 import static java.time.temporal.ChronoField.YEAR;
94 …{YEAR, 2012, MONTH_OF_YEAR, 6, DAY_OF_MONTH, 3, null, null, LocalDate.class, LocalDate.of(2012, 6,… in data_combine()
96 …{YEAR, 2012, ALIGNED_WEEK_OF_YEAR, 6, DAY_OF_WEEK, 3, null, null, LocalDate.class, LocalDate.of(20… in data_combine()
97 … {YEAR, 2012, DAY_OF_YEAR, 155, null, null, null, null, LocalDate.class, LocalDate.of(2012, 6, 3)}, in data_combine()
99 {YEAR, 2012, MONTH_OF_YEAR, 6, null, null, null, null, LocalDate.class, null}, in data_combine()
170 {YEAR, 2127, YEAR, 2127}, in data_normalized()
180 {PROLEPTIC_MONTH, 27, YEAR, 2}, in data_normalized()
/libcore/ojluni/src/test/java/time/test/java/time/chrono/
DTestIsoChronoImpl.java61 import static java.time.temporal.ChronoField.YEAR;
103 cal.set(Calendar.YEAR, isoDate.get(YEAR)); in test_IsoChrono_vsCalendar()
110 … assertEquals(isoDate.get(YEAR_OF_ERA), cal.get(Calendar.YEAR), "Year mismatch in " + isoDate); in test_IsoChrono_vsCalendar()
134 cal.set(Calendar.YEAR, isoDate.get(YEAR)); in test_DayOfWeek_IsoChronology_vsCalendar()
142 … assertEquals(isoDate.get(YEAR_OF_ERA), cal.get(Calendar.YEAR), "Year mismatch in " + isoDate); in test_DayOfWeek_IsoChronology_vsCalendar()
DTestThaiBuddhistChronoImpl.java103 cal.set(Calendar.YEAR, thaiDate.get(ChronoField.YEAR)); in test_ThaiBuddhistChrono_vsCalendar()
110 …assertEquals(thaiDate.get(ChronoField.YEAR_OF_ERA), cal.get(Calendar.YEAR), "Year mismatch in " + … in test_ThaiBuddhistChrono_vsCalendar()
119 … cal.get(Calendar.YEAR), cal.get(Calendar.MONTH) + 1, cal.get(Calendar.DAY_OF_MONTH)); in calToString()
/libcore/ojluni/src/test/java/time/tck/java/time/chrono/
DTCKIsoChronology.java313 {ResolverStyle.STRICT, 0, 2012, null, ChronoField.YEAR, -2011}, in data_resolve_yearOfEra()
314 {ResolverStyle.SMART, 0, 2012, null, ChronoField.YEAR, -2011}, in data_resolve_yearOfEra()
315 {ResolverStyle.LENIENT, 0, 2012, null, ChronoField.YEAR, -2011}, in data_resolve_yearOfEra()
317 {ResolverStyle.STRICT, 1, 2012, null, ChronoField.YEAR, 2012}, in data_resolve_yearOfEra()
318 {ResolverStyle.SMART, 1, 2012, null, ChronoField.YEAR, 2012}, in data_resolve_yearOfEra()
319 {ResolverStyle.LENIENT, 1, 2012, null, ChronoField.YEAR, 2012}, in data_resolve_yearOfEra()
327 {ResolverStyle.SMART, null, 2012, null, ChronoField.YEAR, 2012}, in data_resolve_yearOfEra()
328 {ResolverStyle.LENIENT, null, 2012, null, ChronoField.YEAR, 2012}, in data_resolve_yearOfEra()
332 … {ResolverStyle.LENIENT, null, Integer.MAX_VALUE, null, ChronoField.YEAR, Integer.MAX_VALUE}, in data_resolve_yearOfEra()
335 {ResolverStyle.STRICT, null, 2012, 2012, ChronoField.YEAR, 2012}, in data_resolve_yearOfEra()
[all …]
DTCKThaiBuddhistChronology.java62 import static java.time.temporal.ChronoField.YEAR;
316 … jdate = jdate.with(ChronoField.YEAR, expectedProlepticYear).with(ChronoField.MONTH_OF_YEAR, 2); in test_isLeapYear()
386 ThaiBuddhistDate test = base.with(YEAR, 2554); in test_withYear_BE()
508 assertEquals(ThaiBuddhistChronology.INSTANCE.range(YEAR), ValueRange.of(minYear, maxYear)); in test_Chrono_range()
556 {ResolverStyle.STRICT, 0, 2012, null, ChronoField.YEAR, -2011}, in data_resolve_yearOfEra()
557 {ResolverStyle.SMART, 0, 2012, null, ChronoField.YEAR, -2011}, in data_resolve_yearOfEra()
558 {ResolverStyle.LENIENT, 0, 2012, null, ChronoField.YEAR, -2011}, in data_resolve_yearOfEra()
560 {ResolverStyle.STRICT, 1, 2012, null, ChronoField.YEAR, 2012}, in data_resolve_yearOfEra()
561 {ResolverStyle.SMART, 1, 2012, null, ChronoField.YEAR, 2012}, in data_resolve_yearOfEra()
562 {ResolverStyle.LENIENT, 1, 2012, null, ChronoField.YEAR, 2012}, in data_resolve_yearOfEra()
[all …]
DTCKMinguoChronology.java309 … minguo = minguo.with(ChronoField.YEAR, expectedProlepticYear).with(ChronoField.MONTH_OF_YEAR, 2); in test_isLeapYear()
580 {ResolverStyle.STRICT, 0, 2012, null, ChronoField.YEAR, -2011}, in data_resolve_yearOfEra()
581 {ResolverStyle.SMART, 0, 2012, null, ChronoField.YEAR, -2011}, in data_resolve_yearOfEra()
582 {ResolverStyle.LENIENT, 0, 2012, null, ChronoField.YEAR, -2011}, in data_resolve_yearOfEra()
584 {ResolverStyle.STRICT, 1, 2012, null, ChronoField.YEAR, 2012}, in data_resolve_yearOfEra()
585 {ResolverStyle.SMART, 1, 2012, null, ChronoField.YEAR, 2012}, in data_resolve_yearOfEra()
586 {ResolverStyle.LENIENT, 1, 2012, null, ChronoField.YEAR, 2012}, in data_resolve_yearOfEra()
594 {ResolverStyle.SMART, null, 2012, null, ChronoField.YEAR, 2012}, in data_resolve_yearOfEra()
595 {ResolverStyle.LENIENT, null, 2012, null, ChronoField.YEAR, 2012}, in data_resolve_yearOfEra()
599 … {ResolverStyle.LENIENT, null, Integer.MAX_VALUE, null, ChronoField.YEAR, Integer.MAX_VALUE}, in data_resolve_yearOfEra()
[all …]
/libcore/luni/src/test/java/libcore/java/util/
DCalendarBuilderTest.java156 builder.set(Calendar.YEAR, 2000); in test_set()
159 expected.set(Calendar.YEAR, 2000); in test_set()
178 builder.set(Calendar.YEAR, 2000); in test_set_after_setInstant()
186 builder.setFields(Calendar.YEAR, 2000, Calendar.MONTH, Calendar.FEBRUARY); in test_setFields()
189 expected.set(Calendar.YEAR, 2000); in test_setFields()
212 new Calendar.Builder().setFields(Calendar.YEAR); in test_setFields_oddNumberOfArguments()
220 builder.setFields(Calendar.YEAR, 2000); in test_setFields_after_setInstant()
238 builder.set(Calendar.YEAR, 2000); in test_setInstant_after_set()
DDateTest.java51 c.set(Calendar.YEAR, 21); in test_toGMTString_us()
57 c.set(Calendar.YEAR, 321); in test_toGMTString_us()
70 c.set(Calendar.YEAR, 21); in test_toGMTString_nonUs()
76 c.set(Calendar.YEAR, 321); in test_toGMTString_nonUs()
/libcore/ojluni/src/test/java/util/GregorianCalendar/
DGregorianCalendarTest.java63 if (!((y = gc.get(java.util.Calendar.YEAR)) == (date.getYear()+1900) && in testGregorianCalendar()
113 delta = getDelta(gc.get(java.util.Calendar.YEAR)); in testGregorianCalendar()
121 delta = getDelta(gc.get(java.util.Calendar.YEAR)); in testGregorianCalendar()
146 delta = getDelta(gc.get(java.util.Calendar.YEAR)); in testGregorianCalendar()
153 delta = getDelta(gc.get(java.util.Calendar.YEAR)) * 60; in testGregorianCalendar()
160 delta = getDelta(gc.get(java.util.Calendar.YEAR)) * 60 * 60; in testGregorianCalendar()
/libcore/ojluni/src/main/java/java/text/
DCalendarBuilder.java83 field[MAX_FIELD + YEAR] += value; in addYear()
106 && field[WEEK_YEAR] > field[YEAR]; in establish()
109 if (!isSet(YEAR)) { in establish()
110 set(YEAR, field[MAX_FIELD + WEEK_YEAR]); in establish()
/libcore/ojluni/src/test/java/time/tck/java/time/format/
DTCKDateTimeParseResolver.java92 import static java.time.temporal.ChronoField.YEAR;
146 {YEAR, 2012}, in data_resolveOneNoChange()
170 {YEAR, 2012, MONTH_OF_YEAR, 5}, in data_resolveTwoNoChange()
171 {YEAR, 2012, DAY_OF_MONTH, 5}, in data_resolveTwoNoChange()
172 {YEAR, 2012, DAY_OF_WEEK, 5}, in data_resolveTwoNoChange()
173 {YEAR, 2012, ALIGNED_WEEK_OF_YEAR, 5}, in data_resolveTwoNoChange()
174 {YEAR, 2012, ALIGNED_WEEK_OF_MONTH, 5}, in data_resolveTwoNoChange()
175 {YEAR, 2012, IsoFields.QUARTER_OF_YEAR, 3}, in data_resolveTwoNoChange()
176 {YEAR, 2012, MINUTE_OF_HOUR, 5}, in data_resolveTwoNoChange()
177 {YEAR, 2012, SECOND_OF_MINUTE, 5}, in data_resolveTwoNoChange()
[all …]
DTCKDateTimeFormatter.java67 import static java.time.temporal.ChronoField.YEAR;
176 .appendValue(YEAR).appendLiteral('-').appendValue(MONTH_OF_YEAR).appendLiteral('-') in test_resolverFields_selectOneDateResolveYMD()
178 DateTimeFormatter f = base.withResolverFields(YEAR, MONTH_OF_YEAR, DAY_OF_MONTH); in test_resolverFields_selectOneDateResolveYMD()
192 .appendValue(YEAR).appendLiteral('-').appendValue(MONTH_OF_YEAR).appendLiteral('-') in test_resolverFields_selectOneDateResolveYD()
194 DateTimeFormatter f = base.withResolverFields(YEAR, DAY_OF_YEAR); in test_resolverFields_selectOneDateResolveYD()
195 Set<TemporalField> expected = new HashSet<>(Arrays.asList(YEAR, DAY_OF_YEAR)); in test_resolverFields_selectOneDateResolveYD()
211 .appendValue(YEAR).appendLiteral('-').appendValue(DAY_OF_YEAR).appendLiteral('-') in test_resolverFields_ignoreCrossCheck()
213 DateTimeFormatter f = base.withResolverFields(YEAR, DAY_OF_YEAR); in test_resolverFields_ignoreCrossCheck()
227 .appendValue(YEAR).toFormatter().withResolverFields(); in test_resolverFields_emptyList()
229 assertEquals(parsed.isSupported(YEAR), false); // not in the list of resolverFields in test_resolverFields_emptyList()
[all …]
/libcore/ojluni/src/main/java/java/time/
DYear.java65 import static java.time.temporal.ChronoField.YEAR;
151 .appendValue(YEAR, 1, 10, SignStyle.NORMAL)
222 YEAR.checkValidValue(isoYear); in of()
254 return of(temporal.get(YEAR)); in from()
365 return field == YEAR || field == YEAR_OF_ERA || field == ERA; in isSupported()
495 case YEAR: return year; in getLong()
619 case YEAR: return Year.of((int) newValue); in with()
729 return of(YEAR.checkValidIntValue(year + yearsToAdd)); // overflow safe in plusYears()
856 return temporal.with(YEAR, year); in adjustInto()
DYearMonth.java67 import static java.time.temporal.ChronoField.YEAR;
137 .appendValue(YEAR, 4, 10, SignStyle.EXCEEDS_PAD)
221 YEAR.checkValidValue(year); in of()
255 return of(temporal.get(YEAR), temporal.get(MONTH_OF_YEAR)); in from()
351 return field == YEAR || field == MONTH_OF_YEAR || in isSupported()
486 case YEAR: return year; in getLong()
684 case YEAR: return withYear((int) newValue); in with()
703 YEAR.checkValidValue(year); in withYear()
827 int newYear = YEAR.checkValidIntValue(year + yearsToAdd); // safe overflow in plusYears()
846 int newYear = YEAR.checkValidIntValue(Math.floorDiv(calcMonths, 12)); in plusMonths()
/libcore/ojluni/src/main/java/java/util/
DGregorianCalendar.java703 this.set(YEAR, year); in GregorianCalendar()
934 if (field == YEAR) {
935 int year = internalGet(YEAR);
939 set(YEAR, year);
941 set(YEAR, 1 - year);
949 set(YEAR, year);
951 set(YEAR, 1 - year);
959 int year = internalGet(YEAR);
971 set(YEAR, year);
973 set(YEAR, 1 - year);
[all …]
DJapaneseImperialCalendar.java291 LEAST_MAX_VALUES[YEAR] = year; // Max year could be smaller than this value.
421 if (field == YEAR) { in add()
426 set(YEAR, d.getYear()); in add()
434 set(YEAR, d.getYear()); in add()
608 d.setDate(internalGet(YEAR), in roll()
634 case YEAR: in roll()
647 if (year == getMaximum(YEAR)) { in roll()
671 } else if (year == getMinimum(YEAR)) { in roll()
763 if (year == getMaximum(YEAR)) { in roll()
765 } else if (year == getMinimum(YEAR)) { in roll()
[all …]

12345