private void readCalendars ( ) { // // Create the calendars // for ( MapRow row : getTable ( "NCALTAB" ) ) { ProjectCalendar calendar = m_projectFile . addCalendar ( ) ; calendar . setUniqueID ( row . getInteger ( "UNIQUE_ID" ) ) ; calendar . setName ( row . getString ( "NAME" ) ) ; calendar . setWorkingDay ( Day . SUNDAY , row . getBoolean ( "SUNDAY" ) ) ; calendar . setWorkingDay ( Day . MONDAY , row . getBoolean ( "MONDAY" ) ) ; calendar . setWorkingDay ( Day . TUESDAY , row . getBoolean ( "TUESDAY" ) ) ; calendar . setWorkingDay ( Day . WEDNESDAY , row . getBoolean ( "WEDNESDAY" ) ) ; calendar . setWorkingDay ( Day . THURSDAY , row . getBoolean ( "THURSDAY" ) ) ; calendar . setWorkingDay ( Day . FRIDAY , row . getBoolean ( "FRIDAY" ) ) ; calendar . setWorkingDay ( Day . SATURDAY , row . getBoolean ( "SATURDAY" ) ) ; for ( Day day : Day . values ( ) ) { if ( calendar . isWorkingDay ( day ) ) { // TODO: this is an approximation calendar . addDefaultCalendarHours ( day ) ; } } } // // Set up the hierarchy and add exceptions // Table exceptionsTable = getTable ( "CALXTAB" ) ; for ( MapRow row : getTable ( "NCALTAB" ) ) { ProjectCalendar child = m_projectFile . getCalendarByUniqueID ( row . getInteger ( "UNIQUE_ID" ) ) ; ProjectCalendar parent = m_projectFile . getCalendarByUniqueID ( row . getInteger ( "BASE_CALENDAR_ID" ) ) ; if ( child != null && parent != null ) { child . setParent ( parent ) ; } addCalendarExceptions ( exceptionsTable , child , row . getInteger ( "FIRST_CALENDAR_EXCEPTION_ID" ) ) ; m_eventManager . fireCalendarReadEvent ( child ) ; } }
Read calendar data from a PEP file .