/libcore/ojluni/src/test/java/time/test/java/time/ |
D | MockSimplePeriod.java | 91 private final long amount; field in MockSimplePeriod 107 public static MockSimplePeriod of(long amount, TemporalUnit unit) { in of() argument 108 return new MockSimplePeriod(amount, unit); in of() 111 private MockSimplePeriod(long amount, TemporalUnit unit) { in MockSimplePeriod() argument 116 this.amount = amount; in MockSimplePeriod() 132 return amount; in getAmount() 142 return temporal.plus(amount, unit); in addTo() 147 return temporal.minus(amount, unit); in subtractFrom() 156 return Long.compare(amount, otherPeriod.amount); in compareTo() 166 return this.amount == other.amount && in equals() [all …]
|
/libcore/ojluni/src/main/java/java/time/temporal/ |
D | Temporal.java | 261 default Temporal plus(TemporalAmount amount) { in plus() argument 262 return amount.addTo(this); in plus() 333 default Temporal minus(TemporalAmount amount) { in minus() argument 334 return amount.subtractFrom(this); in minus()
|
D | TemporalUnit.java | 227 <R extends Temporal> R addTo(R temporal, long amount); in addTo() argument
|
/libcore/ojluni/src/main/java/java/time/chrono/ |
D | ChronoPeriodImpl.java | 177 ChronoPeriodImpl amount = validateAmount(amountToAdd); in plus() local 180 Math.addExact(years, amount.years), in plus() 181 Math.addExact(months, amount.months), in plus() 182 Math.addExact(days, amount.days)); in plus() 187 ChronoPeriodImpl amount = validateAmount(amountToSubtract); in minus() local 190 Math.subtractExact(years, amount.years), in minus() 191 Math.subtractExact(months, amount.months), in minus() 192 Math.subtractExact(days, amount.days)); in minus() 201 private ChronoPeriodImpl validateAmount(TemporalAmount amount) { in validateAmount() argument 202 Objects.requireNonNull(amount, "amount"); in validateAmount() [all …]
|
D | ChronoLocalDateTimeImpl.java | 377 long amount = end.getLong(EPOCH_DAY) - date.getLong(EPOCH_DAY); in until() local 379 case NANOS: amount = Math.multiplyExact(amount, NANOS_PER_DAY); break; in until() 380 case MICROS: amount = Math.multiplyExact(amount, MICROS_PER_DAY); break; in until() 381 case MILLIS: amount = Math.multiplyExact(amount, MILLIS_PER_DAY); break; in until() 382 case SECONDS: amount = Math.multiplyExact(amount, SECONDS_PER_DAY); break; in until() 383 case MINUTES: amount = Math.multiplyExact(amount, MINUTES_PER_DAY); break; in until() 384 case HOURS: amount = Math.multiplyExact(amount, HOURS_PER_DAY); break; in until() 385 case HALF_DAYS: amount = Math.multiplyExact(amount, 2); break; in until() 387 return Math.addExact(amount, time.until(end.toLocalTime(), unit)); in until()
|
D | ChronoLocalDate.java | 448 default ChronoLocalDate plus(TemporalAmount amount) { in plus() argument 449 return ChronoLocalDateImpl.ensureValid(getChronology(), Temporal.super.plus(amount)); in plus() 471 default ChronoLocalDate minus(TemporalAmount amount) { in minus() argument 472 return ChronoLocalDateImpl.ensureValid(getChronology(), Temporal.super.minus(amount)); in minus()
|
D | ChronoLocalDateTime.java | 283 default ChronoLocalDateTime<D> plus(TemporalAmount amount) { in plus() argument 284 return ChronoLocalDateTimeImpl.ensureValid(getChronology(), Temporal.super.plus(amount)); in plus() 301 default ChronoLocalDateTime<D> minus(TemporalAmount amount) { in minus() argument 302 return ChronoLocalDateTimeImpl.ensureValid(getChronology(), Temporal.super.minus(amount)); in minus()
|
D | ChronoLocalDateImpl.java | 191 public D plus(TemporalAmount amount) { in plus() argument 192 return (D) ChronoLocalDate.super.plus(amount); in plus() 218 public D minus(TemporalAmount amount) { in minus() argument 219 return (D) ChronoLocalDate.super.minus(amount); in minus()
|
D | ChronoZonedDateTime.java | 430 default ChronoZonedDateTime<D> plus(TemporalAmount amount) { in plus() argument 431 return ChronoZonedDateTimeImpl.ensureValid(getChronology(), Temporal.super.plus(amount)); in plus() 448 default ChronoZonedDateTime<D> minus(TemporalAmount amount) { in minus() argument 449 return ChronoZonedDateTimeImpl.ensureValid(getChronology(), Temporal.super.minus(amount)); in minus()
|
D | ThaiBuddhistDate.java | 350 public ThaiBuddhistDate plus(TemporalAmount amount) { in plus() argument 351 return super.plus(amount); in plus() 360 public ThaiBuddhistDate minus(TemporalAmount amount) { in minus() argument 361 return super.minus(amount); in minus()
|
D | MinguoDate.java | 350 public MinguoDate plus(TemporalAmount amount) { in plus() argument 351 return super.plus(amount); in plus() 360 public MinguoDate minus(TemporalAmount amount) { in minus() argument 361 return super.minus(amount); in minus()
|
/libcore/ojluni/src/main/java/java/time/ |
D | LocalDateTime.java | 1680 long amount = date.daysUntil(end.date); in until() local 1681 if (amount == 0) { in until() 1685 if (amount > 0) { in until() 1686 amount--; // safe in until() 1689 amount++; // safe in until() 1694 amount = Math.multiplyExact(amount, NANOS_PER_DAY); in until() 1697 amount = Math.multiplyExact(amount, MICROS_PER_DAY); in until() 1701 amount = Math.multiplyExact(amount, MILLIS_PER_DAY); in until() 1705 amount = Math.multiplyExact(amount, SECONDS_PER_DAY); in until() 1709 amount = Math.multiplyExact(amount, MINUTES_PER_DAY); in until() [all …]
|
D | Period.java | 254 public static Period from(TemporalAmount amount) { in from() argument 255 if (amount instanceof Period) { in from() 256 return (Period) amount; in from() 258 if (amount instanceof ChronoPeriod) { in from() 259 if (IsoChronology.INSTANCE.equals(((ChronoPeriod) amount).getChronology()) == false) { in from() 260 throw new DateTimeException("Period requires ISO chronology: " + amount); in from() 263 Objects.requireNonNull(amount, "amount"); in from() 267 for (TemporalUnit unit : amount.getUnits()) { in from() 268 long unitAmount = amount.get(unit); in from()
|
D | DayOfWeek.java | 366 int amount = (int) (days % 7); in plus() local 367 return ENUMS[(ordinal() + (amount + 7)) % 7]; in plus()
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/org/apache/harmony/kernel/dalvik/ |
D | ThreadsTest.java | 156 private final long amount; field in ThreadsTest.Parker 183 this.amount = absolute ? parkMillis : parkMillis * NANOS_PER_MILLI; in Parker() 197 long amount = this.amount; in run() local 203 UNSAFE.park(true, start + amount); in run() 205 UNSAFE.park(false, amount); in run()
|
/libcore/ojluni/src/main/java/java/util/ |
D | GregorianCalendar.java | 919 public void add(int field, int amount) { 922 if (amount == 0) { 936 year += amount; 946 year -= amount; 957 int month = internalGet(MONTH) + amount; 1001 int era = internalGet(ERA) + amount; 1010 long delta = amount; 1048 delta = amount / 2; 1049 timeOfDay = 12 * (amount % 2); 1168 public void roll(int field, int amount) { in roll() argument [all …]
|
D | JapaneseImperialCalendar.java | 405 public void add(int field, int amount) { in add() argument 408 if (amount == 0) { in add() 421 d.addYear(amount); in add() 429 d.addMonth(amount); in add() 436 int era = internalGet(ERA) + amount; in add() 444 long delta = amount; in add() 482 delta = amount / 2; in add() 483 timeOfDay = 12 * (amount % 2); in add() 557 public void roll(int field, int amount) { in roll() argument 560 if (amount == 0) { in roll() [all …]
|
/libcore/ojluni/src/test/java/time/tck/java/time/ |
D | TCKInstant.java | 580 public <R extends Temporal> R addTo(R temporal, long amount) { 615 public <R extends Temporal> R addTo(R temporal, long amount) { 691 …public void test_plusTemporalAmount(TemporalUnit unit, TemporalAmount amount, int seconds, int nan… 693 Instant actual = inst.plus(amount); 707 public void test_badPlusTemporalAmount(TemporalAmount amount) { 709 inst.plus(amount); 985 …public void plusSeconds_long(long seconds, int nanos, long amount, long expectedSeconds, int expec… 987 t = t.plusSeconds(amount); 1064 …public void plusMillis_long(long seconds, int nanos, long amount, long expectedSeconds, int expect… 1066 t = t.plusMillis(amount); [all …]
|
D | TCKYear.java | 495 public void test_plusValid(int year, TemporalAmount amount, int expected) { in test_plusValid() argument 496 assertEquals(Year.of(year).plus(amount), Year.of(expected)); in test_plusValid() 514 public void test_plusInvalidUnit(TemporalAmount amount) { in test_plusInvalidUnit() argument 515 TEST_2008.plus(amount); in test_plusInvalidUnit() 600 …public void test_plus_long_TemporalUnit(Year base, long amount, TemporalUnit unit, Year expectedYe… in test_plus_long_TemporalUnit() argument 602 assertEquals(base.plus(amount, unit), expectedYear); in test_plus_long_TemporalUnit() 605 base.plus(amount, unit); in test_plus_long_TemporalUnit() 627 public void test_minusValid(int year, TemporalAmount amount, int expected) { in test_minusValid() argument 628 assertEquals(Year.of(year).minus(amount), Year.of(expected)); in test_minusValid() 646 public void test_minusInvalidUnit(TemporalAmount amount) { in test_minusInvalidUnit() argument [all …]
|
D | TCKZonedDateTime.java | 1625 …public void test_plus_TemporalAmount_Period_days(ZonedDateTime base, int amount, ZonedDateTime exp… 1626 assertEquals(base.plus(Period.ofDays(amount)), expected); 1630 …public void test_plus_TemporalAmount_Period_hours(ZonedDateTime base, long amount, ZonedDateTime e… 1631 assertEquals(base.plus(MockSimplePeriod.of(amount, HOURS)), expected); 1635 …public void test_plus_TemporalAmount_Duration_hours(ZonedDateTime base, long amount, ZonedDateTime… 1636 assertEquals(base.plus(Duration.ofHours(amount)), expected); 1676 public void test_plus_longUnit_days(ZonedDateTime base, long amount, ZonedDateTime expected) { 1677 assertEquals(base.plus(amount, DAYS), expected); 1681 public void test_plus_longUnit_hours(ZonedDateTime base, long amount, ZonedDateTime expected) { 1682 assertEquals(base.plus(amount, HOURS), expected); [all …]
|
D | TCKPeriod.java | 160 TemporalAmount amount = Period.of(1, 2, 3); in factory_from_TemporalAmount_Period() local 161 assertPeriod(Period.from(amount), 1, 2, 3); in factory_from_TemporalAmount_Period() 166 TemporalAmount amount = new TemporalAmount() { in factory_from_TemporalAmount_YearsDays() local 191 assertPeriod(Period.from(amount), 23, 0, 45); in factory_from_TemporalAmount_YearsDays() 196 TemporalAmount amount = new TemporalAmount() { in factory_from_TemporalAmount_Years_tooBig() local 214 Period.from(amount); in factory_from_TemporalAmount_Years_tooBig() 219 TemporalAmount amount = new TemporalAmount() { in factory_from_TemporalAmount_DaysHours() local 244 Period.from(amount); in factory_from_TemporalAmount_DaysHours() 645 TemporalAmount amount = new TemporalAmount() { in test_plus_TemporalAmount_DaysHours() local 670 pymd(4, 5, 6).plus(amount); in test_plus_TemporalAmount_DaysHours() [all …]
|
/libcore/luni/src/test/java/libcore/java/time/ |
D | OffsetTimeTest.java | 70 private static void assertPlusIsNoop(long amount, TemporalUnit unit) { in assertPlusIsNoop() argument 71 assertSame(NOON_UTC, NOON_UTC.plus(amount, unit)); in assertPlusIsNoop()
|
/libcore/ojluni/src/test/java/time/tck/java/time/temporal/ |
D | TCKChronoUnit.java | 169 …tAndTemporal(ChronoUnit unit, Temporal base, boolean isSupportedBy, long amount, Temporal target)… in test_unitAndTemporal() argument 172 Temporal result = unit.addTo(base, amount); in test_unitAndTemporal() 174 assertEquals(unit.between(base, result), amount); in test_unitAndTemporal() local
|
/libcore/luni/src/test/resources/ |
D | recipt.dtd | 7 amount CDATA #IMPLIED attribute
|
/libcore/luni/src/test/resources/systemid/ |
D | recipt.dtd | 7 amount CDATA #IMPLIED attribute
|