Package groovy.time
Class DatumDependentDuration
java.lang.Object
groovy.time.BaseDuration
groovy.time.DatumDependentDuration
- All Implemented Interfaces:
Comparable<BaseDuration>
- Direct Known Subclasses:
TimeDatumDependentDuration
Deprecated.
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)
-
Nested Class Summary
Nested classes/interfaces inherited from class groovy.time.BaseDuration
BaseDuration.From -
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionDatumDependentDuration(int years, int months, int days, int hours, int minutes, int seconds, int millis) Deprecated.Creates a datum-dependent duration. -
Method Summary
Modifier and TypeMethodDescriptiongetAgo()Deprecated.Returns the date represented by this duration ago.getFrom()Deprecated.Returns a helper for computing dates relative to now.intDeprecated.Returns the month component.intgetYears()Deprecated.Returns the year component.Deprecated.Subtracts another datum-dependent duration.Deprecated.Subtracts a fixed duration.Deprecated.Adds another datum-dependent duration.Deprecated.Adds a fixed duration.Deprecated.Adds a mixed time and datum-dependent duration.plus(TimeDuration rhs) Deprecated.Adds a time duration.longDeprecated.Converts this duration to milliseconds.Methods inherited from class groovy.time.BaseDuration
compareTo, getDays, getHours, getMillis, getMinutes, getSeconds, plus, toString
-
Constructor Details
-
DatumDependentDuration
public DatumDependentDuration(int years, int months, int days, int hours, int minutes, int seconds, int millis) Deprecated.Creates a datum-dependent duration.- Parameters:
years- the year componentmonths- the month componentdays- the day componenthours- the hour componentminutes- the minute componentseconds- the second componentmillis- the millisecond component
-
-
Method Details
-
getMonths
public int getMonths()Deprecated.Returns the month component.- Overrides:
getMonthsin classBaseDuration- Returns:
- the month component
-
getYears
public int getYears()Deprecated.Returns the year component.- Overrides:
getYearsin classBaseDuration- Returns:
- the year component
-
plus
Deprecated.Adds another datum-dependent duration.- Parameters:
rhs- the duration to add- Returns:
- the combined duration
-
plus
Deprecated.Adds a mixed time and datum-dependent duration.- Parameters:
rhs- the duration to add- Returns:
- the combined duration
-
plus
Deprecated.Adds a fixed duration.- Parameters:
rhs- the duration to add- Returns:
- the combined duration
-
plus
Deprecated.Adds a time duration.- Parameters:
rhs- the duration to add- Returns:
- the combined duration
-
minus
Deprecated.Subtracts another datum-dependent duration.- Parameters:
rhs- the duration to subtract- Returns:
- the resulting duration
-
minus
Deprecated.Subtracts a fixed duration.- Parameters:
rhs- the duration to subtract- Returns:
- the resulting duration
-
toMilliseconds
public long toMilliseconds()Deprecated.Description copied from class:BaseDurationConverts this duration to milliseconds.- Specified by:
toMillisecondsin classBaseDuration- Returns:
- the duration in milliseconds
- See Also:
-
getAgo
Deprecated.Returns the date represented by this duration ago.- Specified by:
getAgoin classBaseDuration- Returns:
- the computed date
-
getFrom
Deprecated.Returns a helper for computing dates relative to now.- Specified by:
getFromin classBaseDuration- Returns:
- the relative-date helper
-
org.apache.groovy.dateutil.DatumDependentDuration(the dequirkedjava.util.Dateflavor) orjava.time.Period. This legacy class is retained, unchanged, for backward compatibility.