src/edu/kit/informatik/calendar_manager/CalendarManagement.java
/**
     * Program start method
     * @param args execution arguments
     */
Program start method
@param args execution arguments
Program start method @param args execution arguments
public static void main(String[] args) {
        final CalendarManagement calManag = new CalendarManagement();
        String input;
        while (true) {
            input = Terminal.readLine();
            if (input.startsWith(CommandPrefix.QUIT.getRepresentation()))
                break;
            if (input.startsWith(CommandPrefix.ADD_APPOINTMENT.getRepresentation()))
                calManag.addAppointment(input);            
            else if (input.startsWith(CommandPrefix.PRINT_APPOINTMENTS_BEFORE.getRepresentation())) 
                calManag.printAppointmentsBefore(input);
            else if (input.startsWith(CommandPrefix.PRINT_APPOINTMENTS_ON.getRepresentation())) 
                calManag.printAppointmentsOn(input);
            else if (input.startsWith(CommandPrefix.PRINT_APPOINTMENTS_INTERVAL.getRepresentation())) 
                calManag.printAppointmentsInInterval(input);
            else if (input.startsWith(CommandPrefix.PRINT_APPOINTMENTS_CONFLICT.getRepresentation())) 
                calManag.printAppointmentsConflict(input);
            else if (input.startsWith(CommandPrefix.PRINT_APPOINTMENTS.getRepresentation())) 
                calManag.printAppointments();
        }
    }
public static void main ( String [ ] args ) { final CalendarManagement calManag = new CalendarManagement ( ) ; String input ; while ( true ) { input = Terminal . readLine ( ) ; if ( input . startsWith ( CommandPrefix . QUIT . getRepresentation ( ) ) ) break ; if ( input . startsWith ( CommandPrefix . ADD_APPOINTMENT . getRepresentation ( ) ) ) calManag . addAppointment ( input ) ; else if ( input . startsWith ( CommandPrefix . PRINT_APPOINTMENTS_BEFORE . getRepresentation ( ) ) ) calManag . printAppointmentsBefore ( input ) ; else if ( input . startsWith ( CommandPrefix . PRINT_APPOINTMENTS_ON . getRepresentation ( ) ) ) calManag . printAppointmentsOn ( input ) ; else if ( input . startsWith ( CommandPrefix . PRINT_APPOINTMENTS_INTERVAL . getRepresentation ( ) ) ) calManag . printAppointmentsInInterval ( input ) ; else if ( input . startsWith ( CommandPrefix . PRINT_APPOINTMENTS_CONFLICT . getRepresentation ( ) ) ) calManag . printAppointmentsConflict ( input ) ; else if ( input . startsWith ( CommandPrefix . PRINT_APPOINTMENTS . getRepresentation ( ) ) ) calManag . printAppointments ( ) ; } }
Program start method
 @param args execution arguments
Program start method @param args execution arguments
//The while loop goes on until the user executes the quit command //true: the user invoked the quit method //Note: the order of the conditional blocks is important //Starting with the last if would cause wrong behavior (more than 1 command will be executed). //Refactoring possible: add "continue" after the execution of every command (except quit)