index
GregorianDate
標準のDateクラスより精度の高い日付計算を行うために作成した、グレゴリオ暦を計算する日付クラス。
インスタンスは特定の日付を修正ユリウス日で表わす。
休日に関するメソッドは抽象メソッド。
インスタンス変数
mjd 修正ユリウス日
Dateクラスのインスタンス変数dayとyearは使わない。
superclass:
instance variables:
class instance variables:
class variabels:
pool variabels:
instance methods:
- < aDate [comparing]
Answer if the receiver is before .
- = aDate [comparing]
Answer whether the argument, aDate, is the same day as the
receiver.
- addDays: dayCount [arithmetic]
レシーバーにdayCount日数を足した日を返す。
- addWeekDays: dayCount [arithmetic]
レシーバーにウィークデーdayCount日数を足した日を返す。
- age [arithmetic]
レシーバーが誕生日と考えて、年齢を返す。
- dateToYmdAux [private]
Private
- day [accessing]
年のはじめからの日数を返す。
- dayAsFloat [converting]
- dayNumber [inquiries]
曜日を数字で返す。日曜日=0、土曜日=6。
- dayOfMonth [inquiries]
レシーバーが月の何日目かを返す。
- dayOfYear [accessing]
年のはじめからの日数を返す。
- firstDayOf: aDayNumber [inquiries]
レシーバーの月の、指定された<aDayNumber>曜日の最初の日を返す。
- holiday [inquiries]
レシーバーの年の、休日をSortedCollectionとして返す。
- holidaysBetween: aDate [inquiries]
レシーバとaDateの間の休日をSortedCollectionとして返す。
- holidaysBetweenAux: aDate [private]
Private
- isDayOff [testing]
レシーバが休みの日(日曜+休日)かどうかを返す。
- isHoliday [testing]
レシーバーが休日かどうかを返す。
- isSaturday [testing]
レシーバーが土曜日かどうかを返す。
- isSunday [testing]
レシーバーが日曜日かどうかを返す。
- lastDayOfWeek: dayOfTheWeek [inquiries]
レシーバーの月の、指定された<aDayNumber>曜日の最終日を返す。
- leap [accessing]
レシーバの年が閏年なら1を、さもなければ0を返す。
- mjd [accessing]
Private -- return the mjd = Modified Julian Day
- mjd: aDouble [accessing]
- month [accessing]
return the month of self
- monthAux [private]
Private
- monthIndex [accessing]
- nthDayNumber: aDayNumber at: anInteger [inquiries]
レシーバーの月の、第<anInteger>曜日<aDayNumber>の日を返す。
- occurrencesOfDayOffsBetween: aDate [inquiries]
レシーバーとaDateの間の休みの日(日曜日+休日)の日数を返す。レシーバーとaDateも休みであれば勘定に入れる。
事後条件 --
S∈日曜日の集合・レシーバー≦S≦aDate、H∈休日の集合・レシーバー≦H≦aDateとして、
card(S) + card(H) - card(S∩H)を求める。
- occurrencesOfDayOfTheWeek: aDayNumber Between: aDate [inquiries]
レシーバーとaDateの間の<aDayNumber>曜日の日数を返す。レシーバーとaDateも指定された曜日であれば勘定に入れる。
事前条件 --
type R = {|rng [n → n / 7 | n∈Int]} /* 7で割った商の集合 */
f, t∈Int, w∈R, 0≦f≦t,
h: Int → R /* 環準同型(ring homomorphism) */
事後条件 --
S = dom h(w) ∩ {f..t}・A ≡ card(S) /* Aが答え */
- occurrencesOfHolidaysBetween: aDate [inquiries]
レシーバーとaDateの間の休日の日数を返す。レシーバーとaDateも休日であれば勘定に入れる。
- occurrencesOfSundaysBetween: aDate [inquiries]
レシーバーとaDateの間の日曜日の日数を返す。レシーバーとaDateも日曜日であれば勘定に入れる。
- subtractDate: aDate [arithmetic]
レシーバーとaDateの間の日数を返す。
- subtractDays: dayCount [arithmetic]
レシーバーのdayCount日前の日を返す。
- subtractWeekDate: aDate [arithmetic]
レシーバーとaDateの間のウィークデーの日数を返す。
- subtractWeekDays: dayCount [arithmetic]
レシーバーのウィークデーでdayCount日前の日を返す。
- subtractWeekDaysAux: dayCount [private]
Private
- time [converting]
- toJST [converting]
- year [accessing]
return the year of self
- yearAux [private]
Private
class methods:
- autumnalEquinoxDate: year [inquiries]
秋分の日を返す。参考文献Jean Meeus,「Astronomical Formulae for Calculators」(3ed Ed.,Willmann-Bell,1985)
- autumnalEquinoxDay: year [inquiries]
秋分の日を返す。9月23日だったら23を返す。
- calendarForMonth: month year: year [displaying]
year年month月のカレンダーを文字列として返す。
- dateToYear: year month: month day: day [converting]
year年month月day日を実数の年で表わす。
- dayOfWeek: dayName [inquiries]
Answer the index in a week, 0-6, of the day named dayName.
Provide an error notification if no such day exists.
- example1 [examples]
GregorianDate example1
- example2 [examples]
GregorianDate example2
- example3 [examples]
GregorianDate example3
- firstDayOf: aDayNumber year: aYear month: aMonth [inquiries]
aYear年aMonth月のaDayNumberで指定された曜日の最初の日を返す。
- fromString: dateString [instance creation]
- holidayAt: year [private]
- jdMinusMjd [private]
Private -- ユリウス日と修正ユリウス日との差を返す
- jdToMjd: jd [converting]
ユリウス日を修正ユリウス日に変換する。
- mjdToJd: mjd [converting]
修正ユリウス日をユリウス日に変換する。
- nameOfDay: dayNumber [inquiries]
dayNumber(0..6)で指定された曜日をシンボルとして返す。
- nthDayNumber: aDayNumber year: aYear month: aMonth at: anInteger [inquiries]
aYear年aMonth月のaDayNumber(0..6)で指定された第anInteger曜日を返す。
- summerSolstice: year [inquiries]
夏至の日を返す。参考文献Jean Meeus,「Astronomical Formulae for Calculators」(3ed Ed.,Willmann-Bell,1985)
- today [instance creation]
今日を返す。
- vernalEquinoxDate: year [inquiries]
春分の日を返す。参考文献Jean Meeus,「Astronomical Formulae for Calculators」(3ed Ed.,Willmann-Bell,1985)
- vernalEquinoxDay: year [inquiries]
春分の日を返す。3月21日だったら21を返す。
- winterSolstice: year [inquiries]
冬至の日を返す。参考文献Jean Meeus,「Astronomical Formulae for Calculators」(3ed Ed.,Willmann-Bell,1985)
- year: year month: month firstDayOfWeek: dayOfTheWeek [inquiries]
year年month月の最初の指定された曜日(#Mondayなどと指定)の日を返す。
- year: year month: month index: weekCount dayOfWeek: dayOfTheWeek [inquiries]
year年month月のdayOfTheWeek(#Sundayなど)で指定される曜日の第month曜日を返す。
- year: year month: month lastDayOfWeek: dayOfTheWeek [inquiries]
year年month月のdayOfTheWeek(#Sundayなど)で指定される曜日の最後の日を返す。
- year: year month: month newDay: day [instance creation]
year年month月day日を返す
index