Java 类java.time.temporal.Temporal 实例源码

项目:holon-vaadin7    文件:DefaultFieldPropertyRenderer.java   
/**
 * Renders a Temporal value type Field
 * @param property Property to render
 * @return Field instance
 */
@SuppressWarnings("unchecked")
protected Field<T> renderTemporal(Property<T> property) {

    TemporalInputBuilder builder = null;

    if (LocalDate.class.isAssignableFrom(property.getType())) {
        builder = input.localDate(false);
    } else if (LocalDateTime.class.isAssignableFrom(property.getType())) {
        builder = input.localDateTime(false);
    } else {
        throw new UnsupportedTemporalTypeException(
                "Temporal type " + property.getType().getName() + " is not supported by default field renderer");
    }

    final TemporalInputBuilder<Temporal, ?> b = builder;

    // set locale from LocalizationContext, if any
    LocalizationContext.getCurrent().filter(l -> l.isLocalized()).flatMap((c) -> c.getLocale())
            .ifPresent((l) -> b.locale(l));

    return postProcessField(b.asField(), property);
}
项目:jdk8u-jdk    文件:ChronoPeriodImpl.java   
@Override
public Temporal addTo(Temporal temporal) {
    validateChrono(temporal);
    if (months == 0) {
        if (years != 0) {
            temporal = temporal.plus(years, YEARS);
        }
    } else {
        long monthRange = monthRange();
        if (monthRange > 0) {
            temporal = temporal.plus(years * monthRange + months, MONTHS);
        } else {
            if (years != 0) {
                temporal = temporal.plus(years, YEARS);
            }
            temporal = temporal.plus(months, MONTHS);
        }
    }
    if (days != 0) {
        temporal = temporal.plus(days, DAYS);
    }
    return temporal;
}
项目:openjdk-jdk10    文件:ChronoPeriodImpl.java   
@Override
public Temporal addTo(Temporal temporal) {
    validateChrono(temporal);
    if (months == 0) {
        if (years != 0) {
            temporal = temporal.plus(years, YEARS);
        }
    } else {
        long monthRange = monthRange();
        if (monthRange > 0) {
            temporal = temporal.plus(years * monthRange + months, MONTHS);
        } else {
            if (years != 0) {
                temporal = temporal.plus(years, YEARS);
            }
            temporal = temporal.plus(months, MONTHS);
        }
    }
    if (days != 0) {
        temporal = temporal.plus(days, DAYS);
    }
    return temporal;
}
项目:OpenJSharp    文件:ChronoPeriodImpl.java   
@Override
public Temporal addTo(Temporal temporal) {
    validateChrono(temporal);
    if (months == 0) {
        if (years != 0) {
            temporal = temporal.plus(years, YEARS);
        }
    } else {
        long monthRange = monthRange();
        if (monthRange > 0) {
            temporal = temporal.plus(years * monthRange + months, MONTHS);
        } else {
            if (years != 0) {
                temporal = temporal.plus(years, YEARS);
            }
            temporal = temporal.plus(months, MONTHS);
        }
    }
    if (days != 0) {
        temporal = temporal.plus(days, DAYS);
    }
    return temporal;
}
项目:openjdk-jdk10    文件:ChronoLocalDateTimeImpl.java   
/**
 * Casts the {@code Temporal} to {@code ChronoLocalDateTime} ensuring it bas the specified chronology.
 *
 * @param chrono  the chronology to check for, not null
 * @param temporal   a date-time to cast, not null
 * @return the date-time checked and cast to {@code ChronoLocalDateTime}, not null
 * @throws ClassCastException if the date-time cannot be cast to ChronoLocalDateTimeImpl
 *  or the chronology is not equal this Chronology
 */
