INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES

indexing

title: "Long Duration - days or more"
project: "The Universal Time & Date UTDC"
revision: "$Revision: 1.1 $"
copyright: "Copyright (C) 1996-2005 Object Tools Group"
license: "http://visual-eiffel.com/license"
cluster: timedate
class LONG_DURATION
inherit

SIMPLE_DURATION
end
creation

clear,
set_date,
set_days
feature

absolute_days: INTEGER

set_date (yr, mh, dy: INTEGER)
require
date_valid: dy <= tt.days_in_month_d and then dy >= - tt.days_in_month_d and then mh <= tt.months_in_year and then mh >= - tt.months_in_year

set_days (days: INTEGER)

clear

year_part: INTEGER

month_part: INTEGER

day_part: INTEGER

as_days: DOUBLE

as_months: DOUBLE

as_years: DOUBLE

whole_days: INTEGER

whole_months: INTEGER

whole_years: INTEGER

infix "<" (ts: like Current): BOOLEAN

infix "+", plus (d: like Current): like Current

infix "-", minus (d: like Current): like Current

multiply_by (n: INTEGER): like Current

divide_by (n: INTEGER): like Current
require
non_zero_divider: n /= 0

ratio, divide_by_duration (d: like Current): DOUBLE
require
non_zero_param: d.absolute_days /= 0
end -- class LONG_DURATION

INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES