index

GregorianDate

標準のDateクラスより精度の高い日付計算を行うために作成した、グレゴリオ暦を計算する日付クラス。
インスタンスは特定の日付を修正ユリウス日で表わす。
休日に関するメソッドは抽象メソッド。

インスタンス変数
mjd 修正ユリウス日
Dateクラスのインスタンス変数dayとyearは使わない。

superclass:

instance variables:

class instance variables:

class variabels:

pool variabels:

instance methods:

  1. < aDate [comparing]
    Answer if the receiver is before .
  2. = aDate [comparing]
    Answer whether the argument, aDate, is the same day as the
    receiver.
  3. addDays: dayCount [arithmetic]
    レシーバーにdayCount日数を足した日を返す。
  4. addWeekDays: dayCount [arithmetic]
    レシーバーにウィークデーdayCount日数を足した日を返す。
  5. age [arithmetic]
    レシーバーが誕生日と考えて、年齢を返す。
  6. dateToYmdAux [private]
    Private
  7. day [accessing]
    年のはじめからの日数を返す。
  8. dayAsFloat [converting]
  9. dayNumber [inquiries]
    曜日を数字で返す。日曜日=0、土曜日=6。
  10. dayOfMonth [inquiries]
    レシーバーが月の何日目かを返す。
  11. dayOfYear [accessing]
    年のはじめからの日数を返す。
  12. firstDayOf: aDayNumber [inquiries]
    レシーバーの月の、指定された<aDayNumber>曜日の最初の日を返す。
  13. holiday [inquiries]
    レシーバーの年の、休日をSortedCollectionとして返す。
  14. holidaysBetween: aDate [inquiries]
    レシーバとaDateの間の休日をSortedCollectionとして返す。
  15. holidaysBetweenAux: aDate [private]
    Private
  16. isDayOff [testing]
    レシーバが休みの日(日曜+休日)かどうかを返す。
  17. isHoliday [testing]
    レシーバーが休日かどうかを返す。
  18. isSaturday [testing]
    レシーバーが土曜日かどうかを返す。
  19. isSunday [testing]
    レシーバーが日曜日かどうかを返す。
  20. lastDayOfWeek: dayOfTheWeek [inquiries]
    レシーバーの月の、指定された<aDayNumber>曜日の最終日を返す。
  21. leap [accessing]
    レシーバの年が閏年なら1を、さもなければ0を返す。
  22. mjd [accessing]
    Private -- return the mjd = Modified Julian Day
  23. mjd: aDouble [accessing]
  24. month [accessing]
    return the month of self
  25. monthAux [private]
    Private
  26. monthIndex [accessing]
  27. nthDayNumber: aDayNumber at: anInteger [inquiries]
    レシーバーの月の、第<anInteger>曜日<aDayNumber>の日を返す。
  28. occurrencesOfDayOffsBetween: aDate [inquiries]
    レシーバーとaDateの間の休みの日(日曜日+休日)の日数を返す。レシーバーとaDateも休みであれば勘定に入れる。
    事後条件 --
    S∈日曜日の集合・レシーバー≦S≦aDate、H∈休日の集合・レシーバー≦H≦aDateとして、
    card(S) + card(H) - card(S∩H)を求める。
  29. 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が答え */
  30. occurrencesOfHolidaysBetween: aDate [inquiries]
    レシーバーとaDateの間の休日の日数を返す。レシーバーとaDateも休日であれば勘定に入れる。
  31. occurrencesOfSundaysBetween: aDate [inquiries]
    レシーバーとaDateの間の日曜日の日数を返す。レシーバーとaDateも日曜日であれば勘定に入れる。
  32. subtractDate: aDate [arithmetic]
    レシーバーとaDateの間の日数を返す。
  33. subtractDays: dayCount [arithmetic]
    レシーバーのdayCount日前の日を返す。
  34. subtractWeekDate: aDate [arithmetic]
    レシーバーとaDateの間のウィークデーの日数を返す。
  35. subtractWeekDays: dayCount [arithmetic]
    レシーバーのウィークデーでdayCount日前の日を返す。
  36. subtractWeekDaysAux: dayCount [private]
    Private
  37. time [converting]
  38. toJST [converting]
  39. year [accessing]
    return the year of self
  40. yearAux [private]
    Private

class methods:

  1. autumnalEquinoxDate: year [inquiries]
    秋分の日を返す。参考文献Jean Meeus,「Astronomical Formulae for Calculators」(3ed Ed.,Willmann-Bell,1985)
  2. autumnalEquinoxDay: year [inquiries]
    秋分の日を返す。9月23日だったら23を返す。
  3. calendarForMonth: month year: year [displaying]
    year年month月のカレンダーを文字列として返す。
  4. dateToYear: year month: month day: day [converting]
    year年month月day日を実数の年で表わす。
  5. 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.
  6. example1 [examples]
    GregorianDate example1
  7. example2 [examples]
    GregorianDate example2
  8. example3 [examples]
    GregorianDate example3
  9. firstDayOf: aDayNumber year: aYear month: aMonth [inquiries]
    aYear年aMonth月のaDayNumberで指定された曜日の最初の日を返す。
  10. fromString: dateString [instance creation]
  11. holidayAt: year [private]
  12. jdMinusMjd [private]
    Private -- ユリウス日と修正ユリウス日との差を返す
  13. jdToMjd: jd [converting]
    ユリウス日を修正ユリウス日に変換する。
  14. mjdToJd: mjd [converting]
    修正ユリウス日をユリウス日に変換する。
  15. nameOfDay: dayNumber [inquiries]
    dayNumber(0..6)で指定された曜日をシンボルとして返す。
  16. nthDayNumber: aDayNumber year: aYear month: aMonth at: anInteger [inquiries]
    aYear年aMonth月のaDayNumber(0..6)で指定された第anInteger曜日を返す。
  17. summerSolstice: year [inquiries]
    夏至の日を返す。参考文献Jean Meeus,「Astronomical Formulae for Calculators」(3ed Ed.,Willmann-Bell,1985)
  18. today [instance creation]
    今日を返す。
  19. vernalEquinoxDate: year [inquiries]
    春分の日を返す。参考文献Jean Meeus,「Astronomical Formulae for Calculators」(3ed Ed.,Willmann-Bell,1985)
  20. vernalEquinoxDay: year [inquiries]
    春分の日を返す。3月21日だったら21を返す。
  21. winterSolstice: year [inquiries]
    冬至の日を返す。参考文献Jean Meeus,「Astronomical Formulae for Calculators」(3ed Ed.,Willmann-Bell,1985)
  22. year: year month: month firstDayOfWeek: dayOfTheWeek [inquiries]
    year年month月の最初の指定された曜日(#Mondayなどと指定)の日を返す。
  23. year: year month: month index: weekCount dayOfWeek: dayOfTheWeek [inquiries]
    year年month月のdayOfTheWeek(#Sundayなど)で指定される曜日の第month曜日を返す。
  24. year: year month: month lastDayOfWeek: dayOfTheWeek [inquiries]
    year年month月のdayOfTheWeek(#Sundayなど)で指定される曜日の最後の日を返す。
  25. year: year month: month newDay: day [instance creation]
    year年month月day日を返す


index