Skip to content

Commit

Permalink
Merge pull request nus-cs2103-AY2122S1#87 from wyrchris/remove-unused…
Browse files Browse the repository at this point in the history
…-class

Remove index and find command
  • Loading branch information
benedictchuajj authored Oct 16, 2021
2 parents 34164b9 + da31604 commit d866992
Show file tree
Hide file tree
Showing 18 changed files with 11 additions and 544 deletions.
54 changes: 0 additions & 54 deletions src/main/java/seedu/address/commons/core/index/Index.java

This file was deleted.

42 changes: 0 additions & 42 deletions src/main/java/seedu/address/logic/commands/FindCommand.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import seedu.address.logic.commands.EditCommand;
import seedu.address.logic.commands.ExitCommand;
import seedu.address.logic.commands.FilterCommand;
import seedu.address.logic.commands.FindCommand;
import seedu.address.logic.commands.HelpCommand;
import seedu.address.logic.commands.ListCommand;
import seedu.address.logic.commands.SearchCommand;
Expand Down Expand Up @@ -67,9 +66,6 @@ public Command parseCommand(String userInput) throws ParseException {
case ClearCommand.COMMAND_WORD:
return new ClearCommand();

case FindCommand.COMMAND_WORD:
return new FindCommandParser().parse(arguments);

case SearchCommand.COMMAND_WORD:
return new SearchCommandParser().parse(arguments);

Expand Down
33 changes: 0 additions & 33 deletions src/main/java/seedu/address/logic/parser/FindCommandParser.java

This file was deleted.

15 changes: 0 additions & 15 deletions src/main/java/seedu/address/logic/parser/ParserUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import java.util.HashSet;
import java.util.Set;

import seedu.address.commons.core.index.Index;
import seedu.address.commons.util.StringUtil;
import seedu.address.logic.parser.exceptions.ParseException;
import seedu.address.model.person.Address;
Expand All @@ -29,20 +28,6 @@ public class ParserUtil {
public static final String MESSAGE_INVALID_INDEX = "Index is not a non-zero unsigned integer.";
public static final String MESSAGE_INVALID_CLIENT_ID = "Client ID is not a non-negative unsigned integer.";

/**
* Parses {@code oneBasedIndex} into an {@code Index} and returns it. Leading and trailing whitespaces will be
* trimmed.
*
* @throws ParseException if the specified index is invalid (not non-zero unsigned integer).
*/
public static Index parseIndex(String oneBasedIndex) throws ParseException {
String trimmedIndex = oneBasedIndex.trim();
if (!StringUtil.isNonZeroUnsignedInteger(trimmedIndex)) {
throw new ParseException(MESSAGE_INVALID_INDEX);
}
return Index.fromOneBased(Integer.parseInt(trimmedIndex));
}

/**
* Parses {@code clientId} into an {@code ClientId} and returns it. Leading and trailing whitespaces will be
* trimmed.
Expand Down

This file was deleted.

60 changes: 0 additions & 60 deletions src/test/java/seedu/address/commons/core/index/IndexTest.java

This file was deleted.

17 changes: 0 additions & 17 deletions src/test/java/seedu/address/logic/commands/CommandTestUtil.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package seedu.address.logic.commands;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static seedu.address.logic.parser.CliSyntax.PREFIX_ADDRESS;
import static seedu.address.logic.parser.CliSyntax.PREFIX_CLIENTID;
import static seedu.address.logic.parser.CliSyntax.PREFIX_CURRENTPLAN;
Expand All @@ -15,14 +14,11 @@
import static seedu.address.testutil.Assert.assertThrows;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import seedu.address.commons.core.index.Index;
import seedu.address.logic.commands.exceptions.CommandException;
import seedu.address.model.AddressBook;
import seedu.address.model.Model;
import seedu.address.model.person.NameContainsKeywordsPredicate;
import seedu.address.model.person.Person;
import seedu.address.testutil.EditPersonDescriptorBuilder;

Expand Down Expand Up @@ -142,18 +138,5 @@ public static void assertCommandFailure(Command command, Model actualModel, Stri
assertEquals(expectedAddressBook, actualModel.getAddressBook());
assertEquals(expectedFilteredList, actualModel.getFilteredPersonList());
}
/**
* Updates {@code model}'s filtered list to show only the person at the given {@code targetIndex} in the
* {@code model}'s address book.
*/
public static void showPersonAtIndex(Model model, Index targetIndex) {
assertTrue(targetIndex.getZeroBased() < model.getFilteredPersonList().size());

Person person = model.getFilteredPersonList().get(targetIndex.getZeroBased());
final String[] splitName = person.getName().fullName.split("\\s+");
model.updateFilteredPersonList(new NameContainsKeywordsPredicate(Arrays.asList(splitName[0])));

assertEquals(1, model.getFilteredPersonList().size());
}

}
83 changes: 0 additions & 83 deletions src/test/java/seedu/address/logic/commands/FindCommandTest.java

This file was deleted.

Loading

0 comments on commit d866992

Please sign in to comment.