Class DT_DURATION |

    indexing

>     description:

>         "Durations"

>     library:    "Gobo Eiffel Time Library"
>     author:     "Eric Bezault <ericb@gobosoft.com>"
>     copyright:  "Copyright (c) 2000-2001, Eric Bezault and others"
>     license:    "Eiffel Forum License v2 (see forum.txt)"

    deferred class interface

>     DT_DURATION

    inherit

>     KL_PART_COMPARABLE
>     HASHABLE

    feature -- Access

>     absolute_time (a_time: DT_ABSOLUTE_TIME): DT_ABSOLUTE_TIME
>             -- Addition of current duration to a_time
>             -- (Create a new object at each call.)
>         require
>             a_time_not_void: a_time /= Void
>         ensure
>             absolute_time_not_void: Result /= Void
>             definition: Result.is_equal (a_time + Current)

>     hash_code: INTEGER
>             -- Hash code value
>             -- (From HASHABLE.)
>         deferred
>         ensure
>             good_hash_value: Result >= 0

    feature -- Basic operations

>     infix "+" (other: like Current): like Current
>             -- Sum of current duration with other
>         require
>             other_not_void: other /= Void
>         deferred
>         ensure
>             addition_not_void: Result /= Void

>     infix "-" (other: like Current): like Current
>             -- Difference with other
>         require
>             other_not_void: other /= Void
>         deferred
>         ensure
>             subtraction_not_void: Result /= Void

>     prefix "+": like Current
>             -- Unary plus
>         ensure
>             unary_plus_not_void: Result /= Void
>             same_object: Result = Current

>     prefix "-": like Current
>             -- Unary minus
>         deferred
>         ensure
>             unary_minus_not_void: Result /= Void

    feature -- Comparison

>     infix "<" (other: like Current): BOOLEAN
>             -- Is current object less than other?
>             -- (From KL_PART_COMPARABLE.)
>         require
>             other_not_void: other /= Void
>         deferred

>     infix "<=" (other: like Current): BOOLEAN
>             -- Is current object less than or equal to other?
>             -- (From KL_PART_COMPARABLE.)
>         require
>             other_not_void: other /= Void
>         ensure
>             definition: Result = ((Current < other) or is_equal (other))

>     infix ">=" (other: like Current): BOOLEAN
>             -- Is current object greater than or equal to other?
>             -- (From KL_PART_COMPARABLE.)
>         require
>             other_not_void: other /= Void
>         ensure
>             definition: Result = (other <= Current)

>     infix ">" (other: like Current): BOOLEAN
>             -- Is current object greater than other?
>             -- (From KL_PART_COMPARABLE.)
>         require
>             other_not_void: other /= Void
>         ensure
>             definition: Result = ((other < Current) or is_equal (other))

>     is_equal (other: like Current): BOOLEAN
>             -- Is other attached to an object considered equal
>             -- to current object?
>             -- (From GENERAL.)
>         require
>             other_not_void: other /= Void
>         ensure
>             symmetric: Result implies other.is_equal (Current)
>             consistent: standard_is_equal (other) implies Result

    feature -- Duplication

>     copy (other: like Current)
>             -- Copy other to current duration.
>             -- (From GENERAL.)
>         require
>             other_not_void: other /= Void
>             type_identity: same_type (other)
>         ensure
>             is_equal: is_equal (other)

    end -- class DT_DURATION