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;
469 if (fieldValues.containsKey(YEAR)) { in resolveDate()
509 addFieldValue(fieldValues, YEAR, chronoDate.get(YEAR)); in resolveProlepticMonth()
525 addFieldValue(fieldValues, YEAR, prolepticYear(eraObj, yoe)); in resolveYearOfEra()
527 if (fieldValues.containsKey(YEAR)) { in resolveYearOfEra()
528 int year = range(YEAR).checkValidIntValue(fieldValues.get(YEAR), YEAR); in resolveYearOfEra()
530 addFieldValue(fieldValues, YEAR, prolepticYear(chronoDate.getEra(), yoe)); in resolveYearOfEra()
538 addFieldValue(fieldValues, YEAR, yoe); in resolveYearOfEra()
541 addFieldValue(fieldValues, YEAR, prolepticYear(eraObj, yoe)); in resolveYearOfEra()
552 int y = range(YEAR).checkValidIntValue(fieldValues.remove(YEAR), YEAR); in resolveYMD()
[all …]
DIsoChronology.java69 import static java.time.temporal.ChronoField.YEAR;
503 addFieldValue(fieldValues, YEAR, Math.floorDiv(pMonth, 12)); in resolveProlepticMonth()
516 Long year = fieldValues.get(YEAR); in resolveYearOfEra()
520 … addFieldValue(fieldValues, YEAR, (year > 0 ? yoeLong: Math.subtractExact(1, yoeLong))); in resolveYearOfEra()
527 …addFieldValue(fieldValues, YEAR, (year == null || year > 0 ? yoeLong: Math.subtractExact(1, yoeLon… in resolveYearOfEra()
530 addFieldValue(fieldValues, YEAR, yoeLong); in resolveYearOfEra()
532 addFieldValue(fieldValues, YEAR, Math.subtractExact(1, yoeLong)); in resolveYearOfEra()
544 int y = YEAR.checkValidIntValue(fieldValues.remove(YEAR)); in resolveYMD()
/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.java53 … expected = ValueRange.of(1, ChronoField.YEAR.range().getMaximum() - YEARS_BEHIND, in test_range()
54 -ChronoField.YEAR.range().getMinimum() + 1 + YEARS_BEHIND); in test_range()
56 case YEAR: in test_range()
58 expected = ValueRange.of(ChronoField.YEAR.range().getMinimum() - YEARS_BEHIND, in test_range()
59 ChronoField.YEAR.range().getMaximum() - YEARS_BEHIND); in test_range()
105 assertEquals(ValueRange.of(1, ChronoField.YEAR.range().getMaximum() - YEARS_BEHIND), in test_MinguoDate_range_yeaOfEra()
107 assertEquals(ValueRange.of(1, -ChronoField.YEAR.range().getMinimum() + 1 + YEARS_BEHIND), in test_MinguoDate_range_yeaOfEra()
115 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/tck/java/time/chrono/
DTCKIsoChronology.java305 {ResolverStyle.STRICT, 0, 2012, null, ChronoField.YEAR, -2011}, in data_resolve_yearOfEra()
306 {ResolverStyle.SMART, 0, 2012, null, ChronoField.YEAR, -2011}, in data_resolve_yearOfEra()
307 {ResolverStyle.LENIENT, 0, 2012, null, ChronoField.YEAR, -2011}, in data_resolve_yearOfEra()
309 {ResolverStyle.STRICT, 1, 2012, null, ChronoField.YEAR, 2012}, in data_resolve_yearOfEra()
310 {ResolverStyle.SMART, 1, 2012, null, ChronoField.YEAR, 2012}, in data_resolve_yearOfEra()
311 {ResolverStyle.LENIENT, 1, 2012, null, ChronoField.YEAR, 2012}, in data_resolve_yearOfEra()
319 {ResolverStyle.SMART, null, 2012, null, ChronoField.YEAR, 2012}, in data_resolve_yearOfEra()
320 {ResolverStyle.LENIENT, null, 2012, null, ChronoField.YEAR, 2012}, in data_resolve_yearOfEra()
324 … {ResolverStyle.LENIENT, null, Integer.MAX_VALUE, null, ChronoField.YEAR, Integer.MAX_VALUE}, in data_resolve_yearOfEra()
327 {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/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/luni/src/test/java/libcore/libcore/icu/
DDateIntervalFormatTest.java35 private static final long YEAR = 12 * MONTH; field in DateIntervalFormatTest
50 c.set(Calendar.YEAR, 2009); in test_formatDateInterval()
87 …assertEquals("1/19/2009 – 2/9/2012", formatDateRange(en_US, tz, fixedTime, fixedTime + 3 * YEAR, F… in test_formatDateInterval()
92 …2009 – 09.02.2012", formatDateRange(de_DE, tz, fixedTime, fixedTime + 3 * YEAR, FORMAT_SHOW_YEAR |… in test_formatDateInterval()
97 …assertEquals("19/1/2009–9/2/2012", formatDateRange(es_US, tz, fixedTime, fixedTime + 3 * YEAR, FOR… in test_formatDateInterval()
102 …assertEquals("19/1/2009–9/2/2012", formatDateRange(es_ES, tz, fixedTime, fixedTime + 3 * YEAR, FOR… in test_formatDateInterval()
116 …009 – Feb 9, 2012", formatDateRange(en_US, tz, fixedTime, fixedTime + 3 * YEAR, FORMAT_SHOW_DATE |… in test_formatDateInterval()
117 …assertEquals("Jan 2009 – Feb 2012", formatDateRange(en_US, tz, fixedTime, fixedTime + 3 * YEAR, FO… in test_formatDateInterval()
118 …uary 19, 2009 – February 9, 2012", formatDateRange(en_US, tz, fixedTime, fixedTime + 3 * YEAR, 0)); in test_formatDateInterval()
119 … February 9, 2012", formatDateRange(en_US, tz, fixedTime, fixedTime + 3 * YEAR, FORMAT_SHOW_WEEKDA… in test_formatDateInterval()
[all …]
/libcore/ojluni/src/test/java/time/test/java/time/chrono/
DTestIsoChronoImpl.java61 import static java.time.temporal.ChronoField.YEAR;
100 cal.set(Calendar.YEAR, isoDate.get(YEAR)); in test_IsoChrono_vsCalendar()
107 … assertEquals(isoDate.get(YEAR_OF_ERA), cal.get(Calendar.YEAR), "Year mismatch in " + isoDate); in test_IsoChrono_vsCalendar()
131 cal.set(Calendar.YEAR, isoDate.get(YEAR)); in test_DayOfWeek_IsoChronology_vsCalendar()
139 … 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/luni/src/main/java/libcore/icu/
DDateUtilsBridge.java169 return c1.get(Calendar.YEAR) != c2.get(Calendar.YEAR) || in fallOnDifferentDates()
179 return c1.get(Calendar.YEAR) == c2.get(Calendar.YEAR); in fallInSameYear()
185 return c.get(Calendar.YEAR) == now.get(Calendar.YEAR); in isThisYear()
/libcore/ojluni/src/test/java/time/tck/java/time/format/
DTCKDateTimeParseResolver.java92 import static java.time.temporal.ChronoField.YEAR;
143 {YEAR, 2012}, in data_resolveOneNoChange()
167 {YEAR, 2012, MONTH_OF_YEAR, 5}, in data_resolveTwoNoChange()
168 {YEAR, 2012, DAY_OF_MONTH, 5}, in data_resolveTwoNoChange()
169 {YEAR, 2012, DAY_OF_WEEK, 5}, in data_resolveTwoNoChange()
170 {YEAR, 2012, ALIGNED_WEEK_OF_YEAR, 5}, in data_resolveTwoNoChange()
171 {YEAR, 2012, ALIGNED_WEEK_OF_MONTH, 5}, in data_resolveTwoNoChange()
172 {YEAR, 2012, IsoFields.QUARTER_OF_YEAR, 3}, in data_resolveTwoNoChange()
173 {YEAR, 2012, MINUTE_OF_HOUR, 5}, in data_resolveTwoNoChange()
174 {YEAR, 2012, SECOND_OF_MINUTE, 5}, in data_resolveTwoNoChange()
[all …]
DTCKDateTimeFormatterBuilder.java67 import static java.time.temporal.ChronoField.YEAR;
112 .parseDefaulting(YEAR, 2012).parseDefaulting(MONTH_OF_YEAR, 6) in test_parseDefaulting_entireDate()
121 .appendValue(YEAR) in test_parseDefaulting_yearOptionalMonthOptionalDay()
203 builder.appendValueReduced(YEAR, 0, 2, 2000); in test_appendValueReduced_int_minWidthTooSmall()
208 builder.appendValueReduced(YEAR, 11, 2, 2000); in test_appendValueReduced_int_minWidthTooBig()
213 builder.appendValueReduced(YEAR, 2, 0, 2000); in test_appendValueReduced_int_maxWidthTooSmall()
218 builder.appendValueReduced(YEAR, 2, 11, 2000); in test_appendValueReduced_int_maxWidthTooBig()
223 builder.appendValueReduced(YEAR, 2, 1, 2000); in test_appendValueReduced_int_maxWidthLessThanMin()
234 builder.appendValueReduced(YEAR, 2, 2, null); in test_appendValueReduced_date_nullDate()
239 builder.appendValueReduced(YEAR, 0, 2, LocalDate.of(2000, 1, 1)); in test_appendValueReduced_date_minWidthTooSmall()
[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/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()
/libcore/ojluni/src/main/java/java/text/
DCalendarBuilder.java82 field[MAX_FIELD + YEAR] += value; in addYear()
105 && field[WEEK_YEAR] > field[YEAR]; in establish()
108 if (!isSet(YEAR)) { in establish()
109 set(YEAR, field[MAX_FIELD + WEEK_YEAR]); in establish()
/libcore/ojluni/src/main/java/java/time/
DYear.java65 import static java.time.temporal.ChronoField.YEAR;
149 .appendValue(YEAR, 4, 10, SignStyle.EXCEEDS_PAD)
220 YEAR.checkValidValue(isoYear); in of()
252 return of(temporal.get(YEAR)); in from()
364 return field == YEAR || field == YEAR_OF_ERA || field == ERA; in isSupported()
494 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;
136 .appendValue(YEAR, 4, 10, SignStyle.EXCEEDS_PAD)
220 YEAR.checkValidValue(year); in of()
254 return of(temporal.get(YEAR), temporal.get(MONTH_OF_YEAR)); in from()
350 return field == YEAR || field == MONTH_OF_YEAR || in isSupported()
485 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.java702 this.set(YEAR, year); in GregorianCalendar()
933 if (field == YEAR) {
934 int year = internalGet(YEAR);
938 set(YEAR, year);
940 set(YEAR, 1 - year);
948 set(YEAR, year);
950 set(YEAR, 1 - year);
958 int year = internalGet(YEAR);
970 set(YEAR, year);
972 set(YEAR, 1 - year);
[all …]
DJapaneseImperialCalendar.java292 LEAST_MAX_VALUES[YEAR] = year; // Max year could be smaller than this value.
419 if (field == YEAR) { in add()
424 set(YEAR, d.getYear()); in add()
432 set(YEAR, d.getYear()); in add()
604 d.setDate(internalGet(YEAR), in roll()
630 case YEAR: in roll()
643 if (year == getMaximum(YEAR)) { in roll()
667 } else if (year == getMinimum(YEAR)) { in roll()
759 if (year == getMaximum(YEAR)) { in roll()
761 } else if (year == getMinimum(YEAR)) { in roll()
[all …]

12345