-
Notifications
You must be signed in to change notification settings - Fork 110
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
[W7.7][T10-B1] AcquaiNote #70
base: master
Are you sure you want to change the base?
Changes from 48 commits
d5c276e
c8699f6
865e823
a536a2b
d004ecd
8f7ec4b
265e2fa
ea8c7de
d1e18ff
9dc41eb
ea73f3b
d79ca10
463cf95
9e2ed9b
ae823b0
937b22b
d565ce9
358947e
c6ca876
9138485
351852e
64ab6bf
47714d6
f2f428d
0f3a3b6
083aede
b8e6e67
6c8820c
5571bcc
c1ace68
f130625
0a86db5
5b3055c
29efbf8
a2679e8
055d0c9
3065fa1
2311676
e3c12b8
f4a52f5
d66d6f9
054d974
0746e70
ca022d6
a423705
75c32f0
73b3609
1a67d1c
539c3f0
0bb0164
22bb411
e34e914
11cf879
b5cdcdf
d01fd28
8409377
2772f12
30192ec
fb00e9e
c6d9e57
679d589
79c8170
095d6a0
87be695
ae12738
0120f37
13c52bd
42a8a07
2e7e048
7f3dcb9
07547de
fa426e3
e43b6ab
8060012
dba6ce9
3c4fc2a
69e73cf
c01104a
02729f7
ad30a28
813fea5
286057a
8059b85
73fd6f7
1923d0f
95b7586
4209401
3a94973
17610aa
cdfd876
c44af62
765f46d
dd181be
39d3505
c03228e
e2bea7d
95d0ff9
d34049b
0bb4f95
5635f40
e23bf7f
1eca771
a30defe
3e7d80a
f165170
9a85034
997a19a
742430e
79de445
de6e7e2
5a57a09
45cd09e
d380077
c687637
3a1ee4c
83ff68e
cafe957
66b0790
ce294d0
ffa8d3c
6ed9967
234bd87
4bb4009
298be3d
3b3140b
b4a4f21
3d7f024
d639625
0fd0432
81825ba
7c65478
7038851
113db10
87b2147
819a1eb
00d43b5
5704e3d
82285ff
f233816
e75051b
abdc83d
195c1c2
43bb9ed
9a79839
6786e46
26202e4
b7c5907
5b946e0
379b3a0
bccb45b
be257ae
0ff8a2e
7158e31
6f76247
d52e195
15b6d34
a2b765d
227ca42
8bf6fab
f722aea
b9c9cca
f900783
0a0c835
97a7125
8a7c0ab
9b16917
679294b
0a331d2
9b83e6b
48bd902
6fe70f4
f48d0cb
047a198
7b92e56
78a98fb
2fbdd84
c87613e
5e33b7a
59af94f
38b611d
fea187d
d5ba22b
3906e4b
2897709
cc4f6d6
a1f0a89
4b1d20d
f81cd4b
4a90f2a
b4560d8
4731513
293ed33
824361d
e9ac256
501f8d6
7b46a4a
a276675
121b2bb
ee1694b
9f3b72f
afe0b6a
18c3565
8ec7f9b
6507460
a141beb
3b2cbbc
957c65a
4e663ab
cc3237e
2ff6027
e1a89a7
f744711
3e4011b
ba45262
ef5a814
fc66d29
bf23e61
b514138
b58d078
69db0fe
d836583
22ae95f
90bbd1d
1e1bd27
60a65aa
597a96f
90ce45e
4cda218
85d52cb
eaab96a
ebb8220
4241a2c
b7f234b
f81a95e
2b76c29
e8967b9
c234d83
f9ebcc1
bddd037
050be77
9c73223
18416c7
8b592f4
70a3cf0
09a71db
faf6696
e16ce3a
41a8f10
91153f2
5b75d32
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -760,7 +760,27 @@ Priorities: High (must have) - `* * \*`, Medium (nice to have) - `* \*`, Low (un | |
(For all use cases below, the *System* is the `AddressBook` and the *Actor* is the `user`, unless specified otherwise) | ||
|
||
[discrete] | ||
=== Use case: Delete person | ||
=== Use case: Delete person using index | ||
|
||
*MSS* | ||
|
||
1. User requests to delete a specific person | ||
2. AddressBook deletes the person | ||
+ | ||
Use case ends. | ||
|
||
*Extensions* | ||
|
||
[none] | ||
* 1a. The given name is absent. | ||
+ | ||
[none] | ||
** 1a1. AddressBook shows an error message. | ||
+ | ||
Use case ends. | ||
|
||
[discrete] | ||
=== Use case: Delete person using index | ||
|
||
*MSS* | ||
|
||
|
@@ -851,43 +871,6 @@ Use case ends. | |
+ | ||
Use case ends. | ||
|
||
[discrete] | ||
=== Use case: Delete confirmation | ||
|
||
*MSS* | ||
|
||
1. User requests to list persons | ||
2. AddressBook shows a list of persons | ||
3. User requests to delete a specific person in the list | ||
4. AddressBook displays a dialogue window asking user to confirm deletion | ||
5. User confirms deletion request | ||
6. AddressBook deletes the person | ||
+ | ||
Use case ends. | ||
|
||
*Extensions* | ||
|
||
[none] | ||
* 1a. The given index is invalid. | ||
+ | ||
[none] | ||
** 1a1. AddressBook shows an error message. | ||
+ | ||
Use case ends. | ||
|
||
[none] | ||
* 3a. The given index is invalid. | ||
+ | ||
[none] | ||
** 3a1. AddressBook shows an error message. | ||
+ | ||
Use case resumes at step 2. | ||
|
||
[none] | ||
* 5a. User cancels deletion. | ||
+ | ||
Use case ends. | ||
|
||
[discrete] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good job for updating the dev guide. |
||
=== Use case: Flexible contact addition | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
= AddressBook Level 4 - User Guide | ||
= AddressBook - User Guide | ||
:toc: | ||
:toc-title: | ||
:toc-placement: preamble | ||
|
@@ -92,8 +92,9 @@ Edits the phone number and email address of the 1st person to be `91234567` and | |
* `edit 2 n/Betsy Crower t/` + | ||
Edits the name of the 2nd person to be `Betsy Crower` and clears all existing tags. | ||
|
||
=== Locating persons by name: `find` | ||
=== Locating persons : `find` | ||
|
||
==== Default | ||
Finds persons whose names contain any of the given keywords. + | ||
Format: `find KEYWORD [MORE_KEYWORDS]` | ||
|
||
|
@@ -112,9 +113,47 @@ Returns `john` and `John Doe` | |
* `find Betsy Tim John` + | ||
Returns any person having names `Betsy`, `Tim`, or `John` | ||
|
||
==== Option1 | ||
|
||
Conducts fuzzy search for persons whose any detail contain the given keywords. + | ||
Format: `find -u KEYWORD` | ||
|
||
**** | ||
* The search is case insensitive. e.g `hans` will match `Hans` | ||
* All details are searched, including name, phone, email, address, tag and so on | ||
**** | ||
|
||
Examples: | ||
|
||
* `find -u jo` + | ||
Returns `john` and `John Doe` | ||
* `find -u 999` + | ||
Returns any person containing number `999` | ||
|
||
==== Option2 | ||
|
||
Finds by the specific details. + | ||
Format: `find -d [n/NAME] [p/PHONE_NUMBER] [e/EMAIL] [a/ADDRESS] [t/TAG]...` | ||
|
||
**** | ||
* The search is case insensitive. e.g `hans` will match `Hans` | ||
* At lease one argument must be given. e.g `find -d` will not work | ||
* Returns any person whose name contains the given name if name is specified, phone number contains + | ||
the given phone number if it is specified and so on to all details | ||
**** | ||
|
||
Examples: | ||
|
||
* `find -d n/jo` + | ||
Returns `john` and `John Doe` | ||
* `find -d p/999 e/nus` + | ||
Returns any person whose phone number contains number `999` and email address contains `nus` | ||
|
||
=== Deleting a person : `delete` | ||
|
||
Deletes the specified person from the address book. + | ||
==== Option1 | ||
|
||
Deletes the specified person from the address book using his/her corresponding index. + | ||
Format: `delete INDEX` | ||
|
||
**** | ||
|
@@ -132,6 +171,25 @@ Deletes the 2nd person in the address book. | |
`delete 1` + | ||
Deletes the 1st person in the results of the `find` command. | ||
|
||
==== Option2 | ||
|
||
Deletes the specified person from the address book using his/her name. + | ||
Format: `del NAME` | ||
|
||
**** | ||
* Deletes the person with the first occurrence of the specified `NAME`. | ||
* The name refers to the name shown in the contact list (case sensitive temporarily). | ||
* The name *must be a alphabets* john, Jane, Bob ... | ||
**** | ||
|
||
Examples: | ||
|
||
* `del Alex` + | ||
Deletes the first person named Alex in the address book contact list. | ||
* `find Betsy` + | ||
`del Betsy` + | ||
Deletes the 1st person in the results of the `find` command. | ||
|
||
=== Selecting a person : `select` | ||
|
||
Selects the person identified by the index number used in the last person listing. + | ||
|
@@ -227,6 +285,34 @@ Format: `exit` | |
Address book data are saved in the hard disk automatically after any command that changes the data. + | ||
There is no need to save manually. | ||
|
||
== Coming in v2.0 | ||
|
||
=== Sorting all contacts : `sort` | ||
|
||
Sorts all persons alphabetically. + | ||
Format: `sort` | ||
|
||
=== Right click menu | ||
|
||
A right click drop down list consisting some commonly used commands in UI. + | ||
There is no need to type in commands. | ||
|
||
=== Popup dialog window during editing | ||
|
||
A dialog window pops up during contact editing. | ||
|
||
=== To-do list: `sch` | ||
|
||
Attach a To-do list to a specified person to manage schedule with that person. + | ||
Format: `sch INDEX` | ||
|
||
Examples: | ||
|
||
* `sch 1 s/dinner at 7` + | ||
Adds schedule with the 1st person: `dinner at 7`. | ||
* `sch 2 s/` + | ||
Clears all existing schedules with the 2nd person. | ||
|
||
== FAQ | ||
|
||
*Q*: How do I transfer my data to another Computer? + | ||
|
@@ -237,8 +323,8 @@ There is no need to save manually. | |
* *Add* `add n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS [t/TAG]...` + | ||
e.g. `add n/James Ho p/22224444 e/[email protected] a/123, Clementi Rd, 1234665 t/friend t/colleague` | ||
* *Clear* : `clear` | ||
* *Delete* : `delete INDEX` + | ||
e.g. `delete 3` | ||
* *Delete* : `delete INDEX` or `del NAME` + | ||
e.g. `delete 3`, `del john` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good job for updating the UserGuide. |
||
* *Edit* : `edit INDEX [n/NAME] [p/PHONE_NUMBER] [e/EMAIL] [a/ADDRESS] [t/TAG]...` + | ||
e.g. `edit 2 n/James Lee e/[email protected]` | ||
* *Find* : `find KEYWORD [MORE_KEYWORDS]` + | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,14 +13,15 @@ public class StringUtil { | |
|
||
/** | ||
* Returns true if the {@code sentence} contains the {@code word}. | ||
* Ignores case, but a full word match is required. | ||
* <br>examples:<pre> | ||
* Ignores case, but a full word match is required. | ||
* <br>examples:<pre> | ||
* containsWordIgnoreCase("ABc def", "abc") == true | ||
* containsWordIgnoreCase("ABc def", "DEF") == true | ||
* containsWordIgnoreCase("ABc def", "AB") == false //not a full word match | ||
* </pre> | ||
* | ||
* @param sentence cannot be null | ||
* @param word cannot be null, cannot be empty, must be a single word | ||
* @param word cannot be null, cannot be empty, must be a single word | ||
*/ | ||
public static boolean containsWordIgnoreCase(String sentence, String word) { | ||
requireNonNull(sentence); | ||
|
@@ -33,7 +34,7 @@ public static boolean containsWordIgnoreCase(String sentence, String word) { | |
String preppedSentence = sentence; | ||
String[] wordsInPreppedSentence = preppedSentence.split("\\s+"); | ||
|
||
for (String wordInSentence: wordsInPreppedSentence) { | ||
for (String wordInSentence : wordsInPreppedSentence) { | ||
if (wordInSentence.equalsIgnoreCase(preppedWord)) { | ||
return true; | ||
} | ||
|
@@ -56,6 +57,7 @@ public static String getDetails(Throwable t) { | |
* e.g. 1, 2, 3, ..., {@code Integer.MAX_VALUE} <br> | ||
* Will return false for any other non-null string input | ||
* e.g. empty string, "-1", "0", "+1", and " 2 " (untrimmed), "3 0" (contains whitespace), "1 a" (contains letters) | ||
* | ||
* @throws NullPointerException if {@code s} is null. | ||
*/ | ||
public static boolean isNonZeroUnsignedInteger(String s) { | ||
|
@@ -68,4 +70,22 @@ public static boolean isNonZeroUnsignedInteger(String s) { | |
return false; | ||
} | ||
} | ||
|
||
/** | ||
* Returns true if {@code s} represents alphabets | ||
* e.g. abc, asfa, gg, ..., <br> | ||
* Will return false for any other non-alphabet string input | ||
* e.g. empty string, " abc " (untrimmed), "1 a" (contains number) | ||
* Will return false if the input string case does not match the string stored (case sensitive) | ||
* @throws NullPointerException if {@code s} is null. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good job for writing the comment |
||
*/ | ||
public static boolean isLettersOnly(String s) { | ||
requireNonNull(s); | ||
|
||
try { | ||
return s.matches("[\\p{Alpha}][\\p{Alpha} ]*"); | ||
} catch (IllegalArgumentException iae) { | ||
return false; | ||
} | ||
} | ||
} |
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 for updating AboutUS.