static <R extends ChronoLocalDate> ChronoLocalDateTimeImpl<R> ensureValid(Chronology chrono, Temporal temporal) {
    @SuppressWarnings("unchecked")
    ChronoLocalDateTimeImpl<R> other = (ChronoLocalDateTimeImpl<R>) temporal;
    if (chrono.equals(other.getChronology()) == false) {
        throw new ClassCastException("Chronology mismatch, required: " + chrono.getId()
                + ", actual: " + other.getChronology().getId());
    }
    return other;
}
项目:openjdk-jdk10    文件:TCKOffsetDateTime.java   
@Test
public void test_with_adjustment() {
    final OffsetDateTime sample = OffsetDateTime.of(LocalDate.of(2012, 3, 4), LocalTime.of(23, 5), OFFSET_PONE);
    TemporalAdjuster adjuster = new TemporalAdjuster() {
        @Override
        public Temporal adjustInto(Temporal dateTime) {
            return sample;
        }
    };
    assertEquals(TEST_2008_6_30_11_30_59_000000500.with(adjuster), sample);
}
项目:openjdk-jdk10    文件:TCKOffsetTime.java   
@Test
public void test_with_adjustment() {
    final OffsetTime sample = OffsetTime.of(23, 5, 0, 0, OFFSET_PONE);
    TemporalAdjuster adjuster = new TemporalAdjuster() {
        @Override
        public Temporal adjustInto(Temporal dateTime) {
            return sample;
        }
    };
    assertEquals(TEST_11_30_59_500_PONE.with(adjuster), sample);
}
项目:jdk8u-jdk    文件:CopticDate.java   
@Override
public long until(Temporal endExclusive, TemporalUnit unit) {
    CopticDate end = getChronology().date(endExclusive);
    if (unit instanceof ChronoUnit) {
        return LocalDate.from(this).until(end, unit);  // TODO: this is wrong
    }
    return unit.between(this, end);
}
项目:openjdk-jdk10    文件:ChronoZonedDateTime.java   
@Override
default int get(TemporalField field) {
    if (field instanceof ChronoField) {
        switch ((ChronoField) field) {
            case INSTANT_SECONDS:
                throw new UnsupportedTemporalTypeException("Invalid field 'InstantSeconds' for get() method, use getLong() instead");
            case OFFSET_SECONDS:
                return getOffset().getTotalSeconds();
        }
        return toLocalDateTime().get(field);
    }
    return Temporal.super.get(field);
}
项目:jdk8u-jdk    文件:TCKYear.java   
@Test
public void test_adjustDate() {
    LocalDate base = LocalDate.of(2007, 2, 12);
    for (int i = -4; i <= 2104; i++) {
        Temporal result = Year.of(i).adjustInto(base);
        assertEquals(result, LocalDate.of(i, 2, 12));
    }
}
项目:jdk8u-jdk    文件:TCKFormatStyle.java   
@Test(dataProvider = "formatStyle")
public void test_formatStyle(Temporal temporal, FormatStyle style, String formattedStr) {
    DateTimeFormatterBuilder builder = new DateTimeFormatterBuilder();
    DateTimeFormatter formatter = builder.appendLocalized(style, style).appendLiteral(" ").appendZoneOrOffsetId().toFormatter();
    formatter = formatter.withLocale(Locale.US);
    assertEquals(formatter.format(temporal), formattedStr);
}
项目:openjdk-jdk10    文件:TCKYear.java   
@Test
public void test_with_TemporalAdjuster() {
    Year base = Year.of(-10);
    for (int i = -4; i <= 2104; i++) {
        Temporal result = base.with(Year.of(i));
        assertEquals(result, Year.of(i));
    }
}
项目:openjdk-jdk10    文件:TCKLocalTime.java   
@Test
public void test_with_adjustment() {
    final LocalTime sample = LocalTime.of(23, 5);
    TemporalAdjuster adjuster = new TemporalAdjuster() {
        @Override
        public Temporal adjustInto(Temporal dateTime) {
            return sample;
        }
    };
    assertEquals(TEST_12_30_40_987654321.with(adjuster), sample);
}
项目:openjdk-jdk10    文件:TCKChronoPeriod.java   
@Test(dataProvider="calendars")
public void test_subtractFrom(Chronology chrono) {
    ChronoPeriod period = chrono.period(1, 2, 3);
    ChronoLocalDate date = chrono.dateNow();
    Temporal result = period.subtractFrom(date);
    assertEquals(result, date.minus(14, MONTHS).minus(3, DAYS));
}
项目:OpenJSharp    文件:ChronoLocalDateTimeImpl.java   
@Override
public long until(Temporal endExclusive, TemporalUnit unit) {
    Objects.requireNonNull(endExclusive, "endExclusive");
    @SuppressWarnings("unchecked")
    ChronoLocalDateTime<D> end = (ChronoLocalDateTime<D>) getChronology().localDateTime(endExclusive);
    if (unit instanceof ChronoUnit) {
        if (unit.isTimeBased()) {
            long amount = end.getLong(EPOCH_DAY) - date.getLong(EPOCH_DAY);
            switch ((ChronoUnit) unit) {
                case NANOS: amount = Math.multiplyExact(amount, NANOS_PER_DAY); break;
                case MICROS: amount = Math.multiplyExact(amount, MICROS_PER_DAY); break;
                case MILLIS: amount = Math.multiplyExact(amount, MILLIS_PER_DAY); break;
                case SECONDS: amount = Math.multiplyExact(amount, SECONDS_PER_DAY); break;
                case MINUTES: amount = Math.multiplyExact(amount, MINUTES_PER_DAY); break;
                case HOURS: amount = Math.multiplyExact(amount, HOURS_PER_DAY); break;
                case HALF_DAYS: amount = Math.multiplyExact(amount, 2); break;
            }
            return Math.addExact(amount, time.until(end.toLocalTime(), unit));
        }
        ChronoLocalDate endDate = end.toLocalDate();
        if (end.toLocalTime().isBefore(time)) {
            endDate = endDate.minus(1, ChronoUnit.DAYS);
        }
        return date.until(endDate, unit);
    }
    Objects.requireNonNull(unit, "unit");
    return unit.between(this, end);
}
项目:DeBrug    文件:DatumTijdWaarde__BehaviorDescriptor.java   
@Override
protected <T> T invokeSpecial0(@NotNull SNode node, @NotNull SMethod<T> method, @Nullable Object[] parameters) {
  int methodIndex = BH_METHODS.indexOf(method);
  if (methodIndex < 0) {
    throw new BHMethodNotFoundException(this, method);
  }
  switch (methodIndex) {
    case 0:
      return (T) ((Temporal) GeefTemporeleWaarde_id5kuxuwXEUJM(node));
    case 1:
      return (T) ((String) GeefWaardeString_idFzw$g_H4hz(node));
    default:
      throw new BHMethodNotFoundException(this, method);
  }
}
项目:openjdk-jdk10    文件:TCKYear.java   
@Test
public void test_adjustDate() {
    LocalDate base = LocalDate.of(2007, 2, 12);
    for (int i = -4; i <= 2104; i++) {
        Temporal result = Year.of(i).adjustInto(base);
        assertEquals(result, LocalDate.of(i, 2, 12));
    }
}
项目:openjdk-jdk10    文件:ChronoZonedDateTimeImpl.java   
/**
 * Casts the {@code Temporal} to {@code ChronoZonedDateTimeImpl} ensuring it bas the specified chronology.
 *
 * @param chrono  the chronology to check for, not null
 * @param temporal  a date-time to cast, not null
 * @return the date-time checked and cast to {@code ChronoZonedDateTimeImpl}, not null
 * @throws ClassCastException if the date-time cannot be cast to ChronoZonedDateTimeImpl
 *  or the chronology is not equal this Chronology
 */
