package seedu.address.logic.commands;

import seedu.address.commons.core.EventsCenter;
import seedu.address.commons.core.Messages;
import seedu.address.commons.core.UnmodifiableObservableList;
import seedu.address.commons.events.ui.JumpToListRequestEvent;
import seedu.address.logic.commands.exceptions.CommandException;
import seedu.address.model.person.ReadOnlyPerson;

/**
 * Selects a person identified using it's last displayed index from the address book.
 */
public class SelectCommand extends Command {

    public final int targetIndex;

    public static final String COMMAND_WORD = "select";

    public static final String MESSAGE_USAGE = COMMAND_WORD
            + ": Selects the person identified by the index number used in the last person listing.\n"
            + "Parameters: INDEX (must be a positive integer)\n"
            + "Example: " + COMMAND_WORD + " 1";

    public static final String MESSAGE_SELECT_PERSON_SUCCESS = "Selected Person: %1$s";

    public SelectCommand(int targetIndex) {
        this.targetIndex = targetIndex;
    }

    @Override
    public CommandResult execute() throws CommandException {

        UnmodifiableObservableList<ReadOnlyPerson> lastShownList = model.getFilteredPersonList();

        if (lastShownList.size() < targetIndex) {
            throw new CommandException(Messages.MESSAGE_INVALID_PERSON_DISPLAYED_INDEX);
        }

        EventsCenter.getInstance().post(new JumpToListRequestEvent(targetIndex - 1));
        return new CommandResult(String.format(MESSAGE_SELECT_PERSON_SUCCESS, targetIndex));

    }

}

@@ -341,22 +341,20 @@
 s.model.
-person
+task
 .ReadOnl
@@ -354,22 +354,20 @@
 ReadOnly
-Person
+Task
 ;%0A%0A/**%0A 
@@ -909,38 +909,36 @@
  MESSAGE_SELECT_
-PERSON
+TASK
 _SUCCESS = %22Sele
@@ -942,22 +942,20 @@
 elected 
-Person
+Task
 : %251$s%22;
@@ -1166,22 +1166,20 @@
 ReadOnly
-Person
+Task
 %3E lastSh
@@ -1209,14 +1209,12 @@
 ered
-Person
+Task
 List
@@ -1332,22 +1332,20 @@
 INVALID_
-PERSON
+TASK
 _DISPLAY
@@ -1518,14 +1518,12 @@
 ECT_
-PERSON
+TASK
 _SUC

Modify SelectCommand class