src/main/java/seedu/planner/model/ModelManager.java
private void removeActivityMapping(Activity act) {
        if (act.getContact().isPresent()) {
            Contact contact = getContact(act.getContact().get()).get();
            if (contactAccommodationMap.containsKey(contact) && contactActivityMap.containsKey(contact)) {
                //if contact linked to both
                contactActivityMap.remove(contact);
            } else if (contactActivityMap.containsKey(contact) && !contactAccommodationMap.containsKey(contact)) {
                //if linked only to activity
                removeContact(contact);
            }
        }
    }
/**
     * Removes the mapping of an {@code Activity} in all the relevant {@code Contact} related {@code HashMap}.
     */
Removes the mapping of an  Activity in all the relevant  Contact related  HashMap.
Removes the mapping of an Activity in all the relevant Contact related HashMap .
private void removeActivityMapping(Activity act) {
        if (act.getContact().isPresent()) {
            Contact contact = getContact(act.getContact().get()).get();
            if (contactAccommodationMap.containsKey(contact) && contactActivityMap.containsKey(contact)) {
                contactActivityMap.remove(contact);
            } else if (contactActivityMap.containsKey(contact) && !contactAccommodationMap.containsKey(contact)) {
                removeContact(contact);
            }
        }
    }
private void removeActivityMapping ( Activity act ) { if ( act . getContact ( ) . isPresent ( ) ) { Contact contact = getContact ( act . getContact ( ) . get ( ) ) . get ( ) ; if ( contactAccommodationMap . containsKey ( contact ) && contactActivityMap . containsKey ( contact ) ) { contactActivityMap . remove ( contact ) ; } else if ( contactActivityMap . containsKey ( contact ) && ! contactAccommodationMap . containsKey ( contact ) ) { removeContact ( contact ) ; } } }
Removes the mapping of an {@code Activity} in all the relevant {@code Contact} related {@code HashMap}.
Removes the mapping of an { @code Activity } in all the relevant { @code Contact } related { @code HashMap } .
//if contact linked to both //if linked only to activity