unused/DeprecatedModelManager.java
public void deleteTag(Tag target) throws TagNotFoundException, TagInternalErrorException {

        int tagsFound = 0;
        Iterator it = addressBook.getParcelList().iterator();
        while (it.hasNext()) {
            Parcel oldParcel = (Parcel) it.next();
            Parcel newParcel = new Parcel(oldParcel);
            Set<Tag> newTags = new HashSet<>(newParcel.getTags());
            if (newTags.contains(target)) {
                newTags.remove(target);
                tagsFound++;
            }

            newParcel.setTags(newTags);

            try {
                addressBook.updateParcel(oldParcel, newParcel);
            } catch (DuplicateParcelException | ParcelNotFoundException dpe) {
                throw new TagInternalErrorException();
            }
        }

        if (tagsFound == 0) {
            throw new TagNotFoundException();
        }

        indicateAddressBookChanged();
    }
/** Deletes the tag from every parcel in the address book */
Deletes the tag from every parcel in the address book
Deletes the tag from every parcel in the address book
public void deleteTag(Tag target) throws TagNotFoundException, TagInternalErrorException {
        int tagsFound = 0;
        Iterator it = addressBook.getParcelList().iterator();
        while (it.hasNext()) {
            Parcel oldParcel = (Parcel) it.next();
            Parcel newParcel = new Parcel(oldParcel);
            Set<Tag> newTags = new HashSet<>(newParcel.getTags());
            if (newTags.contains(target)) {
                newTags.remove(target);
                tagsFound++;
            }
            newParcel.setTags(newTags);
            try {
                addressBook.updateParcel(oldParcel, newParcel);
            } catch (DuplicateParcelException | ParcelNotFoundException dpe) {
                throw new TagInternalErrorException();
            }
        }
        if (tagsFound == 0) {
            throw new TagNotFoundException();
        }
        indicateAddressBookChanged();
    }
public void deleteTag ( Tag target ) throws TagNotFoundException , TagInternalErrorException { int tagsFound = 0 ; Iterator it = addressBook . getParcelList ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { Parcel oldParcel = ( Parcel ) it . next ( ) ; Parcel newParcel = new Parcel ( oldParcel ) ; Set < Tag > newTags = new HashSet < > ( newParcel . getTags ( ) ) ; if ( newTags . contains ( target ) ) { newTags . remove ( target ) ; tagsFound ++ ; } newParcel . setTags ( newTags ) ; try { addressBook . updateParcel ( oldParcel , newParcel ) ; } catch ( DuplicateParcelException | ParcelNotFoundException dpe ) { throw new TagInternalErrorException ( ) ; } } if ( tagsFound == 0 ) { throw new TagNotFoundException ( ) ; } indicateAddressBookChanged ( ) ; }
Deletes the tag from every parcel in the address book
Deletes the tag from every parcel in the address book