Home | History | Annotate | Download | only in temporal

Lines Matching refs:unit

132      * Checks if the specified unit is supported.
134 * This checks if the specified unit can be added to, or subtracted from, this date-time.
140 * If the unit is supported, then true must be returned, otherwise false must be returned.
149 * @param unit the unit to check, null returns false
150 * @return true if the unit can be added/subtracted, false if not
152 boolean isSupported(TemporalUnit unit);
279 * If the unit is supported, then the addition must be performed.
282 * If the unit is not a {@code ChronoUnit}, then the result of this method
290 * @param amountToAdd the amount of the specified unit to add, may be negative
291 * @param unit the unit of the amount to add, not null
293 * @throws DateTimeException if the unit cannot be added
294 * @throws UnsupportedTemporalTypeException if the unit is not supported
297 Temporal plus(long amountToAdd, TemporalUnit unit);
359 * plus(Long.MAX_VALUE, unit).plus(1, unit) : plus(-amountToSubtract, unit));
362 * @param amountToSubtract the amount of the specified unit to subtract, may be negative
363 * @param unit the unit of the amount to subtract, not null
365 * @throws DateTimeException if the unit cannot be subtracted
366 * @throws UnsupportedTemporalTypeException if the unit is not supported
369 default Temporal minus(long amountToSubtract, TemporalUnit unit) {
370 return (amountToSubtract == Long.MIN_VALUE ? plus(Long.MAX_VALUE, unit).plus(1, unit) : plus(-amountToSubtract, unit));
375 * Calculates the amount of time until another temporal in terms of the specified unit.
395 * temporal = start.until(end, unit);
396 * temporal = unit.between(start, end);
415 * If the unit is not a {@code ChronoUnit}, then the result of this method
423 * if (unit instanceof ChronoUnit) {
424 * // if unit is supported, then calculate and return result
427 * return unit.between(this, convertedEndTemporal);
430 * Note that the unit's {@code between} method must only be invoked if the
438 * @param unit the unit to measure the amount in, not null
440 * in terms of the unit; positive if the specified object is later than this one,
444 * @throws UnsupportedTemporalTypeException if the unit is not supported
447 long until(Temporal endExclusive, TemporalUnit unit);