From a3044813b52aa52503f270cb5c96e5e7a3e1f5f2 Mon Sep 17 00:00:00 2001 From: bos10 Date: Mon, 28 Jan 2019 23:50:37 +0800 Subject: [PATCH 1/3] Modified 'find' method to allow case-insensitive --- src/seedu/addressbook/AddressBook.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/seedu/addressbook/AddressBook.java b/src/seedu/addressbook/AddressBook.java index 5a158b67..17f9666e 100644 --- a/src/seedu/addressbook/AddressBook.java +++ b/src/seedu/addressbook/AddressBook.java @@ -473,7 +473,7 @@ private static String getMessageForPersonsDisplayedSummary(ArrayList p * @return set of keywords as specified by args */ private static Set extractKeywordsFromFindPersonArgs(String findPersonCommandArgs) { - return new HashSet<>(splitByWhitespace(findPersonCommandArgs.trim())); + return new HashSet<>(splitByWhitespace(findPersonCommandArgs.trim().toLowerCase())); } /** @@ -485,7 +485,7 @@ private static Set extractKeywordsFromFindPersonArgs(String findPersonCo private static ArrayList getPersonsWithNameContainingAnyKeyword(Collection keywords) { final ArrayList matchedPersons = new ArrayList<>(); for (String[] person : getAllPersonsInAddressBook()) { - final Set wordsInName = new HashSet<>(splitByWhitespace(getNameFromPerson(person))); + final Set wordsInName = new HashSet<>(splitByWhitespace(getNameFromPerson(person).toLowerCase())); if (!Collections.disjoint(wordsInName, keywords)) { matchedPersons.add(person); } From 643a2a20696641f3f66a36fc0a19b14d41ddf27f Mon Sep 17 00:00:00 2001 From: bos10 Date: Tue, 29 Jan 2019 12:53:27 +0800 Subject: [PATCH 2/3] Added new 'count' method to display number of persons in address book --- src/seedu/addressbook/AddressBook.java | 45 ++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/src/seedu/addressbook/AddressBook.java b/src/seedu/addressbook/AddressBook.java index 17f9666e..d58d1957 100644 --- a/src/seedu/addressbook/AddressBook.java +++ b/src/seedu/addressbook/AddressBook.java @@ -23,6 +23,7 @@ import java.util.Scanner; import java.util.Set; + /* * NOTE : ============================================================= * This class header comment below is brief because details of how to @@ -70,6 +71,8 @@ public class AddressBook { private static final String MESSAGE_COMMAND_HELP = "%1$s: %2$s"; private static final String MESSAGE_COMMAND_HELP_PARAMETERS = "\tParameters: %1$s"; private static final String MESSAGE_COMMAND_HELP_EXAMPLE = "\tExample: %1$s"; + private static final String MESSAGE_COUNT_HELP = "%1$s: %2$s"; + private static final String MESSAGE_DELETE_PERSON_SUCCESS = "Deleted Person: %1$s"; private static final String MESSAGE_DISPLAY_PERSON_DATA = "%1$s Phone Number: %2$s Email: %3$s"; private static final String MESSAGE_DISPLAY_LIST_ELEMENT_INDEX = "%1$d. "; @@ -133,6 +136,10 @@ public class AddressBook { private static final String COMMAND_EXIT_DESC = "Exits the program."; private static final String COMMAND_EXIT_EXAMPLE = COMMAND_EXIT_WORD; + private static final String COMMAND_COUNT_WORD = "count"; + private static final String COMMAND_COUNT_DESC = "Counts number of persons in address book"; + private static final String COMMAND_COUNT_EXAMPLE = COMMAND_COUNT_WORD; + private static final String DIVIDER = "==================================================="; @@ -381,11 +388,14 @@ private static String executeCommand(String userInputString) { return executeClearAddressBook(); case COMMAND_HELP_WORD: return getUsageInfoForAllCommands(); + case COMMAND_COUNT_WORD: + return executeCountAddressBook(); case COMMAND_EXIT_WORD: executeExitProgramRequest(); default: return getMessageForInvalidCommandInput(commandType, getUsageInfoForAllCommands()); } + } /** @@ -462,6 +472,16 @@ private static String executeFindPersons(String commandArgs) { * @param personsDisplayed used to generate summary * @return summary message for persons displayed */ + private static String getMessageForPersonsCount(int numOfPersons) { + return "There is " + numOfPersons + " Persons in the Address Book"; + } + + /** + * Constructs a feedback message to the number of persons in the addressbook. + * + * @param numOfPersons used to generate summary + * @return Integer of num of persons in address book + */ private static String getMessageForPersonsDisplayedSummary(ArrayList personsDisplayed) { return String.format(MESSAGE_PERSONS_FOUND_OVERVIEW, personsDisplayed.size()); } @@ -579,6 +599,20 @@ private static String executeListAllPersonsInAddressBook() { return getMessageForPersonsDisplayedSummary(toBeDisplayed); } + /** + * Return number of persons in the address book to the user. + * + * @return feedback display message for the operation result + */ + + private static String executeCountAddressBook(){ + // Count number of person in AB + int numOfPersons = getAllPersonsInAddressBook().size(); + return getMessageForPersonsCount(numOfPersons); + } + + + /** * Requests to terminate the program. */ @@ -1087,8 +1121,9 @@ private static String getUsageInfoForAllCommands() { + getUsageInfoForViewCommand() + LS + getUsageInfoForDeleteCommand() + LS + getUsageInfoForClearCommand() + LS - + getUsageInfoForExitCommand() + LS - + getUsageInfoForHelpCommand(); + + getUsageInfoForExitCommand() + LSgi + + getUsageInfoForHelpCommand() + LS + + getUsageInfoForCountCommand(); } /** Returns the string for showing 'add' command usage instruction */ @@ -1136,6 +1171,12 @@ private static String getUsageInfoForExitCommand() { + String.format(MESSAGE_COMMAND_HELP_EXAMPLE, COMMAND_EXIT_EXAMPLE); } + /** Returns the string for showing 'count' command usage instruction */ + private static String getUsageInfoForCountCommand() { + return String.format(MESSAGE_COUNT_HELP, COMMAND_COUNT_WORD, COMMAND_COUNT_DESC) + + String.format(MESSAGE_COMMAND_HELP_EXAMPLE, COMMAND_COUNT_EXAMPLE); + } + /* * ============================ From e8a41d3aab9212be8477129cfb1097b7d90d7d1a Mon Sep 17 00:00:00 2001 From: bos10 Date: Tue, 29 Jan 2019 23:00:41 +0800 Subject: [PATCH 3/3] Provided new test cases and edited expected output, Problem with one test case - cant seem to find out why it is raising a difference when it looks exactly the same --- esc | 1008 ++++++++++++++++++++++++ src/seedu/addressbook/AddressBook.java | 2 +- test/expected.txt | 11 +- test/input.txt | 6 + test/runtests.bat | 1 + 5 files changed, 1024 insertions(+), 4 deletions(-) create mode 100644 esc diff --git a/esc b/esc new file mode 100644 index 00000000..03b9f8fd --- /dev/null +++ b/esc @@ -0,0 +1,1008 @@ +commit 643a2a20696641f3f66a36fc0a19b14d41ddf27f (HEAD -> Boston_Edit, origin/Boston_Edit) +Author: bos10 +Date: Tue Jan 29 12:53:27 2019 +0800 + + Added new 'count' method to display number of persons in address book + +commit a3044813b52aa52503f270cb5c96e5e7a3e1f5f2 (master) +Author: bos10 +Date: Mon Jan 28 23:50:37 2019 +0800 + + Modified 'find' method to allow case-insensitive + +commit bb493e8d8b36aa0d7d44ea35413ec92a43f2fdf3 (origin/master, origin/HEAD) +Merge: 13daa30 bfbbf71 +Author: Paul Tan +Date: Wed Dec 5 01:19:46 2018 +0800 + + Hide Gradle from IntelliJ (#109) + + Since our project is meant to be built with IntelliJ, and without + Gradle, remove the Gradle wrapper and rename the `build.gradle` file to + `build.gradle.txt` so that IntelliJ won't think that we have a Gradle + build file in the repo. + + [1/3] Add netlify.toml + [2/3] Remove Gradle wrapper + [3/3] Rename `build.gradle` to `build.gradle.txt` + +commit bfbbf7158437eabfc46f2397985955e2c3bc5f01 +Author: Paul Tan +Date: Thu Sep 6 00:34:48 2018 +0800 + + Rename `build.gradle` to `build.gradle.txt` + + We have a `build.gradle` file in the repo which tells Travis/Netlify how + to build our documentation with asciidoctor. + + However, when importing this repo as a project, IntelliJ will detect the + `build.gradle` file and prompt the user with the following: + + Unlinked Gradle project? + + Import Gradle project, this will also enable Gradle Tool Window... + + The correct action that should be taken by the user in this case is + _not_ to "Import Gradle project", as this project is meant to be built + without Gradle. However, this prompt may mislead the user into choosing + the wrong thing. + + Fix this by renaming `build.gradle` into `build.gradle.txt`. Keeping the + term `build.gradle` in the filename will allow readers to easily + identify the file as a `build.gradle` file, while the `.txt` extension + will make IntelliJ, and likely all other IDEs, stop identifying it as a + Gradle file (since text files, by definition, can contain anything). + +commit 0c52785974a5726cdfcadef66688411f2dbc9de8 +Author: Paul Tan +Date: Thu Sep 6 00:06:15 2018 +0800 + + Remove Gradle wrapper + + Our repo contains the Gradle wrapper to ensure that the correct Gradle + version is used when we are building our documentation with asciidoctor. + + However, IntelliJ has a strange quirk where if: + + * The project is imported by "Create Project from existing Sources", + and, + + * The `gradle-wrapper.jar` in the repo is selected as a library + (which is done by default) + + then IntelliJ might end up marking the `src` directory as "not a sources + root directory", resulting in IntelliJ not being able to compile and run + the project[1]. + + While workarounds exists (such as telling users not to select + `gradle-wrapper.jar` in the library selection stage), ultimately this + boils down to the fact that we include the gradle wrapper in the repo + even though ordinary users won't be using it. + + So, let's remove the Gradle wrapper in the repo. + + To ensure that Travis/Netlify install and use the correct Gradle + version, let's set up a system where Travis/Netlify will download the + Gradle wrapper at build time. We are already hosting the Gradle wrapper + of the version we want at https://se-edu.github.io/gradle-wrapper + + Once the Gradle wrapper is gone, we also don't need the troubleshooting + step added by [1] anymore, so let's remove it. + + [1] https://github.com/se-edu/addressbook-level1/commit/13daa30527fb541e6e7d073ec308537d1f21d871 + +commit f1d325b549d9248fd58b5e554d2b75088dc4a759 +Author: Paul Tan +Date: Thu Sep 13 21:29:30 2018 +0800 + + Add netlify.toml + + We use Netlify to build and host deploy previews of our documentation + for our PRs. Currently, Netlify is configured to build our documentation + using the command "./gradlew asciidoctor". + + Without a netlify.toml file in our repo, only the Nelify account owner + can change that command, which is inconvenient. + + Let's add a netlify.toml file to the repo, so that any committer to the + repo can change the Netlify configuration. + +commit 13daa30527fb541e6e7d073ec308537d1f21d871 +Author: Eugene Peh +Date: Sat Aug 25 10:36:10 2018 +0800 + + DeveloperGuide: add solution to src being treated as normal folder (#105) + + Occasionally, new developers may accidentally import the project as + a Gradle project. + + This cause IntelliJ to often triggers Gradle synchronization which + allows Gradle to impose the project to use its configuration. Due + to this issue, developers will encounter the problem of marked + directory keep getting reset upon restarting IntelliJ. + + Let's add the solution to this problem in the troubleshooting + section to help the developers who have accidentally misconfigured + the importation. + +commit 1827da83a97e94fd7cd2c663f3c2a2b6f114250e +Author: Loo Rong Jie +Date: Sat Aug 25 10:35:40 2018 +0800 + + [#107] runtests.bat: Allow user to run script outside test folder (#108) + + runtests.bat script does not work outside the test folder. + + Developers working on the project often have their working directory + set to the root of the project. It is inconvenient to switch in and out + of the test folder repeatedly in an edit-debug cycle. + + To reduce the hassle, let's add the commands in bat script to perform + the switching of directory automatically and hence increase our + productivity. + +commit ca2ab8c7cbf6b303f6e93327fbbdcc8250714067 +Author: Tan Wang Leng +Date: Sun Aug 19 16:06:45 2018 +0800 + + [#103] LearningOutcomes.adoc: fix link to download code (#104) + + Before fb74fba, learning outcomes were written in README.adoc. + Developers were instructed to use the 'Clone or download' button + **above** the page, when viewing README.adoc on GitHub. + + This instruction no longer make sense after learning outcomes have a + .adoc page on its own. Furthermore, the 'Clone or download' button will + not be available on the rendered static website version anyway, even if + it stayed in README.adoc. + + Let's fix the instruction's link to download code, by using the + `site-githuburl` attribute declared in `build.gradle`. That attribute + will not be declared when viewing the .adoc page on GitHub, so declare a + separate attribute for `env-github` environment. + +commit a9270ee306badf96936da1ba6dbf98f95cc49ed7 +Merge: 65762dd 48d9437 +Author: Jun An +Date: Mon Aug 13 13:22:15 2018 +0800 + + docs: fix documentation (#102) + + In UserGuide and DeveloperGuide, some sections are inconsistent + on whether the end of the bullet point has full stops or not. Let's + fix them. + + In LearningOutcomes, some of the links are broken. Let's fix them + as well. + +commit 48d94378331364a0a0fa3748817bcaae15f33893 +Author: Jun An +Date: Sat Aug 11 20:36:18 2018 +0800 + + docs: fix documentation + + In UserGuide and DeveloperGuide, some sections are inconsistent + on whether the end of the bullet point has full stops or not. Let's + fix them. + + In LearningOutcomes, some of the links are broken. Let's fix them + as well. + +commit 65762ddf8c601aa9d80b5e2ddd2877a8a61f6e52 +Author: Eugene Peh +Date: Mon Aug 6 09:00:17 2018 +0800 + + [#92] Fix runtests scripts proceeding on compilation error (#101) + + Runtests scripts compile the program under test, before executing the + tests. The tests always execute regardless of whether the compilation + succeeds or not. + + If the program has compilation errors, the runtests scripts are actually + testing an older version of the program without the errors. This results + in misleading test results. + + Let's teach the scripts to terminate immediately when the program fails + to compile. + +commit d10571b8fc869b0a4ca05d70380eac56d7b1975e +Author: Jun An +Date: Tue Jul 31 15:02:08 2018 +0800 + + [#99] Developer Guide: update to use Java 9 (#100) + + The project currently runs on Java 8. + + Since AddressBookL4 is already running on Java 9, this project should + be upgraded to run on Java 9 as well for consistency. + + Since the project is already compatible with Java 9, let's update the + DeveloperGuide to mention using Java 9 or later. + +commit 511b83478af513a4c6f8e6bda86cd1b3f7cffffa +Merge: 7d1a71a 6ea1f4e +Author: Paul Tan +Date: Thu Jul 5 22:53:30 2018 +0800 + + Port over documentation template from AB-4 (#98) + +commit 6ea1f4edcb31754b84ffc0b07141b89a571e6159 +Author: Paul Tan +Date: Thu Jul 5 22:26:37 2018 +0800 + + docs: configure template + + In the previous commit, we imported the documentation template from + AddressBook-Level4. + + However, the template is still configured for AddressBook-Level4. + + Let's use our own configuration. + +commit b6e0e9c4522e6a1b020eb7b89d7b1e1c214edc45 +Author: Paul Tan +Date: Thu Jul 5 22:17:05 2018 +0800 + + docs: port over template from AddressBook-Level4 + + The following commits implement the documentation template in + AddressBook-Level4: + + 686ec9ac9b9a17e5962c2341c08471e89d452d23..a1b29c20c825312a14ffe6b8242baee056cb5017 + + For consistency with AddressBook-Level4, port over those commits into + this repo. + + This is done by running the following shell script: + + git fetch https://github.com/se-edu/addressbook-level4 master && + git diff --binary 686ec9ac9b9a17e5962c2341c08471e89d452d23..a1b29c20c825312a14ffe6b8242baee056cb5017 >patch && + git apply --3way --include=build.gradle --include='docs/images/*' --include='docs/stylesheets/*' --include='docs/templates/*' patch + + and fixing the conflicts in build.gradle. + +commit 7d1a71aa643e8483dfac4b687f2a1435ab42d6d8 +Merge: 62a5ba0 274dbc9 +Author: Paul Tan +Date: Thu Jul 5 00:25:13 2018 +0800 + + Refactor UserGuide, DeveloperGuide and LearningOutcomes into separate docs (#97) + + Refactor out the User Guide, Developer Guide and Learning Outcomes into + separate documents for consistency with the other AddressBook levels. + +commit 274dbc93fb403dec3cfea3a45c0b3f962adf5446 +Author: Paul Tan +Date: Wed Jul 4 22:39:35 2018 +0800 + + README.adoc: add site map + + Allow visitors to navigate to the other documents in the documentation. + +commit fb74fbae41df8a5074b7ee1cdb3f4a2b215c4db0 +Author: Paul Tan +Date: Wed Jul 4 22:37:55 2018 +0800 + + docs: refactor out LearningOutcomes into a separate file + + Do this for consistency with the other AddressBook levels. + +commit 3d8e90aa0099e3b29e69a74f79f3e4c7186774c6 +Author: Paul Tan +Date: Wed Jul 4 22:34:20 2018 +0800 + + docs: refactor out UserGuide into separate file + + Do this for consistency with the other AddressBook levels. + +commit 1e7a58d1033cdc1e1d7bbad25c086362f976d5b8 +Author: Paul Tan +Date: Wed Jul 4 22:30:51 2018 +0800 + + docs: refactor out DeveloperGuide into separate file + + Do this for consistency with the other AddressBook levels. + +commit 62a5ba066c82d2c50f00e78ca9c1cdc1a6665b1b +Author: Paul Tan +Date: Wed Jul 4 10:44:03 2018 +0800 + + README.adoc: fix link to SE-EDU Team + +commit fb5acd62be9148f6a1c9908d610381665aa0015f +Merge: d559db4 c69ef5e +Author: Paul Tan +Date: Wed Jul 4 10:31:34 2018 +0800 + + Convert documentation to asciidoc format (#96) + + Convert documentation to asciidoc format, to be consistent with + AddressBook-Level4. + + [1/10] Translate markdown files into asciidoc files + [2/10] Add Gradle wrapper with Gradle 4.8.1 + [3/10] Setup asciidoc-to-html build system + [4/10] docs: add index.adoc + [5/10] README.adoc: automatically generate table of contents + [6/10] README.adoc: fix heading levels to be consistent + [7/10] README.adoc: don't manually specify numbers in numbered lists + [8/10] README.adoc: replace links with cross-references + [9/10] README.adoc: copy-edit + [10/10] Remove README.md + +commit c69ef5ee6ec489f2d7a378a593b8925ae9ba5a02 +Author: Paul Tan +Date: Wed Jul 4 01:52:03 2018 +0800 + + Remove README.md + + The conversion of all markdown files to asciidoc is now complete, and + the markdown files are not needed anymore. + +commit 3cb8007538aab34422b43793968c5e32131936ae +Author: Paul Tan +Date: Mon Jul 2 18:45:01 2018 +0800 + + README.adoc: copy-edit + + The README.adoc file was translated from README.md using pandoc. + + However, pandoc did not get the translation completely correct, and so + there are some mistakes here and there. + + Copy-edit README.adoc by reading through it, comparing it with + README.md, and correcting the errors. + +commit 7737d382ceb57df82cb275ab7c62eda8335eafde +Author: Paul Tan +Date: Mon Jul 2 18:49:06 2018 +0800 + + README.adoc: replace links with cross-references + + Internal links using HTML anchors can only be used with asciidoctor's + html backends. + + Let's use asciidoctor's cross-reference syntax, which allows our + document's internal links to be supported in other backends. + +commit a7eea83523ebb441fbbef5e8db6bd388beee8464 +Author: Paul Tan +Date: Mon Jul 2 18:36:25 2018 +0800 + + README.adoc: don't manually specify numbers in numbered lists + + This reduces the number of required modifications when we wish to insert + an item in the middle of the list. + +commit 9478746e37000971355c5f3390e15f8b49d638a2 +Author: Paul Tan +Date: Mon Jul 2 18:34:08 2018 +0800 + + README.adoc: fix heading levels to be consistent + + Asciidoctor complains with warnings when the heading levels are not + consistent (e.g. a heading with level 4 when the heading directly above + it is of level 2). + + Let's make asciidoctor happy by fixing the heading levels. + +commit 411e810f67c5d648d5eac79df5fdc563cc226c5c +Author: Paul Tan +Date: Mon Jul 2 18:27:58 2018 +0800 + + README.adoc: automatically generate table of contents + + Manually maintaining a table of contents is tedious, so let's replace it + with an automatically generated one. + +commit 632cb3aece648928883fc83d4daae8ed08791f67 +Author: Paul Tan +Date: Mon Jul 2 18:25:25 2018 +0800 + + docs: add index.adoc + + This document will mirror the contents of README.adoc, to serve as the + website home page. + +commit 62136d85b74770e7e4cea427c839ed5e52f9d877 +Author: Paul Tan +Date: Mon Jul 2 18:24:17 2018 +0800 + + Setup asciidoc-to-html build system + + Our markdown documentation is published to GitHub pages via its + automatic markdown files publishing support[1]. However, this mechanism + does not support asciidoc files. + + We are in the process of converting all of our documentation to + asciidoc, so we'll need to setup our own GitHub pages build and + deployment system. + + Let's reuse the asciidoc-to-html build system in addressbook-level4[2] + by copying the relevant code/files. + + [1] https://github.com/blog/2289-publishing-with-github-pages-now-as-easy-as-1-2-3 + [2] https://github.com/se-edu/addressbook-level4 + +commit cf3446a2a2d93c626a3d2c9f0aa7a585f76a67b0 +Author: Paul Tan +Date: Mon Jul 2 18:19:54 2018 +0800 + + Add Gradle wrapper with Gradle 4.8.1 + + Gradle 4.8.1 is the latest version of Gradle. + + The wrapper was created by running the following command: + + gradlew wrapper --gradle-version 4.8.1 + + and converting the line endings of gradlew.bat to unix to match our line + ending conventions. + +commit cef73bf6e971283083b95e867650d5f444da4d75 +Author: Paul Tan +Date: Mon Jul 2 18:17:34 2018 +0800 + + Translate markdown files into asciidoc files + + We are going to convert all of our documentation from markdown to + asciidoc format, in order to take advantage of the additional features + and semantic elements that asciidoc offers such as automatic section + numbering, admonitions and automatic table of contents (TOC) generation. + + Converting README.md by hand is going to be extremely tedious. + + As such, as a step towards the full conversion of our documentation to + asciidoc, let's enlist the help of pandoc[1] to translate our + documentation. + + The translation is done with pandoc 2.2.1 via this shell script: + + for x in $(find -name '*.md'); do + pandoc -f markdown_github-hard_line_breaks --wrap=preserve --atx-headers -o "${x%*.md}.adoc" "$x" + done + + While the majority of the translation is done faithfully, there are + still some errors here and there in the translated files. We will be + fixing them in subsequent commits. + + [1] http://pandoc.org/ + +commit d559db4f9c95baf1d3c3e8e8f90067d587c68708 +Author: Eugene Peh +Date: Tue Jan 30 11:32:13 2018 +0800 + + [#89] Test folder: add addressbook.txt (#90) + + The default storage file 'addressbook.txt' is not provided by default. + The program has to create a new storage file, and this process is + written in the program's log. + + Due to the additional information in the log, the first test run after + cloning the master always result in failure, as the additional + information creates a difference between actual.txt and expected.txt, + causing the test to fail. + + Let's add the default storage file 'addressbook.txt' into the test + folder so that the runtests.bat will stop failing on first run. + +commit e013f52873d1441a1b4ede979bc953d19f0f6296 +Author: Damith C. Rajapakse +Date: Sat Aug 12 23:57:26 2017 +0800 + + README: update LOs to refer to se-book + +commit ff94fca6ff83e9c8a75f378074fdd6555ac911e7 +Author: Damith C. Rajapakse +Date: Sat Aug 5 19:45:52 2017 +0800 + + README: add more details to the setup and testing instructions + +commit 8743c6a866c92ac847799167f17b09a50d3d6831 +Author: Damith C. Rajapakse +Date: Sat Aug 5 19:44:56 2017 +0800 + + README: refine first half of learning outcomes to refer to the se-book + +commit ca4f4fcdf19d59d4cee94f8cea08ad9a9a80351c +Author: Miao Ling +Date: Thu Jul 27 12:27:11 2017 +0800 + + [#87] Remove Eclipse project files (#88) + + As we have moved to IntelliJ, the Eclipse project files are no longer + needed. + + Let's remove these files/folders: + * .classpath + * .project + * .settings/* + * docs/*.pptx + +commit 8c6fd8a571d3f4f8ccd5aaf321e7e4eb1c9fce7d +Author: Miao Ling +Date: Fri Jul 21 16:37:21 2017 +0800 + + [#83] Contributors and Contact: point to same section in se-edu (#86) + + These sections can be found in se-edu. There is no need to duplicate + them here. + + Let's make these sections point to the respective sections in se-edu. + +commit a894d3fd42492288072420720536031398c4bc75 +Author: Miao Ling +Date: Thu Jul 20 16:04:50 2017 +0800 + + Convert README.md from Eclipse to IntelliJ (#85) + +commit a4515e3895ca1af1fc7c1753dec0a90c37366032 +Author: Damith C. Rajapakse +Date: Sat Apr 1 13:21:34 2017 +0800 + + Set theme jekyll-theme-cayman + +commit 19b1da19e1dba12e0707d04574c12c90a46c64d9 +Author: Akshay Narayan +Date: Mon Jan 23 14:17:06 2017 +0800 + + [#63] add additional option for LO-1KLoC (#63) + +commit c7a1d33365ddfc57ea21f852eaadd782eb923ab8 +Author: Damith C. Rajapakse +Date: Thu Jan 19 14:19:40 2017 +0800 + + Fix link to java coding standard + +commit fcc648ee603057d27581f6c4f3de0bbe68bd496d +Author: Damith C. Rajapakse +Date: Sun Jan 1 20:55:41 2017 +0800 + + Remove space before colon + +commit 47c7da07e92eefdaf8a5fc262094572a1ba171f5 +Author: Damith C. Rajapakse +Date: Sun Jan 1 20:53:35 2017 +0800 + + Raise level of exercise headings + +commit 38be8c7887c8ff059084d4df7848aa33fa390301 +Author: Damith C. Rajapakse +Date: Sun Jan 1 20:49:07 2017 +0800 + + Fix cosmetic issues of learning outcomes + +commit 79e3c3bb0a31273908796c09e5faabb532c9ab22 +Author: Damith C. Rajapakse +Date: Sun Dec 25 19:57:24 2016 +0800 + + [#7] Add a design description to the developer guide + + Fixes #7 + +commit a06d790415edde6e3d1b729f928d95c3820dea75 +Author: Damith C. Rajapakse +Date: Sun Dec 25 19:40:24 2016 +0800 + + Refine ToC + +commit f4fc356d57304032eb1a52ec0a0ff093b9307850 +Author: Damith C. Rajapakse +Date: Sun Dec 25 19:33:39 2016 +0800 + + Add LO for method abstraction + +commit 0465535d35e467e6e78a9a7346c2a5556e820650 +Author: Damith C. Rajapakse +Date: Sun Dec 25 12:21:18 2016 +0800 + + Change scope of private members from public to private + +commit dff416d21ff0dbfe376c533af94a72f02746eb72 +Author: Damith C. Rajapakse +Date: Sun Dec 25 12:13:48 2016 +0800 + + Remove compiler warning in getLinesInFile(String filePath) + +commit 592b3ab6d21b698db97c1312f2edea437d7251f9 +Author: Damith C. Rajapakse +Date: Sun Dec 25 12:10:23 2016 +0800 + + Remove unused method deletePersonFromAddressBook(int index) + +commit ef201a01725eaa26bdfd003bf5bb079d3f724446 +Author: Damith C. Rajapakse +Date: Sun Dec 25 12:09:27 2016 +0800 + + Remove compiler warning in splitByWhitespace(String toSplit) + +commit 51ada3c5fcccafb60ef7b8bcd72199bbc551eeab +Author: Damith C. Rajapakse +Date: Sun Dec 25 12:04:49 2016 +0800 + + Remove redundant method getLatestPersonListingView() + +commit a93bb237cfb0860d5efc8d81a4bce5b8c6ed9122 +Author: Damith C. Rajapakse +Date: Sun Dec 25 12:04:12 2016 +0800 + + Refine method header comments to follow coding style + +commit 66c2d59e6b0863e65654a598646daeb8bd35a50f +Author: Damith C. Rajapakse +Date: Sun Dec 25 11:36:00 2016 +0800 + + Fix outdated comment in isValidFilePath + +commit a5461870e3795d934b9cf44aba36abe3ebf72d69 +Author: Damith C. Rajapakse +Date: Sun Dec 25 11:00:03 2016 +0800 + + Refine NOTE comments + +commit 6954c21746fb558eb760d506b7c9468defa98d08 +Author: brandonyeoxg +Date: Fri Dec 23 22:19:31 2016 +0800 + + [#61] Update user guide for changing the save location (#62) + + * Update user guide to reflect the new implementation of isValidFilePath. + + * Fix formatting error for changing save location in user guide. + + * Fix formatting error for changing save location in user guide. + + * Fix formatting error for changing save location in user guide. + + Fix formatting error for changing save location in user guide. + + Fix formatting for user guide change save location. + + * Slight edit for user guide on changing the save location. + + * Improve clarity of 'regular' file. + + * Update regular file explanation. + +commit f51ffeb9b0b584df1a6b704e56aaddeb973808db +Author: brandonyeoxg +Date: Mon Dec 19 16:21:15 2016 +0800 + + [#55] Implement a more rigorous validity check for file path (#56) + +commit 800290bf7008520c1e713058fa9e0eb265daac53 +Author: Thenaesh Elango +Date: Sun Dec 11 10:44:14 2016 +0800 + + [#4] Convert coding best practices into a markdown document (#60) + +commit 668413ca452bb7307d5ec219e95fd4f96fe803df +Author: Huang Chao +Date: Fri Dec 9 16:46:59 2016 +0800 + + [#5] Add level2 headings to table of contents (#58) + +commit c72e691709e3095578f6138c68c9cebd28dbb5c1 +Author: Huang Chao +Date: Fri Dec 9 14:30:57 2016 +0800 + + [#3] Use a generic link for the coding standard (#59) + +commit 24f72417815023aa7459fdab4620c95d0e6313fc +Author: Akshay Narayan +Date: Wed Aug 24 12:02:53 2016 +0800 + + Added line in test\runtests.bat to create bin directory if it doesn't exist on windows. (#23) + +commit a2c90b73921c84a7fe944e33fca05fa14da6e5a0 +Author: Damith C. Rajapakse +Date: Sat Aug 20 15:29:22 2016 +0800 + + Use correct phrasing for example commit message + +commit 54cf7c43346f6a6b71d6492a900eba2d406bdc8c +Author: Wang Leng Tan +Date: Sat Aug 20 11:41:46 2016 +0800 + + [16][LO-Refactor] refers to the same learning outcome twice + +commit 3a8c7e8c5f0b8490afd104bb715507b436aa098b +Author: Zhang Yi Jiang +Date: Tue Aug 16 12:04:44 2016 +0800 + + [3] cd to script directory in runtests.sh and fix typo + + The script will not run properly otherwise if run from outside + the /tests directory. + +commit 1ec0bbf2bd7155c6de9baf2a5eed47a45328a8a8 +Author: Damith C. Rajapakse +Date: Sun Aug 14 13:29:58 2016 +0800 + + Fix 2nd broken link to coding best practices + Fixes #14 + +commit 68467674ff11a4d36321647819c24600c9566efa +Author: Damith C. Rajapakse +Date: Sun Aug 14 13:27:03 2016 +0800 + + Fix broken link to coding best practices + Fixes #14 + +commit 1a8e61c0e7ccdd2fd8311c224f843ed48f156c8a +Author: Wei Kang +Date: Sat Aug 13 16:21:30 2016 +0800 + + [13] Add missing data type to README.md + +commit 150cec80a47a1488456488d5e2be4dc9c27a26f0 (tag: v1.1) +Author: Thien Nguyen +Date: Thu Aug 11 14:12:33 2016 +0800 + + Add a runtests.sh #6 (#10) + + [6] Add a runtests.sh + +commit f33e570c13f03f1c91020c32109c4ebf569a23ce +Author: Martin Choo +Date: Thu Aug 11 12:58:57 2016 +0800 + + [12] Refine README (cosmetic) + +commit ceccce908102fefe059bf4e3dda8ab4385eaa54d +Author: Damith C. Rajapakse +Date: Thu Aug 11 09:55:57 2016 +0800 + + [9] Make userCommand variable local scope + + * Make userCommand variable local scope + + * updated I/O tests accordingly + +commit 22b0445020aa5cc946c103ffb237b619aad73ec0 +Author: Damith C. Rajapakse +Date: Thu Aug 11 09:32:05 2016 +0800 + + [8] Rename _WORD_ constants to be consistent with others + +commit 2b90746fa72dab2622caf785d1f68759826b03c4 +Author: Damith C. Rajapakse +Date: Wed Aug 10 23:08:52 2016 +0800 + + Rephrase method comment to describe WHAT, not HOW, the method does + +commit e2253d6269b71d777e1040a84dc9667e2d5cfde3 +Author: Damith C. Rajapakse +Date: Sun Aug 7 19:12:59 2016 +0800 + + Add link to reference process + +commit f62f7366f54acff4c9c92f6511c99186501f3363 (tag: V1.0) +Author: Damith C. Rajapakse +Date: Sat Aug 6 15:30:23 2016 +0800 + + Tweak README text (cosmetic) + +commit bdf4fa639cb9d0ad0aaa4418fdc23f071c461e14 +Author: Damith C. Rajapakse +Date: Sat Aug 6 15:08:42 2016 +0800 + + Change case of main headings, bold keywords + +commit b10d6e3589d8c055ddab3f917cac08c3eadaae07 +Author: Damith C. Rajapakse +Date: Fri Aug 5 18:49:05 2016 +0800 + + Added description to an LO + +commit f9d85f555eb2950cbbcc28a125330bd5ca314216 +Author: Damith C. Rajapakse +Date: Fri Aug 5 17:44:34 2016 +0800 + + Cross-linked LOs + +commit 01ee64f3dba59fa7a0c59a8426b33a2fe90e2bde +Author: Damith C. Rajapakse +Date: Fri Aug 5 17:40:54 2016 +0800 + + Refined Refactoring exercise + +commit 48d147c7cbb83aaced46714a3fa9d7a418ee831a +Author: Damith C. Rajapakse +Date: Fri Aug 5 17:25:13 2016 +0800 + + Reordered the LOs + +commit 648e9fd7f0d55f5e2d307a7ec0471498f691004d +Author: Damith C. Rajapakse +Date: Fri Aug 5 15:31:40 2016 +0800 + + Added resources to refactoring LO + +commit 656694f3e3e5d7455900c1f6d7b5443825bee28d +Author: Damith C. Rajapakse +Date: Thu Aug 4 15:26:29 2016 +0800 + + Tweaks to exercises + +commit 2172a006b571bc7c67510d829b3b217778919dc5 +Author: Damith C. Rajapakse +Date: Thu Aug 4 11:28:18 2016 +0800 + + Minor tweaks to LOs + +commit d781cb093026adbb2eb361e3a58723f2a73eee9b +Author: Damith C. Rajapakse +Date: Thu Aug 4 00:00:52 2016 +0800 + + Fixed minor typo + +commit 8dedcf8cd257e2ba4ce74545b0567f7393055335 +Author: Damith C. Rajapakse +Date: Wed Aug 3 23:49:55 2016 +0800 + + Updated links to slides + +commit 2877c3f4e0e8575469074cdf9663da56665e8adf +Author: Damith C. Rajapakse +Date: Wed Aug 3 23:39:41 2016 +0800 + + Added eclipse slides + +commit ca7d628b66bcbe94599ca7a273586a56cf5e26b8 (tag: v1.0beta) +Author: Damith C. Rajapakse +Date: Tue Aug 2 22:35:33 2016 +0800 + + Added another LO + +commit 50e4a47b036dfedd95b3b33eede4e3b4cd0210c4 +Author: Damith C. Rajapakse +Date: Tue Aug 2 20:25:43 2016 +0800 + + Added runtests.bat + +commit f2b874c86b1f936cf2a48b4fe9da92166784ff7d +Author: Damith C. Rajapakse +Date: Tue Aug 2 19:57:41 2016 +0800 + + Refined usage documentation + +commit 57a60e7bf5c796f724448a0a4740b819d92377d8 +Author: Damith C. Rajapakse +Date: Tue Aug 2 18:27:08 2016 +0800 + + Refined .ignore file + +commit 3f060158a6865f705db10a1a03cd0e963fdb19db +Author: Damith C. Rajapakse +Date: Tue Aug 2 18:22:00 2016 +0800 + + renamed package + +commit da92603c6bfeb204914632c672f9c81a37880411 +Author: Damith C. Rajapakse +Date: Tue Aug 2 18:16:51 2016 +0800 + + Minor tweaks to README + +commit 3a430884b2128758de123c28123f6fecff89e3c8 +Author: Damith C. Rajapakse +Date: Tue Aug 2 18:11:13 2016 +0800 + + Added the enum exercise + +commit 34c7dda9ad710b95406b3428ce9705479cee510c +Author: Damith C. Rajapakse +Date: Tue Aug 2 17:00:15 2016 +0800 + + Replaces List<> with ArrayList<> + +commit b0b59b89c21f1100488716f95869ff9a122e0c2a +Author: Damith C. Rajapakse +Date: Tue Aug 2 15:57:32 2016 +0800 + + Fixed some broken links to internal anchors + +commit e1611bb6699c783fe6b8e523264f26361bdf8bb7 +Author: Damith C. Rajapakse +Date: Tue Aug 2 00:05:22 2016 +0800 + + Added blank line + +commit 73067d160b500507e18d63134bdf182f76ec61dd +Author: Damith C. Rajapakse +Date: Mon Aug 1 23:14:02 2016 +0800 + + Added more exercises + +commit fa388458f82d3664d8b072e43f558c6f00212432 +Author: Damith C. Rajapakse +Date: Mon Aug 1 22:06:48 2016 +0800 + + Added var args + +commit d557ff454a95ccc2c39692a02daff18c20b70484 +Author: Damith C. Rajapakse +Date: Mon Aug 1 21:27:32 2016 +0800 + + Avoided dummy return + +commit 9899c2bcf4b95165811e2d421575255cddfee9c3 +Author: Damith C. Rajapakse +Date: Mon Aug 1 21:22:31 2016 +0800 + + Exit -> Exits + +commit 6dd84278507fd59adac9c1ba2bde1d556582510f +Author: Damith C. Rajapakse +Date: Mon Aug 1 21:20:09 2016 +0800 + + renamed default storage file + +commit e1549fd05891a213da302c5c0ff5141702f85ce0 +Author: Damith C. Rajapakse +Date: Mon Aug 1 21:12:39 2016 +0800 + + Fixed broken links + +commit 6a10e606d924dfa83687577c1c862dadd09665b7 +Author: Damith C. Rajapakse +Date: Mon Aug 1 19:06:52 2016 +0800 + + Added some exercises + +commit fe5655a29979a15e66717ab9543ae40453d8e547 (tag: v0.1-alpha) +Author: Damith C. Rajapakse +Date: Sun Jul 31 22:31:20 2016 +0800 + + Polish code, readme, tests (#2) + +commit 57ab42de42e484efa16ccd717376f75255dbbb00 +Author: Leow Yijin +Date: Sun Jul 31 10:26:45 2016 +0800 + + Cleaned, refactored, finished features, converted to address book context (#1) + + First full draft of AddressBook code + +commit b23349968081646a05451237fbd96e6f8f36011b +Author: Damith C. Rajapakse +Date: Wed Jul 27 11:06:33 2016 +0800 + + Added Jeffry's code + +commit 861663697899ecad08c9bd5e42bb6abbd7617e99 +Author: Damith C. Rajapakse +Date: Fri Jul 22 20:00:49 2016 +0800 + + Updated .ignore file to ignore idea files + +commit bbfb24d82222c6d57dc7d8c1fb8d518d52e825cb +Author: Damith C. Rajapakse +Date: Fri Jul 22 19:09:24 2016 +0800 + + Added missing line break + +commit 14cefd9db543c1e1b7de2a0254eb211ee01b8d57 +Author: Damith C. Rajapakse +Date: Fri Jul 22 19:08:35 2016 +0800 + + Minor tweak to exercise IDs + +commit c8b26916e3d96cda30a1ae1e6333ad2768bc20fd +Author: Damith C. Rajapakse +Date: Fri Jul 22 19:07:36 2016 +0800 + + Addes skeletal contents for README + +commit 05e56041d74dbee9f8cec631060b42a11aeab1e8 +Author: Damith C. Rajapakse +Date: Fri Jul 22 15:30:49 2016 +0800 + + Added a README.md + +commit 93c303f7038cc453ef6e41438489068649828126 +Author: Damith C. Rajapakse +Date: Fri Jul 22 15:20:34 2016 +0800 + + Initial commit diff --git a/src/seedu/addressbook/AddressBook.java b/src/seedu/addressbook/AddressBook.java index d58d1957..59cab548 100644 --- a/src/seedu/addressbook/AddressBook.java +++ b/src/seedu/addressbook/AddressBook.java @@ -1121,7 +1121,7 @@ private static String getUsageInfoForAllCommands() { + getUsageInfoForViewCommand() + LS + getUsageInfoForDeleteCommand() + LS + getUsageInfoForClearCommand() + LS - + getUsageInfoForExitCommand() + LSgi + + getUsageInfoForExitCommand() + LS + getUsageInfoForHelpCommand() + LS + getUsageInfoForCountCommand(); } diff --git a/test/expected.txt b/test/expected.txt index f18922ac..e469fc42 100644 --- a/test/expected.txt +++ b/test/expected.txt @@ -71,6 +71,7 @@ || || exit: Exits the program. Example: exit || help: Shows program usage instructions. Example: help +|| count: Counts number of persons in address book Example: count || =================================================== || Enter command: || [Command entered: clear] || Address book has been cleared! @@ -184,12 +185,13 @@ || 0 persons found! || =================================================== || Enter command: || [Command entered: find betsy] -|| -|| 0 persons found! +|| 1. Betsy Choo Phone Number: 222222 Email: benchoo@nus.edu.sg +|| +|| 1 persons found! || =================================================== || Enter command: || [Command entered: find Betsy] || 1. Betsy Choo Phone Number: 222222 Email: benchoo@nus.edu.sg -|| +|| || 1 persons found! || =================================================== || Enter command: || [Command entered: find Dickson] @@ -204,6 +206,9 @@ || || 2 persons found! || =================================================== +|| Enter command: || [Command entered: count] +|| There is 5 Persons in the Address Book +|| =================================================== || Enter command: || [Command entered: delete] || Invalid command format: delete || delete: Deletes a person identified by the index number used in the last find/list call. diff --git a/test/input.txt b/test/input.txt index 0b99df54..e837767d 100644 --- a/test/input.txt +++ b/test/input.txt @@ -61,6 +61,12 @@ # find multiple with some keywords find Charlie Betsy +########################################################## +# test count person command +########################################################## + # should match num of people in address book + count + ########################################################## # test delete person command ########################################################## diff --git a/test/runtests.bat b/test/runtests.bat index 7a75641c..b18d8a56 100644 --- a/test/runtests.bat +++ b/test/runtests.bat @@ -33,6 +33,7 @@ java -classpath ..\bin seedu.addressbook.AddressBook < input.txt >> actual.txt REM compare the output to the expected output FC actual.txt expected.txt +echo *** BUILD SUCCESS *** REM return to previous directory popd