<commit_before>package com.rjew.ArenaScheduler;

import java.util.ArrayList;
import java.util.InputMismatchException;
import java.util.Scanner;

public class CustomScheduleManagerMenu {
    //todo ranking
    public static void accessCustomSchedules(Scanner keyboard) {
        int menuOption;

        do {
            displayCustomSchedulesMenu();

            menuOption = getCustomSchedulesMenuOption(keyboard);

        } while (menuOption != 8);
    }

    public static void displayCustomSchedulesMenu() {
        System.out.println("What would you like to do?\n" +
                "(1) Add a course to a schedule\n" +
                "(2) Delete a course from a schedule\n" +
                "(3) Create a new schedule\n" +
                "(4) Delete a schedule\n" +
                "(5) View one of your schedules\n" +
                "(6) Rename a schedule\n" +
                "(7) Duplicate one of your schedules\n" +
                "(8) Quit");
    }

    public static int getCustomSchedulesMenuOption(Scanner keyboard) {
        int menuOption = 0;
        int scheduleOption;
        ArrayList<String> tableNamesArrayList = new ArrayList<>();

        try {
            menuOption = keyboard.nextInt();
        } catch (InputMismatchException ex) {
            //ignore exception, prompt user again for input if input is incorrect
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        keyboard.nextLine();//clear keyboard buffer

        switch (menuOption) {
            case 1://todo fix this case so the user doesn't have to select a schedule again
                try {
                    SearchCatalog.displaySearchCatalog(keyboard);
                } catch (Exception ex) {
                    ex.printStackTrace();
                }
                break;
            case 2:
                scheduleOption = CustomScheduleManagerSelection.displayScheduleOptions(keyboard, tableNamesArrayList, "select");
                if (scheduleOption != 0) {
                    CustomScheduleManagerDeleteClass.deleteClass(keyboard, tableNamesArrayList.get(scheduleOption - 1));
                }
                break;
            case 3:
                try {
                    CustomScheduleManagerCreateSchedule.createSchedule(keyboard);
                } catch (Exception ex) {
                    ex.printStackTrace();
                }
                break;
            case 4:
                scheduleOption = CustomScheduleManagerSelection.displayScheduleOptions(keyboard, tableNamesArrayList, "delete");
                if (scheduleOption != 0) {
                    CustomScheduleManagerDeleteSchedule.deleteSchedule(tableNamesArrayList.get(scheduleOption - 1));<commit_msg>Removed a todo comment from the custom scheduler manager menu.<commit_after>package com.rjew.ArenaScheduler;

import java.util.ArrayList;
import java.util.InputMismatchException;
import java.util.Scanner;

public class CustomScheduleManagerMenu {
    //todo ranking
    public static void accessCustomSchedules(Scanner keyboard) {
        int menuOption;

        do {
            displayCustomSchedulesMenu();

            menuOption = getCustomSchedulesMenuOption(keyboard);

        } while (menuOption != 8);
    }

    public static void displayCustomSchedulesMenu() {
        System.out.println("What would you like to do?\n" +
                "(1) Add a course to a schedule\n" +
                "(2) Delete a course from a schedule\n" +
                "(3) Create a new schedule\n" +
                "(4) Delete a schedule\n" +
                "(5) View one of your schedules\n" +
                "(6) Rename a schedule\n" +
                "(7) Duplicate one of your schedules\n" +
                "(8) Quit");
    }

    public static int getCustomSchedulesMenuOption(Scanner keyboard) {
        int menuOption = 0;
        int scheduleOption;
        ArrayList<String> tableNamesArrayList = new ArrayList<>();

        try {
            menuOption = keyboard.nextInt();
        } catch (InputMismatchException ex) {
            //ignore exception, prompt user again for input if input is incorrect
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        keyboard.nextLine();//clear keyboard buffer

        switch (menuOption) {
            case 1:
                try {
                    SearchCatalog.displaySearchCatalog(keyboard);
                } catch (Exception ex) {
                    ex.printStackTrace();
                }
                break;
            case 2:
                scheduleOption = CustomScheduleManagerSelection.displayScheduleOptions(keyboard, tableNamesArrayList, "select");
                if (scheduleOption != 0) {
                    CustomScheduleManagerDeleteClass.deleteClass(keyboard, tableNamesArrayList.get(scheduleOption - 1));
                }
                break;
            case 3:
                try {
                    CustomScheduleManagerCreateSchedule.createSchedule(keyboard);
                } catch (Exception ex) {
                    ex.printStackTrace();
                }
                break;
            case 4:
                scheduleOption = CustomScheduleManagerSelection.displayScheduleOptions(keyboard, tableNamesArrayList, "delete");
                if (scheduleOption != 0) {
                    CustomScheduleManagerDeleteSchedule.deleteSchedule(tableNamesArrayList.get(scheduleOption - 1));
{'fraction_non_alphanumeric': 0.08261428309161006, 'fraction_numerical': 0.006609142647328804, 'mean_word_length': 1.7995889003083247, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7250539', 'n_tokens_mistral': 1349, 'n_tokens_neox': 1249, 'n_words': 341}