static <R extends ChronoLocalDate> ChronoZonedDateTimeImpl<R> ensureValid(Chronology chrono, Temporal temporal) {
    @SuppressWarnings("unchecked")
    ChronoZonedDateTimeImpl<R> other = (ChronoZonedDateTimeImpl<R>) temporal;
    if (chrono.equals(other.getChronology()) == false) {
        throw new ClassCastException("Chronology mismatch, required: " + chrono.getId()
                + ", actual: " + other.getChronology().getId());
    }
    return other;
}
项目:jdk8u-jdk    文件:TCKOffsetDateTime.java   
@Test
public void test_with_adjustment() {
    final OffsetDateTime sample = OffsetDateTime.of(LocalDate.of(2012, 3, 4), LocalTime.of(23, 5), OFFSET_PONE);
    TemporalAdjuster adjuster = new TemporalAdjuster() {
        @Override
        public Temporal adjustInto(Temporal dateTime) {
            return sample;
        }
    };
    assertEquals(TEST_2008_6_30_11_30_59_000000500.with(adjuster), sample);
}
项目:jdk8u-jdk    文件:TestDateTimeFormatterBuilder.java   
private static Temporal date(int y, int m, int d) {
    return LocalDate.of(y, m, d);
}
项目:openjdk-jdk10    文件:MockSimplePeriod.java   
@Override
public Temporal subtractFrom(Temporal temporal) {
    return temporal.minus(amount, unit);
}
项目:jdk8u-jdk    文件:TCKLocalTime.java   
@Override
public boolean isSupportedBy(Temporal temporal) {
    return false;
}
项目:openjdk-jdk10    文件:TCKChronoLocalDate.java   
@Override
public Temporal adjustInto(Temporal ignore) {
    return datetime;
}
项目:openjdk-jdk10    文件:TCKInstant.java   
@Override
public <R extends Temporal> R addTo(R temporal, long amount) {
    throw new UnsupportedOperationException();
}
项目:DeBrug    文件:TijdWaarde__BehaviorDescriptor.java   
static Temporal GeefTemporeleWaarde_id5kuxuwXEUJM(@NotNull SNode __thisNode__) {
  if ((SLinkOperations.getTarget(__thisNode__, MetaAdapterFactory.getContainmentLink(0x30ef095ad48945ffL, 0xa80f456a798ac125L, 0x7da9e4c6468d08fL, 0x7da9e4c6468d090L, "waarde")) != null)) {
    return Tijd__BehaviorDescriptor.geefTijd_id5riiL_BUHOa.invoke(SLinkOperations.getTarget(__thisNode__, MetaAdapterFactory.getContainmentLink(0x30ef095ad48945ffL, 0xa80f456a798ac125L, 0x7da9e4c6468d08fL, 0x7da9e4c6468d090L, "waarde")));
  }
  return null;
}
项目:openjdk-jdk10    文件:TCKDuration.java   
@Override
public boolean isSupportedBy(Temporal temporal) {
    return false;
}
项目:jdk8u-jdk    文件:TCKChronoLocalDateTime.java   
@Override
public Temporal adjustInto(Temporal ignore) {
    return datetime;
}
项目:FastisFX    文件:TimeInterval.java   
public Temporal getStartDateTime() {
    return startDateTime;
}
项目:FastisFX    文件:TimeInterval.java   
public Temporal getEndDateTime() {
    return endDateTime;
}
项目:jdk8u-jdk    文件:Period.java   
/**
 * Subtracts this period from the specified temporal object.
 * <p>
 * This returns a temporal object of the same observable type as the input
 * with this period subtracted.
 * If the temporal has a chronology, it must be the ISO chronology.
 * <p>
 * In most cases, it is clearer to reverse the calling pattern by using
 * {@link Temporal#minus(TemporalAmount)}.
 * <pre>
 *   // these two lines are equivalent, but the second approach is recommended
 *   dateTime = thisPeriod.subtractFrom(dateTime);
 *   dateTime = dateTime.minus(thisPeriod);
 * </pre>
 * <p>
 * The calculation operates as follows.
 * First, the chronology of the temporal is checked to ensure it is ISO chronology or null.
 * Second, if the months are zero, the years are subtracted if non-zero, otherwise
 * the combination of years and months is subtracted if non-zero.
 * Finally, any days are subtracted.
 * <p>
 * This approach ensures that a partial period can be subtracted from a partial date.
 * For example, a period of years and/or months can be subtracted from a {@code YearMonth},
 * but a period including days cannot.
 * The approach also subtracts years and months together when necessary, which ensures
 * correct behaviour at the end of the month.
 * <p>
 * This instance is immutable and unaffected by this method call.
 *
 * @param temporal  the temporal object to adjust, not null
 * @return an object of the same type with the adjustment made, not null
 * @throws DateTimeException if unable to subtract
 * @throws ArithmeticException if numeric overflow occurs
 */
