-
Notifications
You must be signed in to change notification settings - Fork 166
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
base: master
Are you sure you want to change the base?
Conversation
…ons in the address book.
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.
Well done. Very concise implementation.
docs/UserGuide.adoc
Outdated
== Display total number of persons in address book : `total` | ||
|
||
Shows the total number of persons in the address book. + | ||
Format: `list` |
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.
Why is the format for total
command list
?
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.
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; |
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.
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(); } | ||
|
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.
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 :(
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.
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"; |
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.
I liked your usage of %1$s in the MESSAGE_TOTAL_IN_ADDRESSBOOK
String constant :)
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! No major issues. 👍
/** | ||
* Gets total number of persons in list. | ||
*/ | ||
public int getSize() { return internalList.size(); } |
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.
Formatting issue, please check coding standard
PR for LO ID W5.7