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-1]Wu Jiacheng #440

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

jiacheng-panda
Copy link

PR for LO ID W5.7

Copy link

@YipZong YipZong left a comment

Choose a reason for hiding this comment

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

Well done. Very concise implementation.

== Display total number of persons in address book : `total`

Shows the total number of persons in the address book. +
Format: `list`
Copy link

Choose a reason for hiding this comment

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

Why is the format for total command list?

Copy link
Author

Choose a reason for hiding this comment

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

It's a error. Thanks for pointing it out.


public static final String MESSAGE_USAGE = COMMAND_WORD
+ ": display the total number of persons stored in the address book.\n"
+ "Example: " + COMMAND_WORD;
Copy link

Choose a reason for hiding this comment

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

Nice! I did not think of explaining what the total command does in my own implementation. Oversight on my part :(. I totally assumed it would be similar to the clear and/or list command(s)

* Gets total number of persons in list.
*/
public int getTotal() { return allPersons.getSize(); }

Copy link

Choose a reason for hiding this comment

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

Nice naming of getter method as getTotal(). For me, I called it getSize() both in this file and src/seedu/addressbook/data/person/UniquePersonList.java :(

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

well done! thank you for acting so fast on it! :D

+ ": display the total number of persons stored in the address book.\n"
+ "Example: " + COMMAND_WORD;

public static final String MESSAGE_TOTAL_IN_ADDRESSBOOK = "There is/are %1$s person(s) in the address book";
Copy link

Choose a reason for hiding this comment

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

I liked your usage of %1$s in the MESSAGE_TOTAL_IN_ADDRESSBOOK String constant :)

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.

Good Job! No major issues. 👍

/**
* Gets total number of persons in list.
*/
public int getSize() { return internalList.size(); }

Choose a reason for hiding this comment

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

Formatting issue, please check coding standard

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