Home
last modified time | relevance | path

Searched refs:years (Results 1 – 23 of 23) sorted by relevance

/libcore/ojluni/src/main/java/java/time/
DPeriod.java155 private final int years; field in Period
175 public static Period ofYears(int years) { in ofYears() argument
176 return create(years, 0, 0); in ofYears()
230 public static Period of(int years, int months, int days) { in of() argument
231 return create(years, months, days); in of()
264 int years = 0; in from() local
270 years = Math.toIntExact(unitAmount); in from()
279 return create(years, months, days); in from()
333 int years = parseNumber(text, yearMatch, negate); in parse() local
338 return create(years, months, days); in parse()
[all …]
DOffsetDateTime.java1210 public OffsetDateTime plusYears(long years) { in plusYears() argument
1211 return with(dateTime.plusYears(years), offset); in plusYears()
1399 public OffsetDateTime minusYears(long years) { in minusYears() argument
1400 … return (years == Long.MIN_VALUE ? plusYears(Long.MAX_VALUE).plusYears(1) : plusYears(-years)); in minusYears()
DZonedDateTime.java1623 public ZonedDateTime plusYears(long years) { in plusYears() argument
1624 return resolveLocal(dateTime.plusYears(years)); in plusYears()
1864 public ZonedDateTime minusYears(long years) { in minusYears() argument
1865 … return (years == Long.MIN_VALUE ? plusYears(Long.MAX_VALUE).plusYears(1) : plusYears(-years)); in minusYears()
DLocalDateTime.java1214 public LocalDateTime plusYears(long years) { in plusYears() argument
1215 LocalDate newDate = date.plusYears(years); in plusYears()
1413 public LocalDateTime minusYears(long years) { in minusYears() argument
1414 … return (years == Long.MIN_VALUE ? plusYears(Long.MAX_VALUE).plusYears(1) : plusYears(-years)); in minusYears()
DLocalDate.java1668 long years = totalMonths / 12; // safe in until() local
1670 return Period.of(Math.toIntExact(years), months, days); in until()
/libcore/ojluni/src/main/java/java/time/chrono/
DChronoPeriodImpl.java118 final int years; field in ChronoPeriodImpl
131 ChronoPeriodImpl(Chronology chrono, int years, int months, int days) { in ChronoPeriodImpl() argument
134 this.years = years; in ChronoPeriodImpl()
143 return years; in get()
166 return years == 0 && months == 0 && days == 0; in isZero()
171 return years < 0 || months < 0 || days < 0; in isNegative()
180 Math.addExact(years, amount.years), in plus()
190 Math.subtractExact(years, amount.years), in minus()
221 Math.multiplyExact(years, scalar), in multipliedBy()
231 long totalMonths = years * monthRange + months; in normalized()
[all …]
DHijrahDate.java520 HijrahDate plusYears(long years) { in plusYears() argument
521 if (years == 0) { in plusYears()
524 int newYear = Math.addExact(this.prolepticYear, (int)years); in plusYears()
600 long years = totalMonths / 12; // safe in until() local
602 return getChronology().period(Math.toIntExact(years), months, days); in until()
DHijrahChronology.java903 Map<Integer, int[]> years = new HashMap<>(); in loadCalendarData() local
932 years.put(year, months); in loadCalendarData()
957 hijrahEpochMonthStartDays = createEpochMonths(minEpochDay, minYear, maxYear, years); in loadCalendarData()
985 …rivate int[] createEpochMonths(int epochDay, int minYear, int maxYear, Map<Integer, int[]> years) { in createEpochMonths() argument
997 int[] months = years.get(year);// must not be gaps in createEpochMonths()
DChronology.java704 default ChronoPeriod period(int years, int months, int days) { in period() argument
705 return new ChronoPeriodImpl(this, years, months, days); in period()
DThaiBuddhistDate.java366 ThaiBuddhistDate plusYears(long years) { in plusYears() argument
367 return with(isoDate.plusYears(years)); in plusYears()
DMinguoDate.java366 MinguoDate plusYears(long years) { in plusYears() argument
367 return with(isoDate.plusYears(years)); in plusYears()
DIsoChronology.java583 public Period period(int years, int months, int days) { in period() argument
584 return Period.of(years, months, days); in period()
DJapaneseDate.java611 JapaneseDate plusYears(long years) { in plusYears() argument
612 return with(isoDate.plusYears(years)); in plusYears()
/libcore/ojluni/src/test/java/time/tck/java/time/chrono/
DCopticDate.java277 private CopticDate plusYears(long years) { in plusYears() argument
278 return plusMonths(Math.multiplyExact(years, 13)); in plusYears()
322 long years = totalMonths / 13; // safe in until() local
324 return Period.of(Math.toIntExact(years), months, days); in until()
/libcore/luni/src/main/java/javax/xml/datatype/
DDatatypeFactory.java233 final BigInteger years, in newDuration() argument
270 final int years, in newDuration() argument
278 …BigInteger realYears = (years != DatatypeConstants.FIELD_UNDEFINED) ? BigInteger.valueOf((long) ye… in newDuration()
DDuration.java892 BigInteger years = (BigInteger) getField(DatatypeConstants.YEARS); in toString() local
893 if (years != null) { in toString()
894 buf.append(years).append('Y'); in toString()
/libcore/ojluni/annotations/hiddenapi/java/time/
DOffsetDateTime.java281 public java.time.OffsetDateTime plusYears(long years) { in plusYears() argument
322 public java.time.OffsetDateTime minusYears(long years) { in minusYears() argument
/libcore/ojluni/src/test/java/time/tck/java/time/
DTCKYear.java548 long years = 20L + Year.MAX_VALUE; in test_plusYears_big() local
549 assertEquals(Year.of(-40).plusYears(years), Year.of((int) (-40L + years))); in test_plusYears_big()
680 long years = 20L + Year.MAX_VALUE; in test_minusYears_big() local
681 assertEquals(Year.of(40).minusYears(years), Year.of((int) (40L - years))); in test_minusYears_big()
DTCKLocalDate.java1065 long years = 20L + Year.MAX_VALUE;
1066 LocalDate test = LocalDate.of(-40, 6, 1).plusYears(years);
1067 assertEquals(test, LocalDate.of((int) (-40L + years), 6, 1));
1425 long years = 20L + Year.MAX_VALUE;
1426 LocalDate test = LocalDate.of(40, 6, 1).minusYears(years);
1427 assertEquals(test, LocalDate.of((int) (40L - years), 6, 1));
1877 int years = Math.toIntExact((long) Year.MAX_VALUE - (long) Year.MIN_VALUE);
1878 assertEquals(LocalDate.MIN.until(LocalDate.MAX), Period.of(years, 11, 30));
/libcore/ojluni/src/main/resources/
Dhijrah-config-umalqura.properties47 # * Each line defines a year. The years must be in chronological
/libcore/ojluni/src/test/java/time/test/java/time/chrono/
DTestUmmAlQuraChronology.java325 …st_diffBetweenDates(ChronoLocalDate from, ChronoLocalDate to, long days, long months, long years) { in test_diffBetweenDates() argument
328 assertEquals(from.until(to, ChronoUnit.YEARS), years); in test_diffBetweenDates() local
/libcore/
DLICENSE136 b) Accompany it with a written offer, valid for at least three years, to
/libcore/ojluni/
DNOTICE422 b) Accompany it with a written offer, valid for at least three years, to