Skip to content

Commit

Permalink
Merge 1a7c1a1 into 3b8b245
Browse files Browse the repository at this point in the history
  • Loading branch information
garylyp committed Oct 25, 2019
2 parents 3b8b245 + 1a7c1a1 commit 891a0ef
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 235 deletions.
20 changes: 0 additions & 20 deletions docs/UserGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -163,24 +163,6 @@ Edits the name, date and calories burnt of the 4th exercise to `Swim`, `21/09/20
Edits the name, date, calories burnt, quantity, units and muscle group trained of the 3rd exercise to `Bench press`,
`22/09/2019`, `240`, `10`, `sets` and `Chest` respectively.

=== Locating exercises by name: `find`

Finds exercises whose names contain any of the given keywords. +
Format: `find KEYWORD [MORE_KEYWORDS]`

****
* The search is case insensitive. e.g `run` will match `Run`
* The order of the keywords does not matter. e.g. `Bench Press` will match `Press Bench`
* Only the name is searched.
* Only full words will be matched e.g. `Runs` will not match `Run`
* Exercises matching at least one keyword will be returned (i.e. `OR` search). e.g. `Bench Press` will return `Incline Bench Press`, `Decline Bench Press`
****

Examples:

* `find bench press`
* `find run`

// tag::delete[]
=== Delete health information : `delete`

Expand Down Expand Up @@ -471,8 +453,6 @@ e.g. `add t/exercise n/Bench press d/19/09/2019 c/500 q/50 u/reps m/Chest`
e.g. `list t/exercise s/12/12/2019 e/17/12/2019`
* *Edit* : `edit t/exercise i/INDEX [n/EXERCISE_NAME] [d/DATE] [c/CALORIES] [q/QUANTITY] [u/UNITS] [m/MUSCLE]... `
e.g. `edit t/exercise i/3 n/Bench press d/22/09/2019 c/240 q/10 u/sets m/Chest`
* *Find* : `find KEYWORD [MORE_KEYWORDS]`
e.g. `find bench press`
* *Delete* : `delete t/exercise i/INDEX`
e.g. `delete t/exercise i/2`
* *Clear* : `clear`
Expand Down
42 changes: 0 additions & 42 deletions src/main/java/seedu/exercise/logic/commands/FindCommand.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public class ClearEvent implements Event {
*
* @param eventPayload a wrapper class that stores the exercise book in the state before the ClearEvent.
*/
@SuppressWarnings("unchecked")
public ClearEvent(EventPayload<? super ReadOnlyResourceBook<Exercise>> eventPayload) {
this.exerciseBookCleared = (ReadOnlyResourceBook<Exercise>) eventPayload.get(KEY_EXERCISE_BOOK_CLEARED);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import seedu.exercise.logic.commands.DeleteExerciseCommand;
import seedu.exercise.logic.commands.EditCommand;
import seedu.exercise.logic.commands.ExitCommand;
import seedu.exercise.logic.commands.FindCommand;
import seedu.exercise.logic.commands.HelpCommand;
import seedu.exercise.logic.commands.ListCommand;
import seedu.exercise.logic.commands.RedoCommand;
Expand Down Expand Up @@ -68,9 +67,6 @@ public Command parseCommand(String userInput) throws ParseException {
case RedoCommand.COMMAND_WORD:
return new RedoCommand();

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

case ListCommand.COMMAND_WORD:
return new ListCommand();

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

This file was deleted.

87 changes: 0 additions & 87 deletions src/test/java/seedu/exercise/logic/commands/FindCommandTest.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
import static seedu.exercise.testutil.Assert.assertThrows;
import static seedu.exercise.testutil.TypicalIndexes.INDEX_FIRST_EXERCISE;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

import org.junit.jupiter.api.Test;

import seedu.exercise.logic.commands.AddExerciseCommand;
Expand All @@ -21,12 +17,10 @@
import seedu.exercise.logic.commands.EditCommand;
import seedu.exercise.logic.commands.EditCommand.EditExerciseDescriptor;
import seedu.exercise.logic.commands.ExitCommand;
import seedu.exercise.logic.commands.FindCommand;
import seedu.exercise.logic.commands.HelpCommand;
import seedu.exercise.logic.commands.ListCommand;
import seedu.exercise.logic.parser.exceptions.ParseException;
import seedu.exercise.model.resource.Exercise;
import seedu.exercise.model.resource.NameContainsKeywordsPredicate;
import seedu.exercise.testutil.exercise.EditExerciseDescriptorBuilder;
import seedu.exercise.testutil.exercise.ExerciseBuilder;
import seedu.exercise.testutil.exercise.ExerciseUtil;
Expand Down Expand Up @@ -71,14 +65,6 @@ public void parseCommand_exit() throws Exception {
assertTrue(parser.parseCommand(ExitCommand.COMMAND_WORD + " 3") instanceof ExitCommand);
}

@Test
public void parseCommand_find() throws Exception {
List<String> keywords = Arrays.asList("foo", "bar", "baz");
FindCommand command = (FindCommand) parser.parseCommand(
FindCommand.COMMAND_WORD + " " + keywords.stream().collect(Collectors.joining(" ")));
assertEquals(new FindCommand(new NameContainsKeywordsPredicate(keywords)), command);
}

@Test
public void parseCommand_help() throws Exception {
assertTrue(parser.parseCommand(HelpCommand.COMMAND_WORD) instanceof HelpCommand);
Expand Down

This file was deleted.

0 comments on commit 891a0ef

Please sign in to comment.