@Override
public Temporal subtractFrom(Temporal temporal) {
    validateChrono(temporal);
    if (months == 0) {
        if (years != 0) {
            temporal = temporal.minus(years, YEARS);
        }
    } else {
        long totalMonths = toTotalMonths();
        if (totalMonths != 0) {
            temporal = temporal.minus(totalMonths, MONTHS);
        }
    }
    if (days != 0) {
        temporal = temporal.minus(days, DAYS);
    }
    return temporal;
}
项目:jdk8u-jdk    文件:Instant.java   
/**
 * Calculates the amount of time until another instant in terms of the specified unit.
 * <p>
 * This calculates the amount of time between two {@code Instant}
 * objects in terms of a single {@code TemporalUnit}.
 * The start and end points are {@code this} and the specified instant.
 * The result will be negative if the end is before the start.
 * The calculation returns a whole number, representing the number of
 * complete units between the two instants.
 * The {@code Temporal} passed to this method is converted to a
 * {@code Instant} using {@link #from(TemporalAccessor)}.
 * For example, the amount in days between two dates can be calculated
 * using {@code startInstant.until(endInstant, SECONDS)}.
 * <p>
 * There are two equivalent ways of using this method.
 * The first is to invoke this method.
 * The second is to use {@link TemporalUnit#between(Temporal, Temporal)}:
 * <pre>
 *   // these two lines are equivalent
 *   amount = start.until(end, SECONDS);
 *   amount = SECONDS.between(start, end);
 * </pre>
 * The choice should be made based on which makes the code more readable.
 * <p>
 * The calculation is implemented in this method for {@link ChronoUnit}.
 * The units {@code NANOS}, {@code MICROS}, {@code MILLIS}, {@code SECONDS},
 * {@code MINUTES}, {@code HOURS}, {@code HALF_DAYS} and {@code DAYS}
 * are supported. Other {@code ChronoUnit} values will throw an exception.
 * <p>
 * If the unit is not a {@code ChronoUnit}, then the result of this method
 * is obtained by invoking {@code TemporalUnit.between(Temporal, Temporal)}
 * passing {@code this} as the first argument and the converted input temporal
 * as the second argument.
 * <p>
 * This instance is immutable and unaffected by this method call.
 *
 * @param endExclusive  the end date, exclusive, which is converted to an {@code Instant}, not null
 * @param unit  the unit to measure the amount in, not null
 * @return the amount of time between this instant and the end instant
 * @throws DateTimeException if the amount cannot be calculated, or the end
 *  temporal cannot be converted to an {@code Instant}
 * @throws UnsupportedTemporalTypeException if the unit is not supported
 * @throws ArithmeticException if numeric overflow occurs
 */
@Override
public long until(Temporal endExclusive, TemporalUnit unit) {
    Instant end = Instant.from(endExclusive);
    if (unit instanceof ChronoUnit) {
        ChronoUnit f = (ChronoUnit) unit;
        switch (f) {
            case NANOS: return nanosUntil(end);
            case MICROS: return nanosUntil(end) / 1000;
            case MILLIS: return Math.subtractExact(end.toEpochMilli(), toEpochMilli());
            case SECONDS: return secondsUntil(end);
            case MINUTES: return secondsUntil(end) / SECONDS_PER_MINUTE;
            case HOURS: return secondsUntil(end) / SECONDS_PER_HOUR;
            case HALF_DAYS: return secondsUntil(end) / (12 * SECONDS_PER_HOUR);
            case DAYS: return secondsUntil(end) / (SECONDS_PER_DAY);
        }
        throw new UnsupportedTemporalTypeException("Unsupported unit: " + unit);
    }
    return unit.between(this, end);
}
项目:jdk8u-jdk    文件:TCKChronoZonedDateTime.java   
@SuppressWarnings("unchecked")
@Override
public <R extends Temporal> R addTo(R temporal, long amount) {
    return (R) this.temporal;
}
项目:jdk8u-jdk    文件:MockSimplePeriod.java   
@Override
public Temporal subtractFrom(Temporal temporal) {
    return temporal.minus(amount, unit);
}
项目:openjdk-jdk10    文件:Duration.java   
/**
 * Obtains a {@code Duration} representing the duration between two temporal objects.
 * <p>
 * This calculates the duration between two temporal objects. If the objects
 * are of different types, then the duration is calculated based on the type
 * of the first object. For example, if the first argument is a {@code LocalTime}
 * then the second argument is converted to a {@code LocalTime}.
 * <p>
 * The specified temporal objects must support the {@link ChronoUnit#SECONDS SECONDS} unit.
 * For full accuracy, either the {@link ChronoUnit#NANOS NANOS} unit or the
 * {@link ChronoField#NANO_OF_SECOND NANO_OF_SECOND} field should be supported.
 * <p>
 * The result of this method can be a negative period if the end is before the start.
 * To guarantee to obtain a positive duration call {@link #abs()} on the result.
 *
 * @param startInclusive  the start instant, inclusive, not null
 * @param endExclusive  the end instant, exclusive, not null
 * @return a {@code Duration}, not null
 * @throws DateTimeException if the seconds between the temporals cannot be obtained
 * @throws ArithmeticException if the calculation exceeds the capacity of {@code Duration}
 */
