---
# System prepended metadata

title: CCDateTime関連UML図

---

# CCDateTime関連UML図
```mermaid
classDiagram
    %% 案1
    %%class Schedule{
    %%    <<interface>>
    %%    -daterange DateRange
    %%    -name String
    %%    +filterDate(List~DateTime~) List~DateTime~
    %%}
    %%class RepeatSchedule{
    %%    -daterange DateRange
    %%    -name String
    %%    +filterDate(List~DateTime~) List~DateTime~
    %%}
    %%class OneTimeSchedule{
    %%    -daterange DateRange
    %%    -name String
    %%    +filterDate(List~DateTime~) List~DateTime~
    %%}
    %%Schedule <|-- RepeatSchedule
    %%Schedule <|-- OneTimeSchedule
    
    %% 案2
    class Schedule{
        -name String
        -filterDateList List~ScheduleFilter~
        +filterDate(List~DateTime~) List~DateTime~
        +printFilterConditions() String
    }
    class ScheduleFilter{
        <<interface>>
        - initialdate DateTime
        + filterDate(List~DateTime~) List~DateTime~
        + printFilterCondition() String
    }
    class OneTimeScheduleFilter{
        - onetimedate DateTime
        + OneTimeScheduleFilter(DateTime) OneTimeScheduleFilter
    }
    class DayOfWeekScheduleFilter{
        - dayofweek DayOfWeek
        + DayOfWeekScheduleFilter(DayOfWeek, DateTime) DayOfWeekScheduleFilter
    }
    class IntervalScheduleFilter{
        - intervalnum int
        - intervalunit DateRange
        + IntervalScheduleFilter(int, DateRange, DateTime) IntervalScheduleFilter
    }
    Schedule -->"0..*" ScheduleFilter
    ScheduleFilter <|-- OneTimeScheduleFilter
    ScheduleFilter <|-- IntervalScheduleFilter
    ScheduleFilter <|-- DayOfWeekScheduleFilter
    
%%    Schedule -- DateRange
    class ScheduleDB{
        +List~Schedule~ ListSchedule 
    }
    class CalendarUI{
        %% カレンダー情報を表示するクラス
    }
    class CalendarBuilder{
        %% 特定の条件を満たす年月日の列をCalendarクラスとして生成する
        +createModifiedCalendar() Calendar
    }
    class Calendar{
        %% カレンダー情報として、DateTimeを逐次生成により提供するデータクラス。
        +datestream Stream~DateTime~
    }
    class HolidaysDB{
        -List~DateRange~ holidays
        +create() HolidaysDB 
        +isHoliday(DateTime) bool
    }
    class DateTime{
        - year Year
        - month Month
        - day Day
        - hour Hour
        - minute Minute
        - second Second
        - isholiday bool
        - dayoftheweek DayOfWeek
        + DateTime(year, month, day, hour, minute, second, isholiday, dayoftheweek) DateTime
    }
    
    DateTime <-- Year
    DateTime <-- Month
    DateTime <-- Day
    DateTime <-- Hour
    DateTime <-- Minute
    DateTime <-- Second
    DateTime <-- DayOfWeek
    class Year{
        
    }
    class Month{
        
    }
    class Day{
        
    }
    class Hour{
        
    }
    class Minute{
        
    }
    class Second{
    }
    class DayOfWeek{
    }
    <<Enumeration>> DayOfWeek
    class DateRange{
        %% startDate <= Day < endDate
        -startDate DateTime
        -endDate DateTime
        +isBetween(DateTime) bool
    }
    DateRange -- DateTime
    
CalendarUI -- CalendarBuilder : Calendar
CalendarUI -- ScheduleDB
ScheduleDB -- Schedule 
CalendarBuilder -- Calendar
Calendar -- HolidaysDB

```

