Package org.geotools.temporal.object
Class DefaultPeriodDuration
Object
DefaultDuration
DefaultPeriodDuration
- All Implemented Interfaces:
Duration
,PeriodDuration
Uses the format specified by ISO 8601 for exchanging information about the duration of a period.
- Author:
- Mehdi Sidhoum (Geomatys)
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultPeriodDuration
(long durationInMilliSeconds) Creates a new instance of PeriodDuration from a long value passed in parameter. if the long contains milliseconds, this will be ignored because there is no MilliSeconds specified in the string format PnYnMnDTnHnMnS, see ISO 8601.DefaultPeriodDuration
(InternationalString years, InternationalString months, InternationalString week, InternationalString days, InternationalString hours, InternationalString minutes, InternationalString seconds) Creates a new instances of PeriodDuration. -
Method Summary
Modifier and TypeMethodDescriptionboolean
getDays()
A positive integer, followed by the character "D", which indicated the number of days in the period.A mandatory element which designates that the returned string represents the duration of a period.getHours()
A positive integer, followed by the character "H", which indicated the number of hours in the period.A positive integer, followed by the character "M", which indicated the number of minutes in the period.A positive integer, followed by the character "M", which indicated the number of months in the period.A positive integer, followed by the character "S", which indicated the number of seconds in the period.Included whenever the sequence includes values for units less than a day.long
Returns a duration in long. note there is no starting instant to accurate the returned value.getWeek()
getYears()
A positive integer, followed by the character "Y", which indicated the number of years in the period.int
hashCode()
void
setDays
(InternationalString days) void
setHours
(InternationalString hours) void
setMinutes
(InternationalString minutes) void
setMonths
(InternationalString months) void
setSeconds
(InternationalString seconds) void
setWeek
(InternationalString week) void
setYears
(InternationalString years) toString()
-
Constructor Details
-
DefaultPeriodDuration
public DefaultPeriodDuration(InternationalString years, InternationalString months, InternationalString week, InternationalString days, InternationalString hours, InternationalString minutes, InternationalString seconds) Creates a new instances of PeriodDuration. -
DefaultPeriodDuration
public DefaultPeriodDuration(long durationInMilliSeconds) Creates a new instance of PeriodDuration from a long value passed in parameter. if the long contains milliseconds, this will be ignored because there is no MilliSeconds specified in the string format PnYnMnDTnHnMnS, see ISO 8601.
-
-
Method Details
-
getDesignator
A mandatory element which designates that the returned string represents the duration of a period.- Specified by:
getDesignator
in interfacePeriodDuration
-
getYears
A positive integer, followed by the character "Y", which indicated the number of years in the period.- Specified by:
getYears
in interfacePeriodDuration
-
getMonths
A positive integer, followed by the character "M", which indicated the number of months in the period.- Specified by:
getMonths
in interfacePeriodDuration
-
getDays
A positive integer, followed by the character "D", which indicated the number of days in the period.- Specified by:
getDays
in interfacePeriodDuration
-
getTimeIndicator
Included whenever the sequence includes values for units less than a day.- Specified by:
getTimeIndicator
in interfacePeriodDuration
-
getHours
A positive integer, followed by the character "H", which indicated the number of hours in the period.- Specified by:
getHours
in interfacePeriodDuration
-
getMinutes
A positive integer, followed by the character "M", which indicated the number of minutes in the period.- Specified by:
getMinutes
in interfacePeriodDuration
-
getSeconds
A positive integer, followed by the character "S", which indicated the number of seconds in the period.- Specified by:
getSeconds
in interfacePeriodDuration
-
setYears
-
setMonths
-
setDays
-
setHours
-
setMinutes
-
setSeconds
-
getWeek
-
setWeek
-
getTimeInMillis
public long getTimeInMillis()Returns a duration in long. note there is no starting instant to accurate the returned value.- Specified by:
getTimeInMillis
in classDefaultDuration
-
equals
-
hashCode
public int hashCode() -
toString
-