Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanleekk committed Oct 26, 2023
1 parent 1bc6905 commit e210189
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
13 changes: 7 additions & 6 deletions src/main/java/seedu/staffsnap/commons/util/StringUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,15 @@ public static boolean containsWordIgnoreCase(String sentence, String word) {

/**
* Returns true if the {@code sentence} contains the {@code word}.
* Ignores case, but a full word match is required.
* Ignores case.
* <br>examples:<pre>
* containsWordIgnoreCase("ABc def", "abc") == true
* containsWordIgnoreCase("ABc def", "DEF") == true
* containsWordIgnoreCase("ABc def", "AB") == false //not a full word match
* containsStringIgnoreCase("ABc def", "abc") == true
* containsStringIgnoreCase("ABc def", "DEF") == true
* containsStringIgnoreCase("ABc def", "AB") == true
* containsStringIgnoreCase("ABc def", "acd") == false // "acd" is not a substring in "ABc def"
* </pre>
* @param sentence cannot be null
* @param word cannot be null, cannot be empty, must be a single word
* @param sentence a String that is not null
* @param word a String that is not empty and is not null
*/
public static boolean containsStringIgnoreCase(String sentence, String word) {
requireNonNull(sentence);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ public CommandResult execute(Model model) {
}

/**
* Checks if the applicant exists.
* @param other Other applicant.
* Checks if the two FilterCommand objects are equivalent, by comparing the equivalence of their predicates.
* @param other Other FilterCommand.
* @return true if equals, false if not equals.
*/
@Override
Expand All @@ -68,7 +68,6 @@ public boolean equals(Object other) {
}

FilterCommand otherFilterCommand = (FilterCommand) other;
System.out.println("predicate = " + predicate);
return predicate.equals(otherFilterCommand.predicate);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
/**
* Parses input arguments and creates a new FilterCommand object
*/

public class FilterCommandParser implements Parser<FilterCommand> {

/**
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/seedu/staffsnap/logic/parser/ParserUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,9 @@ public static boolean arePrefixesPresent(ArgumentMultimap argumentMultimap, Pref

/**
* Parses a {@code String status} into a {@code Status}.
*
* @param status String representation of Status
* @return Status if successful, or null of no matching status is found.
* @return Status if successful, or null if no matching status is found.
*/
public static Status parseStatus(String status) {
requireNonNull(status);
Expand All @@ -228,6 +229,7 @@ public static Status parseStatus(String status) {

/**
* Parses a {@code String score} into a {@code Double}.
*
* @param score String representation of score
* @return Double score which is the average rating of all interviews
* @throws ParseException if a NumberFormatException is caught
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/seedu/staffsnap/model/applicant/Applicant.java
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,7 @@ public void setStatus(Status status) {
public Double getScore() {
List<Interview> interviews = getInterviews();
Double totalScore = 0.;
for (Interview interview: interviews
) {
for (Interview interview: interviews) {
totalScore += new Double(interview.rating.value);
}
Double averageScore = totalScore / interviews.size();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public CustomFilterPredicate(Name name, Phone phone, Email email, Position posit
}

/**
* @param applicant the input argument
* @param applicant the applicant to be tested.
* @return true if applicant matches all specified fields in the predicate
*/
@Override
Expand Down

0 comments on commit e210189

Please sign in to comment.