Package ucar.nc2.time
Class CalendarDuration
java.lang.Object
ucar.nc2.time.CalendarDuration
A replacement for ucar.nc2.units.TimeDuration. incomplete.
A Duration is a fixed number of seconds.
I think thats wrong: a CalendarDuration should be a integer and a CalendarPeriod.
Optionally, a CalendarPeriod could have an integer value.
Implements the thredds "duration" XML element type: specifies a length of time.
This is really the same as a ucar.nc2.units.TimeUnit, but it allows xsd:duration syntax as well as udunits syntax.
It also keeps track if the text is empty.
A duration can be one of the following:
- a valid udunits string compatible with "secs"
- an xsd:duration type specified in the following form "PnYnMnDTnHnMnS" where:
- P indicates the period (required)
- nY indicates the number of years
- nM indicates the number of months
- nD indicates the number of days
- T indicates the start of a time section (required if you are going to specify hours, minutes, or seconds)
- nH indicates the number of hours
- nM indicates the number of minutes
- nS indicates the number of seconds
change to JSR-310 javax.time.Duration when ready relation to javax.xml.datatype ?
- See Also:
-
- "https://www.unidata.ucar.edu/projects/THREDDS/tech/catalog/InvCatalogSpec.html#durationType"
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic CalendarDurationfromUnitString(String unitString) doublegetValue()Get the duration in natural units, ie units of getTimeUnit()inthashCode()toString()String representation
-
Constructor Details
-
CalendarDuration
-
-
Method Details
-
getTimeUnit
-
fromUnitString
-
getValue
public double getValue()Get the duration in natural units, ie units of getTimeUnit()- Returns:
- the duration in natural units
-
toString
String representation -
equals
-
hashCode
public int hashCode()
-