public class DatumDependentDuration
extends BaseDuration
A duration that includes years and/or months, whose exact length depends on the datum.
DEQUIRKED: toMilliseconds() is now deterministic (see BaseDuration); it
no longer resolves against "now". getAgo()/getFrom() are inherited and no
longer zero the time-of-day.
| Constructor and description |
|---|
DatumDependentDuration(int years, int months, int days, int hours, int minutes, int seconds, int millis)Stores years, months, and the day and time components. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public DatumDependentDuration |
minus(DatumDependentDuration rhs)Subtracts every component of rhs, including years and months.
|
|
public DatumDependentDuration |
minus(Duration rhs)Subtracts the day and time components of rhs. |
|
public DatumDependentDuration |
plus(DatumDependentDuration rhs)Adds every component of rhs, including years and months.
|
|
public DatumDependentDuration |
plus(TimeDatumDependentDuration rhs)Adds this duration to rhs by calling rhs.plus(this),
so the result is a TimeDatumDependentDuration. |
|
public DatumDependentDuration |
plus(Duration rhs)Adds the day and time components of rhs. |
|
public DatumDependentDuration |
plus(TimeDuration rhs)Adds this duration to rhs by calling rhs.plus(this).
|
| Methods inherited from class | Name |
|---|---|
class BaseDuration |
compareTo, getAgo, getDays, getFrom, getHours, getMillis, getMinutes, getMonths, getSeconds, getYears, plus, toMilliseconds, toString |
Stores years, months, and the day and time components.
years - whole yearsmonths - whole monthsdays - whole dayshours - hoursminutes - minutesseconds - secondsmillis - milliseconds Subtracts every component of rhs, including years and months.
The components are not normalized.
rhs - duration to subtract Subtracts the day and time components of rhs. Years and months
stay those of this duration. The components are not normalized.
rhs - duration to subtract Adds every component of rhs, including years and months.
The components are not normalized.
rhs - duration to add Adds this duration to rhs by calling rhs.plus(this),
so the result is a TimeDatumDependentDuration.
rhs - duration to addrhs computes it Adds the day and time components of rhs. Years and months stay
those of this duration. The components are not normalized.
rhs - duration to add Adds this duration to rhs by calling rhs.plus(this).
TimeDuration.plus returns a TimeDatumDependentDuration.
rhs - duration to addrhs computes itCopyright © 2003-2026 The Apache Software Foundation. All rights reserved.