Home
last modified time | relevance | path

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

12

/libcore/ojluni/src/main/java/java/time/
DPeriod.java153 private final int years; field in Period
173 public static Period ofYears(int years) { in ofYears() argument
174 return create(years, 0, 0); in ofYears()
228 public static Period of(int years, int months, int days) { in of() argument
229 return create(years, months, days); in of()
262 int years = 0; in from() local
268 years = Math.toIntExact(unitAmount); in from()
277 return create(years, months, days); in from()
331 int years = parseNumber(text, yearStart, yearEnd, negate); in parse() local
336 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.java1621 public ZonedDateTime plusYears(long years) { in plusYears() argument
1622 return resolveLocal(dateTime.plusYears(years)); in plusYears()
1866 public ZonedDateTime minusYears(long years) { in minusYears() argument
1867 … return (years == Long.MIN_VALUE ? plusYears(Long.MAX_VALUE).plusYears(1) : plusYears(-years)); in minusYears()
DLocalDateTime.java1208 public LocalDateTime plusYears(long years) { in plusYears() argument
1209 LocalDate newDate = date.plusYears(years); in plusYears()
1406 public LocalDateTime minusYears(long years) { in minusYears() argument
1407 … return (years == Long.MIN_VALUE ? plusYears(Long.MAX_VALUE).plusYears(1) : plusYears(-years)); in minusYears()
DLocalDate.java1710 long years = totalMonths / 12; // safe in until() local
1712 return Period.of(Math.toIntExact(years), months, days); in until()
/libcore/ojluni/src/main/java/java/time/chrono/
DChronoPeriodImpl.java117 final int years; field in ChronoPeriodImpl
130 ChronoPeriodImpl(Chronology chrono, int years, int months, int days) { in ChronoPeriodImpl() argument
133 this.years = years; in ChronoPeriodImpl()
142 return years; in get()
165 return years == 0 && months == 0 && days == 0; in isZero()
170 return years < 0 || months < 0 || days < 0; in isNegative()
179 Math.addExact(years, amount.years), in plus()
189 Math.subtractExact(years, amount.years), in minus()
219 Math.multiplyExact(years, scalar), in multipliedBy()
229 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.java883 Map<Integer, int[]> years = new HashMap<>(); in loadCalendarData() local
912 years.put(year, months); in loadCalendarData()
937 hijrahEpochMonthStartDays = createEpochMonths(minEpochDay, minYear, maxYear, years); in loadCalendarData()
965 …rivate int[] createEpochMonths(int epochDay, int minYear, int maxYear, Map<Integer, int[]> years) { in createEpochMonths() argument
977 int[] months = years.get(year);// must not be gaps in createEpochMonths()
DChronology.java716 default ChronoPeriod period(int years, int months, int days) { in period() argument
717 return new ChronoPeriodImpl(this, years, months, days); in period()
DMinguoDate.java366 MinguoDate plusYears(long years) { in plusYears() argument
367 return with(isoDate.plusYears(years)); in plusYears()
DThaiBuddhistDate.java366 ThaiBuddhistDate plusYears(long years) { in plusYears() argument
367 return with(isoDate.plusYears(years)); in plusYears()
DIsoChronology.java676 public Period period(int years, int months, int days) { in period() argument
677 return Period.of(years, months, days); in period()
DJapaneseDate.java607 JapaneseDate plusYears(long years) { in plusYears() argument
608 return with(isoDate.plusYears(years)); in plusYears()
/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/src/test/java/time/tck/java/time/chrono/
DCopticDate.java278 private CopticDate plusYears(long years) { in plusYears() argument
279 return plusMonths(Math.multiplyExact(years, 13)); in plusYears()
323 long years = totalMonths / 13; // safe in until() local
325 return Period.of(Math.toIntExact(years), months, days); in until()
/libcore/luni/src/test/java/libcore/javax/xml/datatype/
DDatatypeFactoryTest.java331 public Duration newDuration(boolean isPositive, BigInteger years, in newDuration() argument
334 int y = years == null ? DatatypeConstants.FIELD_UNDEFINED : years.intValue(); in newDuration()
/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.java572 long years = 20L + Year.MAX_VALUE; in test_plusYears_big() local
573 assertEquals(Year.of(-40).plusYears(years), Year.of((int) (-40L + years))); in test_plusYears_big()
704 long years = 20L + Year.MAX_VALUE; in test_minusYears_big() local
705 assertEquals(Year.of(40).minusYears(years), Year.of((int) (40L - years))); in test_minusYears_big()
DTCKLocalDate.java1110 long years = 20L + Year.MAX_VALUE;
1111 LocalDate test = LocalDate.of(-40, 6, 1).plusYears(years);
1112 assertEquals(test, LocalDate.of((int) (-40L + years), 6, 1));
1494 long years = 20L + Year.MAX_VALUE;
1495 LocalDate test = LocalDate.of(40, 6, 1).minusYears(years);
1496 assertEquals(test, LocalDate.of((int) (40L - years), 6, 1));
1946 int years = Math.toIntExact((long) Year.MAX_VALUE - (long) Year.MIN_VALUE);
1947 assertEquals(LocalDate.MIN.until(LocalDate.MAX), Period.of(years, 11, 30));
/libcore/ojluni/src/main/resources/java/time/chrono/
Dhijrah-config-Hijrah-umalqura_islamic-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/ojluni/src/test/
DLICENSE143 years, to give any third party, for a charge no more than your
/libcore/ojluni/src/tools/
DLICENSE143 years, to give any third party, for a charge no more than your
/libcore/
DLICENSE136 b) Accompany it with a written offer, valid for at least three years, to

12