src/main/java/seedu/planner/model/ModelManager.java
private void updateMapping(Day oldDay, Day newDay) {
        List<ActivityWithTime> oldList = oldDay.getListOfActivityWithTime();
        for (ActivityWithTime act : oldList) {
            activityDayMap.get(act.getActivity()).remove(oldDay);
        }
        List<ActivityWithTime> newList = newDay.getListOfActivityWithTime();
        for (ActivityWithTime act : newList) {
            if (activityDayMap.containsKey(act.getActivity())) {
                activityDayMap.get(act.getActivity()).add(newDay);
            } else {
                activityDayMap.put(act.getActivity(), new ArrayList<>(Arrays.asList(newDay)));
            }
        }
    }
/**
     * Updates the mapping when there is a change in a {@code Day}.
     */
Updates the mapping when there is a change in a  Day.
Updates the mapping when there is a change in a Day .
private void updateMapping(Day oldDay, Day newDay) {
        List<ActivityWithTime> oldList = oldDay.getListOfActivityWithTime();
        for (ActivityWithTime act : oldList) {
            activityDayMap.get(act.getActivity()).remove(oldDay);
        }
        List<ActivityWithTime> newList = newDay.getListOfActivityWithTime();
        for (ActivityWithTime act : newList) {
            if (activityDayMap.containsKey(act.getActivity())) {
                activityDayMap.get(act.getActivity()).add(newDay);
            } else {
                activityDayMap.put(act.getActivity(), new ArrayList<>(Arrays.asList(newDay)));
            }
        }
    }
private void updateMapping ( Day oldDay , Day newDay ) { List < ActivityWithTime > oldList = oldDay . getListOfActivityWithTime ( ) ; for ( ActivityWithTime act : oldList ) { activityDayMap . get ( act . getActivity ( ) ) . remove ( oldDay ) ; } List < ActivityWithTime > newList = newDay . getListOfActivityWithTime ( ) ; for ( ActivityWithTime act : newList ) { if ( activityDayMap . containsKey ( act . getActivity ( ) ) ) { activityDayMap . get ( act . getActivity ( ) ) . add ( newDay ) ; } else { activityDayMap . put ( act . getActivity ( ) , new ArrayList < > ( Arrays . asList ( newDay ) ) ) ; } } }
Updates the mapping when there is a change in a {@code Day}.
Updates the mapping when there is a change in a { @code Day } .