public class DatumDependentDuration
extends BaseDuration
DatumDependentDuration represents durations whose length in milliseconds cannot be determined without knowing the datum point.
I don't know how many days in a year unless I know if it's a leap year or not.
I don't know how many days in a month unless I know the name of the month (and if it's a leap year if the month is February)
| Constructor and description |
|---|
DatumDependentDuration(int years, int months, int days, int hours, int minutes, int seconds, int millis)Creates a datum-dependent duration. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public Date |
getAgo()Returns the date represented by this duration ago. |
|
public From |
getFrom()Returns a helper for computing dates relative to now. |
|
public int |
getMonths()Returns the month component.
|
|
public int |
getYears()Returns the year component.
|
|
public DatumDependentDuration |
minus(DatumDependentDuration rhs)Subtracts another datum-dependent duration. |
|
public DatumDependentDuration |
minus(Duration rhs)Subtracts a fixed duration. |
|
public DatumDependentDuration |
plus(DatumDependentDuration rhs)Adds another datum-dependent duration. |
|
public DatumDependentDuration |
plus(TimeDatumDependentDuration rhs)Adds a mixed time and datum-dependent duration. |
|
public DatumDependentDuration |
plus(Duration rhs)Adds a fixed duration. |
|
public DatumDependentDuration |
plus(TimeDuration rhs)Adds a time duration. |
|
public long |
toMilliseconds()
|
| Methods inherited from class | Name |
|---|---|
class BaseDuration |
compareTo, getAgo, getDays, getFrom, getHours, getMillis, getMinutes, getMonths, getSeconds, getYears, plus, toMilliseconds, toString |
Creates a datum-dependent duration.
years - the year componentmonths - the month componentdays - the day componenthours - the hour componentminutes - the minute componentseconds - the second componentmillis - the millisecond componentReturns the date represented by this duration ago.
Returns a helper for computing dates relative to now.
Returns the month component.
Returns the year component.
Subtracts another datum-dependent duration.
rhs - the duration to subtractSubtracts a fixed duration.
rhs - the duration to subtractAdds another datum-dependent duration.
rhs - the duration to addAdds a mixed time and datum-dependent duration.
rhs - the duration to addAdds a fixed duration.
rhs - the duration to addAdds a time duration.
rhs - the duration to addCopyright © 2003-2026 The Apache Software Foundation. All rights reserved.