The class Period is used to define a time interval which can be expressed by:
UML Name | Data type | Description | Example |
---|---|---|---|
Duration | XSD::Duration | The Duration attribute is used to define a time interval. It is from the standard XML schema Duration type (XSD:Duration). The time interval is 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. To specify a negative duration, enter a minus sign before the P. |
“P5Y” for a period of five years. “PT15H” for a period of 15 hours. “-P10D” for a period of -10 days (useful when combined to an End Date. |
EndDate | XSD::Date | The EndDate attribute is used to specify the end date of something located in time. It is from the standard XML Schema Date type (XSD:Date). |
2002-09-24 |
EndTime | XSD::Time | The EndTime attribute is used to specify the end time of something located in time. It is from the standard XML Schema Time type (XSD:Time). |
09:00:00 |
StartDate | XSD::Date | The StartDate attribute is used to specify a starting date. It is from the standard XML Schema Date type (XSD:Date). The start date is specified in the following form "YYYY-MM-DD" where: •YYYY indicates the year •MM indicates the month •DD indicates the day Note: All components are required! |
2002-09-24 |
StartTime | XSD::Time | The StartTime attribute is used to specify a starting time. . It is from the standard XML Schema Time type (XSD:Time). The time is specified in the following form "hh:mm:ss" where: •hh indicates the hour •mm indicates the minute •ss indicates the second Note: All components are required! |
09:00:00 |
Name | Description | OCL constraint |
---|---|---|
Coherent Duration | StartDate + StartTime plus Duration equals EndDate + Endtime |
context Period::Duration(): Float post: result = self.EndDate + self.EndTime - (self.StartDate + self.StartTime) |
Earlier EndDate | EndDate can not be earlier than StartDate |
context Period inv: self.EndDate.DateTimeAsFloat > self.StartDate.DateTimeAsFloat |
Earlier EndTime | EndTime can not be earlier than StartTime |
context Period inv: self.EndTime > self.StartTime |
Mandatory Fields | StartDate or EndDate or Duration must be filled |
context: Period inv: ( self.StartDate.isNull=true and self.EndDate.isNull=true and self.Duration.isNull=true ) = false |