src/main/java/seedu/address/logic/commands/applicant/DeleteApplicant.java
public CommandResult execute(Model model) throws CommandException {
        requireNonNull(model);
        List<Applicant> lastShownList = model.getFilteredApplicantList();

        int zeroBasedIndex = targetIndex.getZeroBased();

        if (zeroBasedIndex >= lastShownList.size() || zeroBasedIndex < 0) {
            throw new CommandException(String.format(MESSAGE_INVALID_INDEX,
                    DeleteApplicant.MESSAGE_USAGE));
        }

        Applicant applicantToDelete = lastShownList.get(targetIndex.getZeroBased());
        model.deleteApplicant(applicantToDelete);
        return new CommandResult(String.format(MESSAGE_DELETE_APPLICANT_SUCCESS, applicantToDelete), true,
                false, true);
    }
/**
     * Execute the detele applicant command.
     * @param model {@code Model} which the command should operate on.
     * @return the command result.
     * @throws CommandException thrown when the targetIndex is invalid.
     */
Execute the detele applicant command.
@param model  Model which the command should operate on.
@return the command result.
@throws CommandException thrown when the targetIndex is invalid.
Execute the detele applicant command . @param model Model which the command should operate on . @return the command result . @throws CommandException thrown when the targetIndex is invalid .
public CommandResult execute(Model model) throws CommandException {
        requireNonNull(model);
        List<Applicant> lastShownList = model.getFilteredApplicantList();
        int zeroBasedIndex = targetIndex.getZeroBased();
        if (zeroBasedIndex >= lastShownList.size() || zeroBasedIndex < 0) {
            throw new CommandException(String.format(MESSAGE_INVALID_INDEX,
                    DeleteApplicant.MESSAGE_USAGE));
        }
        Applicant applicantToDelete = lastShownList.get(targetIndex.getZeroBased());
        model.deleteApplicant(applicantToDelete);
        return new CommandResult(String.format(MESSAGE_DELETE_APPLICANT_SUCCESS, applicantToDelete), true,
                false, true);
    }
public CommandResult execute ( Model model ) throws CommandException { requireNonNull ( model ) ; List < Applicant > lastShownList = model . getFilteredApplicantList ( ) ; int zeroBasedIndex = targetIndex . getZeroBased ( ) ; if ( zeroBasedIndex >= lastShownList . size ( ) || zeroBasedIndex < 0 ) { throw new CommandException ( String . format ( MESSAGE_INVALID_INDEX , DeleteApplicant . MESSAGE_USAGE ) ) ; } Applicant applicantToDelete = lastShownList . get ( targetIndex . getZeroBased ( ) ) ; model . deleteApplicant ( applicantToDelete ) ; return new CommandResult ( String . format ( MESSAGE_DELETE_APPLICANT_SUCCESS , applicantToDelete ) , true , false , true ) ; }
Execute the detele applicant command.
Execute the detele applicant command .