Skip to content
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.7][F11-2] Neil Mehta #459

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

neilish3re
Copy link

Add Sort Command Class File (just the class file, haven't been able to parse the command yet)

@nus-se-pr-bot
Copy link

Hi @neilish3re, your pull request title is invalid.

For PR sent to satisfy a learning outcome, the PR name should be in the format of [Learning Outcome ID][Team ID] Your Name, where [Learning Outcome ID] has no dashes or spaces (e.g. [W3.1a]) and [Team ID] has one dash only and no spaces (e.g. [W14-2] means Wednesday 2pm (14 hrs), Team 2).
E.g. If you are in tutorial W09 (i.e. Wednesday 9am), team 1, and is submitting a PR for LO W2.2b, the PR title would be [W2.2b][W09-1] James Yong. Note that your tutorial IDs are different from those shown in CORS/IVLE.

For team PR, the PR name should be in the format of [Team ID] Product Name (e.g. [T09-2] Contact List Pro).

Please follow the above format strictly and edit your title for reprocessing.

Note: this comment is posted by a bot. If you believe this is done in error, please create an issue at nus-se-pr-bot and add a link to this PR.

@neilish3re neilish3re changed the title Add SortCommand Class [W5.7][F11-2] Add SortCommand Class Sep 13, 2018
@neilish3re neilish3re changed the title [W5.7][F11-2] Add SortCommand Class [W5.7][F11-2] Neil Mehta Sep 13, 2018
Copy link

@teowz46 teowz46 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition, I'm not sure if I understand where the sorting part is, could someone point it out?

import seedu.addressbook.data.person.Person;
import seedu.addressbook.data.person.ReadOnlyPerson;

import java.util.*;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can't do this?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow coding standards. No wild cards for imports.

import java.util.*;

//Sorts contact list of persons by alphabetical order
public class SortCommand extends Command{
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

space needed after Command


private final Set<String> keywords;

public SortCommand(Set<String> keywords){
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

space needed after closing bracket

Copy link

@liliwei25 liliwei25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This implementation of SortCommand is not correct. It performs the same action as FindCommand. Please sort this out.

import seedu.addressbook.data.person.Person;
import seedu.addressbook.data.person.ReadOnlyPerson;

import java.util.*;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow coding standards. No wild cards for imports.


import java.util.*;

//Sorts contact list of persons by alphabetical order

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alphabetical order according to which attribute?

* @param keywords for searching
* @return list of persons found
*/
private List<ReadOnlyPerson> getPersonsWithNameContainingAnyKeyword(Set<String> keywords) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a direct copy from FindCommand. I don't think this performs any sorting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants