Home | History | Annotate | Download | only in chrono

Lines Matching refs:unit

391      * Checks if the specified unit is supported.
393 * This checks if the specified unit can be added to or subtracted from this date.
400 * If the unit is not a {@code ChronoUnit}, then the result of this method
403 * Whether the unit is supported is determined by the unit.
405 * @param unit the unit to check, null returns false
406 * @return true if the unit can be added/subtracted, false if not
409 default boolean isSupported(TemporalUnit unit) {
410 if (unit instanceof ChronoUnit) {
411 return unit.isDateBased();
413 return unit != null && unit.isSupportedBy(this);
458 default ChronoLocalDate plus(long amountToAdd, TemporalUnit unit) {
459 if (unit instanceof ChronoUnit) {
460 throw new UnsupportedTemporalTypeException("Unsupported unit: " + unit);
462 return ChronoLocalDateImpl.ensureValid(getChronology(), unit.addTo(this, amountToAdd));
482 default ChronoLocalDate minus(long amountToSubtract, TemporalUnit unit) {
483 return ChronoLocalDateImpl.ensureValid(getChronology(), Temporal.super.minus(amountToSubtract, unit));
552 * Calculates the amount of time until another date in terms of the specified unit.
581 * If the unit is not a {@code ChronoUnit}, then the result of this method
590 * @param unit the unit to measure the amount in, not null
594 * @throws UnsupportedTemporalTypeException if the unit is not supported
598 long until(Temporal endExclusive, TemporalUnit unit);