mirror of
https://github.com/EiffelSoftware/eiffel-org.git
synced 2025-12-07 23:32:42 +01:00
Author:halw
Date:2008-09-29T16:18:46.000000Z git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@62 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
[[Property:title|Duration]]
|
||||
[[Property:weight|1]]
|
||||
[[Property:uuid|64672bd0-b696-0c39-1e30-5ac64aae4a99]]
|
||||
<eiffel>TIME_DURATION</eiffel>, <eiffel>DATE_DURATION</eiffel> AND <eiffel>DATE_TIME_DURATION</eiffel>
|
||||
<eiffel>TIME_DURATION</eiffel>, <eiffel>DATE_DURATION</eiffel>, and <eiffel>DATE_TIME_DURATION</eiffel>
|
||||
|
||||
The classes dealing with duration inherit DURATION, which inherits GROUP_ELEMENT and PART_COMPARABLE. An instance of <eiffel>TIME_DURATION</eiffel>, <eiffel>DATE_DURATION</eiffel> or <eiffel>DATE_TIME_DURATION</eiffel> is an element of a group, i.e. there is a zero and addition operations (infix +,infix -, prefix + and prefix -). Duration is used as an amount of time, without link to an origin. It may be added to the respective absolute notion (time + time_duration is possible, not time + date_time_duration nor date_time + time_duration...see classes <eiffel>TIME</eiffel>, <eiffel>DATE</eiffel> and <eiffel>DATE_TIME</eiffel>).
|
||||
The classes dealing with duration inherit DURATION, which inherits GROUP_ELEMENT and PART_COMPARABLE. An instance of <eiffel>TIME_DURATION</eiffel>, <eiffel>DATE_DURATION</eiffel>, or <eiffel>DATE_TIME_DURATION</eiffel> is an element of a group, i.e. there is a zero and addition operations (infix +, infix -, prefix + and prefix -). Duration is used as an amount of time, without link to an origin. It may be added to the respective absolute notion (time + time_duration is possible, not time + date_time_duration nor date_time + time_duration...see classes <eiffel>TIME</eiffel>, <eiffel>DATE</eiffel>, and <eiffel>DATE_TIME</eiffel>).
|
||||
|
||||
Attributes are allowed to take negative values or values which do not stand in the usual range (hour = -1, minute = 75, day = 40...). However, features are available in each class to convert instances into the usual format: functions canonical and to_canonical are present in each class. An instance is canonical (canonical = True) if its attributes stand into the usual range. For example, an instance of <eiffel>TIME_DURATION</eiffel> such as 12:-10:60 is not canonical. to_canonical will return 11:51:0. In <eiffel>DATE_DURATION</eiffel> and <eiffel>DATE_TIME_DURATION</eiffel>, these features are also present.
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ It would have been possible to create intervals with references to date or time,
|
||||
|
||||
====Interval measurement====
|
||||
|
||||
The measure of intervals is made by duration: the result is an instance of the class <eiffel>DURATION</eiffel>. However, as <eiffel>DURATION</eiffel> is the common parent of <eiffel>TIME_DURATION</eiffel>, <eiffel>DATE_DURATION</eiffel> and <eiffel>DATE_TIME_DURATION</eiffel>, it does not have many features available. Some features in class <eiffel>TIME</eiffel>, <eiffel>DATE</eiffel>, <eiffel>DATE_TIME</eiffel> return the same result and are more efficient to use. <eiffel>DURATION</eiffel> has to be use as the last solution.
|
||||
The measure of intervals is made by duration: the result is an instance of the class <eiffel>DURATION</eiffel>. However, as <eiffel>DURATION</eiffel> is the common parent of <eiffel>TIME_DURATION</eiffel>, <eiffel>DATE_DURATION</eiffel>, and <eiffel>DATE_TIME_DURATION</eiffel>, it does not have many features available. Some features in class <eiffel>TIME</eiffel>, <eiffel>DATE</eiffel>, and <eiffel>DATE_TIME</eiffel> return the same result and are more efficient to use. <eiffel>DURATION</eiffel> has to be use as the last solution.
|
||||
|
||||
====Comparison====
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ Manipulation on second and fractional_second are in fact always made through fin
|
||||
Features dealing with <eiffel>fine_second</eiffel> and <eiffel>fractional_second</eiffel> are described here.
|
||||
|
||||
====Creation (common to <eiffel>TIME, </eiffel> <eiffel>TIME_DURATION</eiffel>)====
|
||||
* <eiffel>make_fine</eiffel> looks like make but it takes a <eiffel>DOUBLE </eiffel>for its third argument (instead of an <eiffel>INTEGER</eiffel>). fine_second is then set to this value.
|
||||
* <eiffel>make_fine</eiffel> looks like make but it takes a <eiffel>DOUBLE</eiffel> for its third argument (instead of an <eiffel>INTEGER</eiffel>). fine_second is then set to this value.
|
||||
* <eiffel>make_by_fine_seconds</eiffel> looks like <eiffel>make_by_seconds</eiffel> but it takes a <eiffel>DOUBLE</eiffel> for argument (instead of an <eiffel>INTEGER</eiffel>). Comparison (common) There are no new features. The same ones are available since they are written to deal with precision. It is possible to compare two instances, one with precision and the other one without.
|
||||
|
||||
====Measurement and access====
|
||||
|
||||
Reference in New Issue
Block a user