-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[T2A4][T11-A3]Pengcheng-an #14
base: master
Are you sure you want to change the base?
Conversation
This reverts commit bcaaa69.
T2A3 Exercise 1 and 2 |
Ready to view |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job on completing the activity. I believe this is wrongly labelled and should be T2A4. Try to keep the commits of each activity to one branch so that the commits from another activity do not overlap. When making a new branch for a new activity, return to master first so that it does not end up as a branch of another branch.
loadDataFromStorage(); | ||
while (true) { | ||
String userCommand = getUserInput(); | ||
String userCommand = getUserInput(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's an indentation error here. Our coding standard requires 4 spaces.
@@ -209,9 +213,10 @@ | |||
public static void main(String[] args) { | |||
showWelcomeMessage(); | |||
processProgramArgs(args); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try not to add new lines unnecessarily unless it forms a logical break or improves readability.
@@ -388,7 +395,9 @@ private static String executeCommand(String userInputString) { | |||
} | |||
} | |||
|
|||
/** | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These new lines are unnecessary.
} | ||
Collection<String> keywordsLowerCase=new HashSet<String>(); | ||
for (String s : keywords) { | ||
String temp=s.toLowerCase(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An indentation error here.
} | ||
}); | ||
showToUser(toBeDisplayed); | ||
return getMessageForPersonsDisplayedSummary(toBeDisplayed); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The last 3 lines appear to be indented one extra space.
* T2A4 | ||
* Displays all persons in the address book to the user; in alphabetical order. | ||
* comparator http://stackoverflow.com/questions/4699807/sort-arraylist-of-array-in-java | ||
* @return feedback display message for the operation result |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should an empty line between your description and your tags. Review the javadoc standards.
@@ -115,6 +117,8 @@ | |||
private static final String COMMAND_LIST_DESC = "Displays all persons as a list with index numbers."; | |||
private static final String COMMAND_LIST_EXAMPLE = COMMAND_LIST_WORD; | |||
|
|||
private static final String COMMAND_SORT_WORD = "sort"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'd notice that the the lines here follow a pattern. Good job on naming the variable in a similar fashion. You can consider adding desc and example variables and completing the help command to be updated with the sort command.
for (String s : keywords) { | ||
String temp=s.toLowerCase(); | ||
keywordsLowerCase.add(temp); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a pattern that you followed in changing the string to lower case. You can use this opportunity to abstract this into a method.
No description provided.