Eiffel Media API
Overview Cluster Class Classes Index      Previous Next      Top Features

kernel.support

Class KL_GREGORIAN_CALENDAR


Direct ancestors

KL_IMPORTED_INTEGER_ROUTINES

Known direct descendants

DT_GREGORIAN_CALENDAR

Features

Invariants

indexing

description

Gregorian calendar properties

library

Gobo Eiffel Kernel Library

copyright

Copyright (c) 2002, Eric Bezault and others

license

Eiffel Forum License v2 (see forum.txt)

date

$Date: 2005/02/09 10:38:12 $

revision

$Revision: 1.7 $

class

KL_GREGORIAN_CALENDAR

feature -- Year

days_in_2_leap_years: INTEGER

-- Number of days in multiple years

days_in_2_years: INTEGER
days_in_3_years: INTEGER
days_in_4_years: INTEGER
days_in_leap_year: INTEGER

-- Number of days in a (leap) year

days_in_year: INTEGER
months_in_year: INTEGER

-- Number of months in a year
-- ensure
-- definition: Result = (December - Januray + 1)

leap_year (y: INTEGER): BOOLEAN

-- Is y a leap year?

feature -- Month

april: INTEGER
august: INTEGER
december: INTEGER

-- Months

february: INTEGER
january: INTEGER
july: INTEGER
june: INTEGER
march: INTEGER
max_days_in_month: INTEGER

-- Maximum number of days in a month

may: INTEGER
november: INTEGER
october: INTEGER
september: INTEGER
days_at_month (m, y: INTEGER): INTEGER

-- Number of days from beginning of year
-- y until beginning of month m

require
m_large_enough: m >= January
m_small_enough: m <= December
ensure
days_positive: Result >= 0
days_in_month (m, y: INTEGER): INTEGER

-- Number of days in month m of year y

require
m_large_enough: m >= January
m_small_enough: m <= December
ensure
at_least_one: Result >= 1
max_days_in_month: Result <= Max_days_in_month

feature -- Week day

days_in_week: INTEGER

-- Number of days in a week

friday: INTEGER
monday: INTEGER
saturday: INTEGER

-- Week days
-- obsolete
-- "[041224] Use DT_WEEK_DAY instead."

sunday: INTEGER
thursday: INTEGER
tuesday: INTEGER
wednesday: INTEGER
next_day (d: INTEGER): INTEGER

-- Week day after d

obsolete

[041224] Use next_day from DT_WEEK_DAY instead.

require
d_large_enough: d >= Sunday
d_small_enough: d <= Saturday
ensure
sunday_definition: (d = Sunday) implies (Result = Monday)
monday_definition: (d = Monday) implies (Result = Tuesday)
tuesday_definition: (d = Tuesday) implies (Result = Wednesday)
wednesday_definition: (d = Wednesday) implies (Result = Thursday)
thursday_definition: (d = Thursday) implies (Result = Friday)
friday_definition: (d = Friday) implies (Result = Saturday)
saturday_definition: (d = Saturday) implies (Result = Sunday)
previous_day (d: INTEGER): INTEGER

-- Week day before d

obsolete

[041224] Use previous_day from DT_WEEK_DAY instead.

require
d_large_enough: d >= Sunday
d_small_enough: d <= Saturday
ensure
sunday_definition: (d = Sunday) implies (Result = Saturday)
monday_definition: (d = Monday) implies (Result = Sunday)
tuesday_definition: (d = Tuesday) implies (Result = Monday)
wednesday_definition: (d = Wednesday) implies (Result = Tuesday)
thursday_definition: (d = Thursday) implies (Result = Wednesday)
friday_definition: (d = Friday) implies (Result = Thursday)
saturday_definition: (d = Saturday) implies (Result = Friday)

feature -- Time

hours_in_day: INTEGER

-- Number of hours in a day

milliseconds_in_day: INTEGER

-- Number of milliseconds in a day

minutes_in_hour: INTEGER

-- Number of minutes in an hour

seconds_in_day: INTEGER

-- Number of seconds in a day

seconds_in_hour: INTEGER

-- Number of seconds in an hour

seconds_in_minute: INTEGER

-- Number of seconds in a minute

feature -- Epoch

epoch_day: INTEGER

-- Epoch date (1 Jan 1970)

epoch_month: INTEGER
epoch_year: INTEGER
epoch_days (y, m, d: INTEGER): INTEGER

-- Number of days since epoch date (1 Jan 1970)

require
m_large_enough: m >= January
m_small_enough: m <= December
d_large_enough: d >= 1
d_small_enough: d <= days_in_month (m, y)

invariant

-- From ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end