Return type | Name and parameters |
---|---|
void
|
downto(Temporal to, Closure closure)
Iterates from this to the to Temporal, inclusive, decrementing by one
unit each iteration, calling the closure once per iteration.
|
void
|
downto(Temporal to, TemporalUnit unit, Closure closure)
Iterates from this to the to Temporal, inclusive, decrementing by one
unit each iteration, calling the closure once per iteration.
|
TemporalAmount
|
rightShift(Temporal other)
Returns a Duration or Period between this (inclusive) and the other
Temporal (exclusive).
|
void
|
upto(Temporal to, Closure closure)
Iterates from this to the to Temporal, inclusive, incrementing by one
unit each iteration, calling the closure once per iteration.
|
void
|
upto(Temporal to, TemporalUnit unit, Closure closure)
Iterates from this to the to Temporal, inclusive, incrementing by one
unit each iteration, calling the closure once per iteration.
|
Iterates from this to the to
Temporal, inclusive, decrementing by one
unit each iteration, calling the closure once per iteration. The closure may accept a single
Temporal argument.
The particular unit decremented by depends on the specific sub-type of Temporal. Most sub-types use a unit of ChronoUnit#SECONDS except for
to
- the ending Temporalclosure
- the zero or one-argument closure to callIterates from this to the to
Temporal, inclusive, decrementing by one
unit
each iteration, calling the closure once per iteration. The closure may accept a single
Temporal argument.
If the unit is too large to iterate to the second Temporal exactly, such as iterating from two LocalDateTimes
that are seconds apart using ChronoUnit#DAYS as the unit, the iteration will cease
as soon as the current value of the iteration is earlier than the second Temporal argument. The closure will
not be called with any value earlier than the to
value.
to
- the ending Temporalunit
- the TemporalUnit to increment byclosure
- the zero or one-argument closure to callReturns a Duration or Period between this (inclusive) and the other
Temporal (exclusive).
A Period will be returned for types Year, YearMonth, and ChronoLocalDate; otherwise, a Duration will be returned.
Note: if the Temporal is a ChronoLocalDate but not a LocalDate, a general ChronoPeriod will be returned as per the return type of the method ChronoLocalDate#until(ChronoLocalDate) .
other
- another Temporal of the same typeIterates from this to the to
Temporal, inclusive, incrementing by one
unit each iteration, calling the closure once per iteration. The closure may accept a single
Temporal argument.
The particular unit incremented by depends on the specific sub-type of Temporal. Most sub-types use a unit of ChronoUnit#SECONDS except for
to
- the ending Temporalclosure
- the zero or one-argument closure to callIterates from this to the to
Temporal, inclusive, incrementing by one
unit
each iteration, calling the closure once per iteration. The closure may accept a single
Temporal argument.
If the unit is too large to iterate to the second Temporal exactly, such as iterating from two LocalDateTimes
that are seconds apart using ChronoUnit#DAYS as the unit, the iteration will cease
as soon as the current value of the iteration is later than the second Temporal argument. The closure will
not be called with any value later than the to
value.
to
- the ending Temporalunit
- the TemporalUnit to increment byclosure
- the zero or one-argument closure to call