public static Duration between(Temporal startInclusive, Temporal endExclusive) {
    try {
        return ofNanos(startInclusive.until(endExclusive, NANOS));
    } catch (DateTimeException | ArithmeticException ex) {
        long secs = startInclusive.until(endExclusive, SECONDS);
        long nanos;
        try {
            nanos = endExclusive.getLong(NANO_OF_SECOND) - startInclusive.getLong(NANO_OF_SECOND);
            if (secs > 0 && nanos < 0) {
                secs++;
            } else if (secs < 0 && nanos > 0) {
                secs--;
            }
        } catch (DateTimeException ex2) {
            nanos = 0;
        }
        return ofSeconds(secs, nanos);
    }
}
项目:jdk8u-jdk    文件:LocalTime.java   
/**
 * Calculates the amount of time until another time in terms of the specified unit.
 * <p>
 * This calculates the amount of time between two {@code LocalTime}
 * objects in terms of a single {@code TemporalUnit}.
 * The start and end points are {@code this} and the specified time.
 * The result will be negative if the end is before the start.
 * The {@code Temporal} passed to this method is converted to a
 * {@code LocalTime} using {@link #from(TemporalAccessor)}.
 * For example, the amount in hours between two times can be calculated
 * using {@code startTime.until(endTime, HOURS)}.
 * <p>
 * The calculation returns a whole number, representing the number of
 * complete units between the two times.
 * For example, the amount in hours between 11:30 and 13:29 will only
 * be one hour as it is one minute short of two hours.
 * <p>
 * There are two equivalent ways of using this method.
 * The first is to invoke this method.
 * The second is to use {@link TemporalUnit#between(Temporal, Temporal)}:
 * <pre>
 *   // these two lines are equivalent
 *   amount = start.until(end, MINUTES);
 *   amount = MINUTES.between(start, end);
 * </pre>
 * The choice should be made based on which makes the code more readable.
 * <p>
 * The calculation is implemented in this method for {@link ChronoUnit}.
 * The units {@code NANOS}, {@code MICROS}, {@code MILLIS}, {@code SECONDS},
 * {@code MINUTES}, {@code HOURS} and {@code HALF_DAYS} are supported.
 * Other {@code ChronoUnit} values will throw an exception.
 * <p>
 * If the unit is not a {@code ChronoUnit}, then the result of this method
 * is obtained by invoking {@code TemporalUnit.between(Temporal, Temporal)}
 * passing {@code this} as the first argument and the converted input temporal
 * as the second argument.
 * <p>
 * This instance is immutable and unaffected by this method call.
 *
 * @param endExclusive  the end time, exclusive, which is converted to a {@code LocalTime}, not null
 * @param unit  the unit to measure the amount in, not null
 * @return the amount of time between this time and the end time
 * @throws DateTimeException if the amount cannot be calculated, or the end
 *  temporal cannot be converted to a {@code LocalTime}
 * @throws UnsupportedTemporalTypeException if the unit is not supported
 * @throws ArithmeticException if numeric overflow occurs
 */
@Override
public long until(Temporal endExclusive, TemporalUnit unit) {
    LocalTime end = LocalTime.from(endExclusive);
    if (unit instanceof ChronoUnit) {
        long nanosUntil = end.toNanoOfDay() - toNanoOfDay();  // no overflow
        switch ((ChronoUnit) unit) {
            case NANOS: return nanosUntil;
            case MICROS: return nanosUntil / 1000;
            case MILLIS: return nanosUntil / 1000_000;
            case SECONDS: return nanosUntil / NANOS_PER_SECOND;
            case MINUTES: return nanosUntil / NANOS_PER_MINUTE;
            case HOURS: return nanosUntil / NANOS_PER_HOUR;
            case HALF_DAYS: return nanosUntil / (12 * NANOS_PER_HOUR);
        }
        throw new UnsupportedTemporalTypeException("Unsupported unit: " + unit);
    }
    return unit.between(this, end);
}
项目:jdk8u-jdk    文件:MockSimplePeriod.java   
@Override
public Temporal addTo(Temporal temporal) {
    return temporal.plus(amount, unit);
}
项目:openjdk-jdk10    文件:TCKDayOfWeek.java   
@Test(expectedExceptions=NullPointerException.class)
public void test_adjustInto_null() {
    DayOfWeek.MONDAY.adjustInto((Temporal) null);
}
项目:jdk8u-jdk    文件:TCKChronoZonedDateTime.java   
@Override
public Temporal subtractFrom(Temporal ignore) {
    return datetime;
}
项目:jdk8u-jdk    文件:TCKChronoLocalDateTime.java   
FixedAdjuster(Temporal datetime) {
    this.datetime = datetime;
}
项目:jdk8u-jdk    文件:TCKChronoLocalDate.java   
@Override
public long between(Temporal temporal1, Temporal temporal2) {
    throw new UnsupportedOperationException("Not supported yet.");
}