Searched defs:amount (Results 1 - 25 of 34) sorted by relevance

12

/libcore/luni/src/test/java/libcore/java/time/
H A DOffsetTimeTest.java70 private static void assertPlusIsNoop(long amount, TemporalUnit unit) { argument
71 assertSame(NOON_UTC, NOON_UTC.plus(amount, unit));
/libcore/ojluni/src/main/java/java/time/temporal/
H A DTemporalUnit.java78 * An instance of this interface represents the unit itself, rather than an amount of the unit.
79 * See {@link Period} for a class that represents an amount in terms of the common units.
222 * @param amount the amount of this unit to add, positive or negative
224 * @throws DateTimeException if the amount cannot be added
227 <R extends Temporal> R addTo(R temporal, long amount); argument
231 * Calculates the amount of time between two temporal objects.
233 * This calculates the amount in terms of this unit. The start and end
236 * first type before the calculating the amount.
238 * For example, the amount i
[all...]
H A DTemporal.java229 * Returns an object of the same type as this object with an amount added.
231 * This adjusts this temporal, adding according to the rules of the specified amount.
232 * The amount is typically a {@link java.time.Period} but may be any other type implementing
253 * return amount.addTo(this);
256 * @param amount the amount to add, not null
261 default Temporal plus(TemporalAmount amount) { argument
262 return amount.addTo(this);
290 * @param amountToAdd the amount of the specified unit to add, may be negative
291 * @param unit the unit of the amount t
333 minus(TemporalAmount amount) argument
[all...]
H A DChronoUnit.java265 public <R extends Temporal> R addTo(R temporal, long amount) { argument
266 return (R) temporal.plus(amount, this);
H A DIsoFields.java189 * amount in quarters to the date. Finally, take the day-of-quarter, subtract one,
190 * and add the amount in days to the date.
690 public <R extends Temporal> R addTo(R temporal, long amount) { argument
694 Math.addExact(temporal.get(WEEK_BASED_YEAR), amount));
697 return (R) temporal.plus(amount / 256, YEARS)
698 .plus((amount % 256) * 3, MONTHS);
/libcore/ojluni/src/test/java/time/tck/java/time/temporal/
H A DTCKChronoUnit.java169 public void test_unitAndTemporal(ChronoUnit unit, Temporal base, boolean isSupportedBy, long amount, Temporal target) { argument
172 Temporal result = unit.addTo(base, amount);
174 assertEquals(unit.between(base, result), amount);
/libcore/ojluni/src/test/java/time/tck/java/time/
H A DMockSimplePeriod.java89 * The amount of the period.
91 private final long amount; field in class:MockSimplePeriod
98 * Obtains a {@code MockSimplePeriod} from an amount and unit.
102 * @param amount the amount of the period, measured in terms of the unit, positive or negative
107 public static MockSimplePeriod of(long amount, TemporalUnit unit) { argument
108 return new MockSimplePeriod(amount, unit);
111 private MockSimplePeriod(long amount, TemporalUnit unit) { argument
116 this.amount = amount;
[all...]
H A DTCKDayOfWeek.java305 public void test_plus_long(int base, long amount, int expected) { argument
306 assertEquals(DayOfWeek.of(base).plus(amount), DayOfWeek.of(expected));
336 public void test_minus_long(int base, long amount, int expected) { argument
337 assertEquals(DayOfWeek.of(base).minus(amount), DayOfWeek.of(expected));
H A DTCKMonth.java317 public void test_plus_long(int base, long amount, int expected) { argument
318 assertEquals(Month.of(base).plus(amount), Month.of(expected));
358 public void test_minus_long(int base, long amount, int expected) { argument
359 assertEquals(Month.of(base).minus(amount), Month.of(expected));
/libcore/ojluni/src/test/java/time/test/java/time/
H A DMockSimplePeriod.java89 * The amount of the period.
91 private final long amount; field in class:MockSimplePeriod
98 * Obtains a {@code MockSimplePeriod} from an amount and unit.
102 * @param amount the amount of the period, measured in terms of the unit, positive or negative
107 public static MockSimplePeriod of(long amount, TemporalUnit unit) { argument
108 return new MockSimplePeriod(amount, unit);
111 private MockSimplePeriod(long amount, TemporalUnit unit) { argument
116 this.amount = amount;
[all...]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/org/apache/harmony/kernel/dalvik/
H A DThreadsTest.java144 /** whether {@link #amount} is milliseconds to wait in an
149 /** amount to wait (see above) */
150 private final long amount; field in class:ThreadsTest.Parker
173 this.amount = absolute ? parkMillis : parkMillis * 1000000;
183 long amount = this.amount;
188 UNSAFE.park(true, start + amount);
190 UNSAFE.park(false, amount);
206 * @param maxWaitMillis the maximum amount of time to
257 * specified amount o
[all...]
/libcore/ojluni/src/main/java/java/time/chrono/
H A DChronoLocalDateTime.java283 default ChronoLocalDateTime<D> plus(TemporalAmount amount) { argument
284 return ChronoLocalDateTimeImpl.ensureValid(getChronology(), Temporal.super.plus(amount));
301 default ChronoLocalDateTime<D> minus(TemporalAmount amount) { argument
302 return ChronoLocalDateTimeImpl.ensureValid(getChronology(), Temporal.super.minus(amount));
H A DChronoLocalDate.java448 default ChronoLocalDate plus(TemporalAmount amount) { argument
449 return ChronoLocalDateImpl.ensureValid(getChronology(), Temporal.super.plus(amount));
471 default ChronoLocalDate minus(TemporalAmount amount) { argument
472 return ChronoLocalDateImpl.ensureValid(getChronology(), Temporal.super.minus(amount));
552 * Calculates the amount of time until another date in terms of the specified unit.
554 * This calculates the amount of time between two {@code ChronoLocalDate}
562 * For example, the amount in days between two dates can be calculated
570 * amount = start.until(end, MONTHS);
571 * amount = MONTHS.between(start, end);
590 * @param unit the unit to measure the amount i
[all...]
H A DChronoLocalDateImpl.java191 public D plus(TemporalAmount amount) { argument
192 return (D) ChronoLocalDate.super.plus(amount);
218 public D minus(TemporalAmount amount) { argument
219 return (D) ChronoLocalDate.super.minus(amount);
H A DChronoPeriodImpl.java177 ChronoPeriodImpl amount = validateAmount(amountToAdd);
180 Math.addExact(years, amount.years),
181 Math.addExact(months, amount.months),
182 Math.addExact(days, amount.days));
187 ChronoPeriodImpl amount = validateAmount(amountToSubtract);
190 Math.subtractExact(years, amount.years),
191 Math.subtractExact(months, amount.months),
192 Math.subtractExact(days, amount.days));
196 * Obtains an instance of {@code ChronoPeriodImpl} from a temporal amount.
198 * @param amount th
201 validateAmount(TemporalAmount amount) argument
[all...]
H A DChronoZonedDateTime.java430 default ChronoZonedDateTime<D> plus(TemporalAmount amount) { argument
431 return ChronoZonedDateTimeImpl.ensureValid(getChronology(), Temporal.super.plus(amount));
448 default ChronoZonedDateTime<D> minus(TemporalAmount amount) { argument
449 return ChronoZonedDateTimeImpl.ensureValid(getChronology(), Temporal.super.minus(amount));
H A DMinguoDate.java350 public MinguoDate plus(TemporalAmount amount) { argument
351 return super.plus(amount);
360 public MinguoDate minus(TemporalAmount amount) { argument
361 return super.minus(amount);
H A DThaiBuddhistDate.java350 public ThaiBuddhistDate plus(TemporalAmount amount) { argument
351 return super.plus(amount);
360 public ThaiBuddhistDate minus(TemporalAmount amount) { argument
361 return super.minus(amount);
H A DHijrahDate.java458 public HijrahDate plus(TemporalAmount amount) { argument
459 return super.plus(amount);
468 public HijrahDate minus(TemporalAmount amount) { argument
469 return super.minus(amount);
H A DJapaneseDate.java559 public JapaneseDate plus(TemporalAmount amount) { argument
560 return super.plus(amount);
569 public JapaneseDate minus(TemporalAmount amount) { argument
570 return super.minus(amount);
/libcore/ojluni/src/test/java/time/tck/java/time/chrono/
H A DTCKChronoLocalDate.java409 public <R extends Temporal> R addTo(R temporal, long amount) { argument
H A DTCKChronoLocalDateTime.java430 public <R extends Temporal> R addTo(R temporal, long amount) { argument
H A DTCKChronoZonedDateTime.java431 public <R extends Temporal> R addTo(R temporal, long amount) { argument
/libcore/ojluni/src/main/java/java/time/
H A DPeriod.java95 * A date-based amount of time in the ISO-8601 calendar system,
98 * This class models a quantity or amount of time in terms of years, months and days.
121 * The period is modeled as a directed amount of time, meaning that individual parts of the
195 * The resulting period will be day-based, with the amount of days
225 * @param years the amount of years, may be negative
226 * @param months the amount of months, may be negative
227 * @param days the amount of days, may be negative
236 * Obtains an instance of {@code Period} from a temporal amount.
238 * This obtains a period based on the specified amount.
239 * A {@code TemporalAmount} represents an amount o
254 from(TemporalAmount amount) argument
[all...]
H A DDuration.java98 * A time-based amount of time, such as '34.5 seconds'.
100 * This class models a quantity or amount of time in terms of seconds and nanoseconds.
284 * Obtains a {@code Duration} representing an amount in the specified unit.
295 * @param amount the amount of the duration, measured in terms of the unit, positive or negative
301 public static Duration of(long amount, TemporalUnit unit) { argument
302 return ZERO.plus(amount, unit);
307 * Obtains an instance of {@code Duration} from a temporal amount.
309 * This obtains a duration based on the specified amount.
310 * A {@code TemporalAmount} represents an amount o
326 from(TemporalAmount amount) argument
[all...]

Completed in 1076 milliseconds

12