Home
last modified time | relevance | path

Searched refs:Period (Results 1 – 25 of 31) sorted by relevance

12

/libcore/ojluni/src/test/java/time/tck/java/time/
DTCKPeriod.java70 import java.time.Period;
96 assertPeriod(Period.ofYears(0), 0, 0, 0); in factory_ofYears_int()
97 assertPeriod(Period.ofYears(1), 1, 0, 0); in factory_ofYears_int()
98 assertPeriod(Period.ofYears(234), 234, 0, 0); in factory_ofYears_int()
99 assertPeriod(Period.ofYears(-100), -100, 0, 0); in factory_ofYears_int()
100 assertPeriod(Period.ofYears(Integer.MAX_VALUE), Integer.MAX_VALUE, 0, 0); in factory_ofYears_int()
101 assertPeriod(Period.ofYears(Integer.MIN_VALUE), Integer.MIN_VALUE, 0, 0); in factory_ofYears_int()
109 assertPeriod(Period.ofMonths(0), 0, 0, 0); in factory_ofMonths_int()
110 assertPeriod(Period.ofMonths(1), 0, 1, 0); in factory_ofMonths_int()
111 assertPeriod(Period.ofMonths(234), 0, 234, 0); in factory_ofMonths_int()
[all …]
DTCKYearMonth.java89 import java.time.Period;
794 {YearMonth.of(1, 1), Period.ofYears(1), YearMonth.of(2, 1), null}, in data_plus_TemporalAmount()
795 {YearMonth.of(1, 1), Period.ofYears(-12), YearMonth.of(-11, 1), null}, in data_plus_TemporalAmount()
796 {YearMonth.of(1, 1), Period.ofYears(0), YearMonth.of(1, 1), null}, in data_plus_TemporalAmount()
797 {YearMonth.of(999999999, 12), Period.ofYears(0), YearMonth.of(999999999, 12), null}, in data_plus_TemporalAmount()
798 {YearMonth.of(-999999999, 1), Period.ofYears(0), YearMonth.of(-999999999, 1), null}, in data_plus_TemporalAmount()
799 {YearMonth.of(0, 1), Period.ofYears(-999999999), YearMonth.of(-999999999, 1), null}, in data_plus_TemporalAmount()
800 {YearMonth.of(0, 12), Period.ofYears(999999999), YearMonth.of(999999999, 12), null}, in data_plus_TemporalAmount()
802 {YearMonth.of(1, 1), Period.ofMonths(1), YearMonth.of(1, 2), null}, in data_plus_TemporalAmount()
803 {YearMonth.of(1, 1), Period.ofMonths(-12), YearMonth.of(0, 1), null}, in data_plus_TemporalAmount()
[all …]
DTCKYear.java86 import java.time.Period;
487 {2012, Period.ofYears(0), 2012}, in data_plusValid()
488 {2012, Period.ofYears(1), 2013}, in data_plusValid()
489 {2012, Period.ofYears(2), 2014}, in data_plusValid()
490 {2012, Period.ofYears(-2), 2010}, in data_plusValid()
502 {Period.of(0, 1, 0)}, in data_plusInvalidUnit()
503 {Period.of(0, 0, 1)}, in data_plusInvalidUnit()
504 {Period.of(0, 1, 1)}, in data_plusInvalidUnit()
505 {Period.of(1, 1, 1)}, in data_plusInvalidUnit()
619 {2012, Period.ofYears(0), 2012}, in data_minusValid()
[all …]
DTCKOffsetTime.java104 import java.time.Period;
901 OffsetTime t = TEST_11_30_59_500_PONE.plus(Period.ZERO);
996 OffsetTime t = TEST_11_30_59_500_PONE.minus(Period.ZERO);
/libcore/ojluni/src/test/java/time/test/java/time/
DTestPeriod.java65 import java.time.Period;
77 assertImmutable(Period.class); in test_immutable()
85 assertSame(Period.ZERO, Period.ZERO); in factory_zeroSingleton()
86 assertSame(Period.ofYears(0), Period.ZERO); in factory_zeroSingleton()
87 assertSame(Period.ofMonths(0), Period.ZERO); in factory_zeroSingleton()
88 assertSame(Period.ofDays(0), Period.ZERO); in factory_zeroSingleton()
89 assertSame(Period.of(0, 0, 0), Period.ZERO); in factory_zeroSingleton()
97 Period test5 = Period.ofDays(5); in test_hashCode()
98 Period test6 = Period.ofDays(6); in test_hashCode()
99 Period test5M = Period.ofMonths(5); in test_hashCode()
[all …]
DTestLocalDateTime.java69 import java.time.Period;
224 LocalDateTime t = TEST_2007_07_15_12_30_40_987654321.plus(Period.ZERO); in test_plus_adjuster_zero()
356 LocalDateTime t = TEST_2007_07_15_12_30_40_987654321.minus(Period.ZERO); in test_minus_adjuster_zero()
/libcore/ojluni/src/main/java/java/time/
DPeriod.java129 public final class Period class
135 public static final Period ZERO = new Period(0, 0, 0);
175 public static Period ofYears(int years) { in ofYears()
188 public static Period ofMonths(int months) { in ofMonths()
202 public static Period ofWeeks(int weeks) { in ofWeeks()
215 public static Period ofDays(int days) { in ofDays()
230 public static Period of(int years, int months, int days) { in of()
254 public static Period from(TemporalAmount amount) { in from()
255 if (amount instanceof Period) { in from()
256 return (Period) amount; in from()
[all …]
DSer.java208 ((Period) object).writeExternal(out); in writeInternal()
269 case PERIOD_TYPE: return Period.readExternal(in); in readInternal()
DLocalDate.java1138 if (amountToAdd instanceof Period) { in plus()
1139 Period periodToAdd = (Period) amountToAdd; in plus()
1371 if (amountToSubtract instanceof Period) { in minus()
1372 Period periodToSubtract = (Period) amountToSubtract; in minus()
1656 public Period until(ChronoLocalDate endDateExclusive) { in until()
1670 return Period.of(Math.toIntExact(years), months, days); in until()
DZonedDateTime.java1547 if (amountToAdd instanceof Period) { in plus()
1548 Period periodToAdd = (Period) amountToAdd; in plus()
1799 if (amountToSubtract instanceof Period) { in minus()
1800 Period periodToSubtract = (Period) amountToSubtract; in minus()
DLocalDateTime.java1141 if (amountToAdd instanceof Period) { in plus()
1142 Period periodToAdd = (Period) amountToAdd; in plus()
1360 if (amountToSubtract instanceof Period) { in minus()
1361 Period periodToSubtract = (Period) amountToSubtract; in minus()
/libcore/ojluni/src/test/java/time/tck/java/time/serial/
DTCKPeriodSerialization.java65 import java.time.Period;
76 assertSerializable(Period.ZERO); in test_serialization()
77 assertSerializable(Period.ofDays(1)); in test_serialization()
78 assertSerializable(Period.of(1, 2, 3)); in test_serialization()
83 assertNotSerializable(Period.class); in test_invalid_serialform()
/libcore/luni/src/test/java/libcore/java/time/
DPeriodTest.java19 import java.time.Period;
34 assertSame(IsoChronology.INSTANCE, Period.ZERO.getChronology()); in test_getChronology()
/libcore/ojluni/src/test/java/time/tck/java/time/format/
DTCKInstantPrinterParser.java68 import java.time.Period;
229 assertEquals(f.parse(input).query(DateTimeFormatter.parsedExcessDays()), Period.ZERO); in test_parse_digitsMinusOne()
239 assertEquals(f.parse(input).query(DateTimeFormatter.parsedExcessDays()), Period.ZERO); in test_parse_digitsNine()
258 assertEquals(parsed.query(DateTimeFormatter.parsedExcessDays()), Period.ZERO); in test_parse_endOfDay()
270 assertEquals(parsed.query(DateTimeFormatter.parsedExcessDays()), Period.ZERO); in test_parse_leapSecond()
DTCKDateTimeParseResolver.java101 import java.time.Period;
554 {null, 0, 0, 0, 0, LocalTime.of(0, 0, 0, 0), Period.ZERO}, in data_resolveFourToTime()
555 {null, 1, 0, 0, 0, LocalTime.of(1, 0, 0, 0), Period.ZERO}, in data_resolveFourToTime()
556 {null, 0, 2, 0, 0, LocalTime.of(0, 2, 0, 0), Period.ZERO}, in data_resolveFourToTime()
557 {null, 0, 0, 3, 0, LocalTime.of(0, 0, 3, 0), Period.ZERO}, in data_resolveFourToTime()
558 {null, 0, 0, 0, 4, LocalTime.of(0, 0, 0, 4), Period.ZERO}, in data_resolveFourToTime()
559 {null, 1, 2, 3, 4, LocalTime.of(1, 2, 3, 4), Period.ZERO}, in data_resolveFourToTime()
560 {null, 23, 59, 59, 123456789, LocalTime.of(23, 59, 59, 123456789), Period.ZERO}, in data_resolveFourToTime()
564 … {ResolverStyle.LENIENT, 14, 59, 60, 123456789, LocalTime.of(15, 0, 0, 123456789), Period.ZERO}, in data_resolveFourToTime()
568 …{ResolverStyle.LENIENT, 23, 59, 60, 123456789, LocalTime.of(0, 0, 0, 123456789), Period.ofDays(1)}, in data_resolveFourToTime()
[all …]
/libcore/ojluni/src/main/java/java/time/format/
DParsed.java86 import java.time.Period;
157 Period excessDays = Period.ZERO;
281 updateCheckConflict(cldt.toLocalTime(), Period.ZERO); in resolveFields()
292 updateCheckConflict((LocalTime) resolvedObject, Period.ZERO); in resolveFields()
544 updateCheckConflict(LocalTime.ofNanoOfDay(nod), Period.ofDays(excessDays)); in resolveTime()
550 updateCheckConflict(LocalTime.MIDNIGHT, Period.ofDays(1)); in resolveTime()
554 updateCheckConflict(LocalTime.of(hodVal, mohVal, somVal, nosVal), Period.ZERO); in resolveTime()
563 excessDays = Period.ZERO; in resolvePeriod()
603 private void updateCheckConflict(LocalTime timeToSet, Period periodToSet) { in updateCheckConflict()
DDateTimeFormatter.java80 import java.time.Period;
1308 public static final TemporalQuery<Period> parsedExcessDays() { in parsedExcessDays()
1311 private static final TemporalQuery<Period> PARSED_EXCESS_DAYS = t -> {
1315 return Period.ZERO;
/libcore/ojluni/src/main/java/java/time/temporal/
DTemporalAmount.java66 import java.time.Period;
DTemporalUnit.java67 import java.time.Period;
/libcore/ojluni/src/test/java/time/tck/java/time/chrono/
DTCKChronoPeriod.java71 import java.time.Period;
174 ChronoPeriod isoPeriod = Period.of(2, 3, 4); in test_plus_wrongChrono()
192 ChronoPeriod isoPeriod = Period.of(2, 3, 4); in test_minus_wrongChrono()
274 if (period instanceof Period == false) { in test_toString()
DCopticDate.java70 import java.time.Period;
309 public Period until(ChronoLocalDate endDate) { in until()
324 return Period.of(Math.toIntExact(years), months, days); in until()
/libcore/ojluni/src/main/java/java/time/chrono/
DIsoChronology.java80 import java.time.Period;
583 public Period period(int years, int months, int days) { in period()
584 return Period.of(years, months, days); in period()
DThaiBuddhistDate.java74 import java.time.Period;
427 Period period = isoDate.until(endDate); in until()
DMinguoDate.java74 import java.time.Period;
427 Period period = isoDate.until(endDate); in until()
DJapaneseDate.java77 import java.time.Period;
672 Period period = isoDate.until(endDate); in until()

12