-
Notifications
You must be signed in to change notification settings - Fork 113
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
[W5][W09-3] Sivakumar Bavadharini #156
base: master
Are you sure you want to change the base?
Conversation
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 OOP when creating new SortCommand class.
Tests and User Guide updated comprehensively.
Coding standard complied with although the use of import * could result in importing unnecessary classes.
Very useful enhancement, overall well done!
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.
@bava98 Nice job on implementing the sort command (: Remember to update the help command as well. Also, try to create a new branch for your feature (:
Please close this PR after reading review comments.
/** | ||
* Sorts all persons in the address book by their name and lists them to the user. | ||
*/ | ||
public class SortCommand extends Command{ |
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.
Remember to add a whitespace before the curly brace (:
public UniquePersonList sortListByName() { | ||
try { | ||
UniquePersonList sortedList = new UniquePersonList(this.internalList); | ||
sortedList.internalList.sort(new SortByName()); |
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 modifying a copy of the data instead of the original data (:
case HelpCommand.COMMAND_WORD: // Fallthrough | ||
default: | ||
return new HelpCommand(); | ||
case AddCommand.COMMAND_WORD: |
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 to follow the indentation in the coding standard for switch statements (:
@@ -15,6 +13,8 @@ | |||
import seedu.addressbook.data.person.ReadOnlyPerson; | |||
import seedu.addressbook.util.TypicalPersons; | |||
|
|||
import static org.testng.AssertJUnit.assertEquals; |
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 commit unrelated changes in this PR
import java.util.Collections; | ||
import java.util.Iterator; | ||
import java.util.List; | ||
import java.util.*; |
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.
Wildcard imports violate the coding standard. Please use single imports and change your settings in Intellij: Settings
> Editor
> Code Style
> Java
> Imports
and set both class count and names count to 99 (or any large number)
Add a sort command which sorts the list alphabetically and shows the sorted list, or no names if the list is empty.