isImmutable

getSign

public final int getSign()

Returns the sign of the duration: +1 is forwards
and -1 is backwards in time.
This value does not necessarily reflect the
true direction of the duration if the duration
is not normalized or not normalizable.

isValid

normalize

public void normalize()

Normalize a duration value. This ensures that months,
hours, minutes, seconds, and fractions are positive and
within the ranges 0..11, 0..23, 0..59, etc. Negative
durations are indicated by a negative sign rather
than negative components.

Most duration specifications can be normalized to
valid durations with all positive components, but
not all of them can.

The only situations which cannot be normalized are
where the year/month and the day/hour/minute/second
offsets are of opposite sign. Days cannot be carried
into months since the length of a Gregorian month is
variable depending on when the duration is applied.
In these cases, this method normalizes the components
so that "day" is the only negative component.

toString

Any components that are zero are omitted. Note that if the duration
is invalid, i.e., it has negative components, those negative
components are serialized out here. To check for validity, use
the isValid() method; and to normalize most durations to a valid
form use the normalize() method.