diff --git a/README.md b/README.md
index 13f5c77403f..fbf473dc71e 100644
--- a/README.md
+++ b/README.md
@@ -1,14 +1,22 @@
-[](https://github.com/se-edu/addressbook-level3/actions)
+[](https://github.com/AY2021S1-CS2103-W14-3/tp/actions)
+# Introduction to Bamboo
+**Bamboo** is a brown-field software engineering team project based on the
+[AddressBook Level 3 (AB3)](https://github.com/se-edu/addressbook-level3) architecture, aimed at providing college students with a
+simple and accessible solution to **personal finance management**.
+
+## App Preview

-* This is **a sample project for Software Engineering (SE) students**.
- Example usages:
- * as a starting point of a course project (as opposed to writing everything from scratch)
- * as a case study
-* The project simulates an ongoing software project for a desktop application (called _AddressBook_) used for managing contact details.
- * It is **written in OOP fashion**. It provides a **reasonably well-written** code base **bigger** (around 6 KLoC) than what students usually write in beginner-level SE modules, without being overwhelmingly big.
- * It comes with a **reasonable level of user and developer documentation**.
-* It is named `AddressBook Level 3` (`AB3` for short) because it was initially created as a part of a series of `AddressBook` projects (`Level 1`, `Level 2`, `Level 3` ...).
-* For the detailed documentation of this project, see the **[Address Book Product Website](https://se-education.org/addressbook-level3)**.
-* This project is a **part of the se-education.org** initiative. If you would like to contribute code to this project, see [se-education.org](https://se-education.org#https://se-education.org/#contributing) for more info.
+## Useful Links
+### Features and User Guide
+Refer to the [User Guide](docs/UserGuide.md) for a detailed walk-through of how to use Bamboo.
+
+### Developer Guide
+Interested in contributing to Bamboo? The [Developer Guide](docs/DeveloperGuide.md) is a good place to start.
+
+### About Us
+Find out more about us [here](docs/AboutUs.md).
+
+## Acknowledgements
+* This project is based on the AddressBook-Level3 project created by the [SE-EDU initiative](https://se-education.org).
diff --git a/build.gradle b/build.gradle
index be2d2905dde..e9e2b8c7e50 100644
--- a/build.gradle
+++ b/build.gradle
@@ -6,7 +6,7 @@ plugins {
id 'jacoco'
}
-mainClassName = 'seedu.address.Main'
+mainClassName = 'seedu.expense.Main'
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
@@ -20,6 +20,10 @@ checkstyle {
toolVersion = '8.29'
}
+run {
+ enableAssertions = true
+}
+
test {
useJUnitPlatform()
finalizedBy jacocoTestReport
@@ -66,7 +70,7 @@ dependencies {
}
shadowJar {
- archiveName = 'addressbook.jar'
+ archiveName = 'expensebook.jar'
}
defaultTasks 'clean', 'test'
diff --git a/docs/AboutUs.md b/docs/AboutUs.md
index 1c9514e966a..85e1383966f 100644
--- a/docs/AboutUs.md
+++ b/docs/AboutUs.md
@@ -5,55 +5,61 @@ title: About Us
We are a team based in the [School of Computing, National University of Singapore](http://www.comp.nus.edu.sg).
-You can reach us at the email `seer[at]comp.nus.edu.sg`
+You can reach us through our respective emails.
## Project team
-### John Doe
+### Maxx Chan
-
+
-[[homepage](http://www.comp.nus.edu.sg/~damithch)]
-[[github](https://github.com/johndoe)]
-[[portfolio](team/johndoe.md)]
+[[github](https://github.com/maxxyh)]
+[[portfolio](team/maxxyh.md)]
+[[email](mailto:maxxchan@u.nus.edu)]
-* Role: Project Advisor
+* Role: Team Lead, Developer
+* Responsibilities: Scheduling and Tracking, Deliverables and Deadlines
-### Jane Doe
+### Hakiem Rasid
-
+
-[[github](http://github.com/johndoe)]
-[[portfolio](team/johndoe.md)]
+[[github](http://github.com/hakiem526)]
+[[portfolio](team/hakiem526.md)]
+[[email](mailto:e0325825@u.nus.edu)]
-* Role: Team Lead
-* Responsibilities: UI
+* Role: Developer
+* Responsibilities: Testing
-### Johnny Doe
+### Jaylen Lee
-
+
-[[github](http://github.com/johndoe)] [[portfolio](team/johndoe.md)]
+[[github](http://github.com/Jaylenlee)]
+[[portfolio](team/jaylenlee.md)]
+[[email](mailto:e0424677@u.nus.edu)]
* Role: Developer
-* Responsibilities: Data
+* Responsibilities: Integration
-### Jean Doe
+### Leben Chew
-
+
-[[github](http://github.com/johndoe)]
-[[portfolio](team/johndoe.md)]
+[[github](http://github.com/lebencwb)]
+[[portfolio](team/lebencwb.md)]
+[[email](mailto:leben.chew@u.nus.edu)]
* Role: Developer
-* Responsibilities: Dev Ops + Threading
+* Responsibilities: UI/UX
-### James Doe
+### Marcus Ng
-
+
-[[github](http://github.com/johndoe)]
-[[portfolio](team/johndoe.md)]
+[[github](http://github.com/marcus2k)]
+[[portfolio](team/marcus2k.md)]
+[[email](mailto:marcus@u.nus.edu)]
* Role: Developer
-* Responsibilities: UI
+* Responsibilities: Code Quality
diff --git a/docs/DevOps.md b/docs/DevOps.md
index 4414eea3344..94b9e4d2bee 100644
--- a/docs/DevOps.md
+++ b/docs/DevOps.md
@@ -44,7 +44,7 @@ As part of CI, this project uses Codecov to generate coverage reports. Here are
1. Sign up with Codecov using your GitHub account [here](https://codecov.io/signup).
1. Once you are inside Codecov web app, add your fork to CodeCov.
-1. Get the Markdown code for the Codecov badge provided in `Settings > Badges` and update the `docs/index.md` of your repo with it so that the badge [](https://codecov.io/gh/se-edu/addressbook-level3) in that page reflects the coverage of your project.
+1. Get the Markdown code for the Codecov badge provided in `Settings > Badges` and update the `docs/index.md` of your repo with it so that the badge [](https://codecov.io/gh/AY2021S1-CS2103-W14-3/tp) in that page reflects the coverage of your project.
### Repository-wide checks
@@ -73,7 +73,7 @@ Any warnings or errors will be printed out to the console.
Here are the steps to create a new release.
-1. Update the version number in [`MainApp.java`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/MainApp.java).
+1. Update the version number in [`MainApp.java`](https://github.com/AY2021S1-CS2103-W14-3/tp/tree/master/src/main/java/seedu/expense/MainApp.java).
1. Generate a fat JAR file using Gradle (i.e., `gradlew shadow`).
1. Tag the repo with the version number. e.g. `v0.1`
1. [Create a new release using GitHub](https://help.github.com/articles/creating-releases/). Upload the JAR file you created.
diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md
index 4829fe43011..342d36bbad8 100644
--- a/docs/DeveloperGuide.md
+++ b/docs/DeveloperGuide.md
@@ -23,11 +23,11 @@ The ***Architecture Diagram*** given above explains the high-level design of the
* This is a workaround for the following error when MainApp is made the * entry point of the application: - * - * Error: JavaFX runtime components are missing, and are required to run this application - * + *
+ * Error: JavaFX runtime components are missing, and are required to run this application + *
* The reason is that MainApp extends Application. In that case, the * LauncherHelper will check for the javafx.graphics module to be present * as a named module. We don't use JavaFX via the module system so it can't * find the javafx.graphics module, and so the launch is aborted. - * + *
* By having a separate main class (Main) that doesn't extend Application
* to be the entry point of the application, we avoid this issue.
*/
diff --git a/src/main/java/seedu/address/MainApp.java b/src/main/java/seedu/expense/MainApp.java
similarity index 58%
rename from src/main/java/seedu/address/MainApp.java
rename to src/main/java/seedu/expense/MainApp.java
index e5cfb161b73..1b58586164a 100644
--- a/src/main/java/seedu/address/MainApp.java
+++ b/src/main/java/seedu/expense/MainApp.java
@@ -1,4 +1,4 @@
-package seedu.address;
+package seedu.expense;
import java.io.IOException;
import java.nio.file.Path;
@@ -7,36 +7,38 @@
import javafx.application.Application;
import javafx.stage.Stage;
-import seedu.address.commons.core.Config;
-import seedu.address.commons.core.LogsCenter;
-import seedu.address.commons.core.Version;
-import seedu.address.commons.exceptions.DataConversionException;
-import seedu.address.commons.util.ConfigUtil;
-import seedu.address.commons.util.StringUtil;
-import seedu.address.logic.Logic;
-import seedu.address.logic.LogicManager;
-import seedu.address.model.AddressBook;
-import seedu.address.model.Model;
-import seedu.address.model.ModelManager;
-import seedu.address.model.ReadOnlyAddressBook;
-import seedu.address.model.ReadOnlyUserPrefs;
-import seedu.address.model.UserPrefs;
-import seedu.address.model.util.SampleDataUtil;
-import seedu.address.storage.AddressBookStorage;
-import seedu.address.storage.JsonAddressBookStorage;
-import seedu.address.storage.JsonUserPrefsStorage;
-import seedu.address.storage.Storage;
-import seedu.address.storage.StorageManager;
-import seedu.address.storage.UserPrefsStorage;
-import seedu.address.ui.Ui;
-import seedu.address.ui.UiManager;
+import seedu.expense.commons.core.Config;
+import seedu.expense.commons.core.LogsCenter;
+import seedu.expense.commons.core.Version;
+import seedu.expense.commons.exceptions.DataConversionException;
+import seedu.expense.commons.util.ConfigUtil;
+import seedu.expense.commons.util.StringUtil;
+import seedu.expense.logic.Logic;
+import seedu.expense.logic.LogicManager;
+import seedu.expense.model.ExpenseBook;
+import seedu.expense.model.Model;
+import seedu.expense.model.ModelManager;
+import seedu.expense.model.ReadOnlyExpenseBook;
+import seedu.expense.model.ReadOnlyUserPrefs;
+import seedu.expense.model.UserPrefs;
+import seedu.expense.model.alias.AliasMap;
+import seedu.expense.model.util.SampleDataUtil;
+import seedu.expense.storage.ExpenseBookStorage;
+import seedu.expense.storage.JsonAliasMapStorage;
+import seedu.expense.storage.JsonExpenseBookStorage;
+import seedu.expense.storage.JsonUserPrefsStorage;
+import seedu.expense.storage.Storage;
+import seedu.expense.storage.StorageManager;
+import seedu.expense.storage.UserPrefsStorage;
+import seedu.expense.ui.Ui;
+import seedu.expense.ui.UiManager;
/**
* Runs the application.
*/
public class MainApp extends Application {
- public static final Version VERSION = new Version(0, 6, 0, true);
+ public static final Version VERSION = new Version(1, 4, 0, true);
private static final Logger logger = LogsCenter.getLogger(MainApp.class);
@@ -48,7 +50,7 @@ public class MainApp extends Application {
@Override
public void init() throws Exception {
- logger.info("=============================[ Initializing AddressBook ]===========================");
+ logger.info("=============================[ Initializing ExpenseBook ]===========================");
super.init();
AppParameters appParameters = AppParameters.parse(getParameters());
@@ -56,8 +58,9 @@ public void init() throws Exception {
UserPrefsStorage userPrefsStorage = new JsonUserPrefsStorage(config.getUserPrefsFilePath());
UserPrefs userPrefs = initPrefs(userPrefsStorage);
- AddressBookStorage addressBookStorage = new JsonAddressBookStorage(userPrefs.getAddressBookFilePath());
- storage = new StorageManager(addressBookStorage, userPrefsStorage);
+ ExpenseBookStorage expenseBookStorage = new JsonExpenseBookStorage(userPrefs.getExpenseBookFilePath());
+ JsonAliasMapStorage aliasMapStorage = new JsonAliasMapStorage(userPrefs.getAliasMapFilePath());
+ storage = new StorageManager(expenseBookStorage, userPrefsStorage, aliasMapStorage);
initLogging(config);
@@ -69,28 +72,43 @@ public void init() throws Exception {
}
/**
- * Returns a {@code ModelManager} with the data from {@code storage}'s address book and {@code userPrefs}.
* {@code Index} should be used right from the start (when parsing in a new user input), so that if the current
* component wants to communicate with another component, it can send an {@code Index} to avoid having to know what
* base the other component is using for its index. However, after receiving the {@code Index}, that component can
diff --git a/src/main/java/seedu/address/commons/exceptions/DataConversionException.java b/src/main/java/seedu/expense/commons/exceptions/DataConversionException.java
similarity index 84%
rename from src/main/java/seedu/address/commons/exceptions/DataConversionException.java
rename to src/main/java/seedu/expense/commons/exceptions/DataConversionException.java
index 1f689bd8e3f..29551452f04 100644
--- a/src/main/java/seedu/address/commons/exceptions/DataConversionException.java
+++ b/src/main/java/seedu/expense/commons/exceptions/DataConversionException.java
@@ -1,4 +1,4 @@
-package seedu.address.commons.exceptions;
+package seedu.expense.commons.exceptions;
/**
* Represents an error during conversion of data from one format to another
diff --git a/src/main/java/seedu/address/commons/exceptions/IllegalValueException.java b/src/main/java/seedu/expense/commons/exceptions/IllegalValueException.java
similarity index 85%
rename from src/main/java/seedu/address/commons/exceptions/IllegalValueException.java
rename to src/main/java/seedu/expense/commons/exceptions/IllegalValueException.java
index 19124db485c..6076b5dd804 100644
--- a/src/main/java/seedu/address/commons/exceptions/IllegalValueException.java
+++ b/src/main/java/seedu/expense/commons/exceptions/IllegalValueException.java
@@ -1,4 +1,4 @@
-package seedu.address.commons.exceptions;
+package seedu.expense.commons.exceptions;
/**
* Signals that some given data does not fulfill some constraints.
@@ -13,7 +13,7 @@ public IllegalValueException(String message) {
/**
* @param message should contain relevant information on the failed constraint(s)
- * @param cause of the main exception
+ * @param cause of the main exception
*/
public IllegalValueException(String message, Throwable cause) {
super(message, cause);
diff --git a/src/main/java/seedu/address/commons/util/AppUtil.java b/src/main/java/seedu/expense/commons/util/AppUtil.java
similarity index 94%
rename from src/main/java/seedu/address/commons/util/AppUtil.java
rename to src/main/java/seedu/expense/commons/util/AppUtil.java
index 87aa89c0326..001b14c733e 100644
--- a/src/main/java/seedu/address/commons/util/AppUtil.java
+++ b/src/main/java/seedu/expense/commons/util/AppUtil.java
@@ -1,9 +1,9 @@
-package seedu.address.commons.util;
+package seedu.expense.commons.util;
import static java.util.Objects.requireNonNull;
import javafx.scene.image.Image;
-import seedu.address.MainApp;
+import seedu.expense.MainApp;
/**
* A container for App specific utility functions
diff --git a/src/main/java/seedu/address/commons/util/CollectionUtil.java b/src/main/java/seedu/expense/commons/util/CollectionUtil.java
similarity index 90%
rename from src/main/java/seedu/address/commons/util/CollectionUtil.java
rename to src/main/java/seedu/expense/commons/util/CollectionUtil.java
index eafe4dfd681..0ccc69a56ac 100644
--- a/src/main/java/seedu/address/commons/util/CollectionUtil.java
+++ b/src/main/java/seedu/expense/commons/util/CollectionUtil.java
@@ -1,4 +1,4 @@
-package seedu.address.commons.util;
+package seedu.expense.commons.util;
import static java.util.Objects.requireNonNull;
@@ -12,7 +12,9 @@
*/
public class CollectionUtil {
- /** @see #requireAllNonNull(Collection) */
+ /**
+ * @see #requireAllNonNull(Collection)
+ */
public static void requireAllNonNull(Object... items) {
requireNonNull(items);
Stream.of(items).forEach(Objects::requireNonNull);
diff --git a/src/main/java/seedu/address/commons/util/ConfigUtil.java b/src/main/java/seedu/expense/commons/util/ConfigUtil.java
similarity index 77%
rename from src/main/java/seedu/address/commons/util/ConfigUtil.java
rename to src/main/java/seedu/expense/commons/util/ConfigUtil.java
index f7f8a2bd44c..3e31c15c119 100644
--- a/src/main/java/seedu/address/commons/util/ConfigUtil.java
+++ b/src/main/java/seedu/expense/commons/util/ConfigUtil.java
@@ -1,11 +1,11 @@
-package seedu.address.commons.util;
+package seedu.expense.commons.util;
import java.io.IOException;
import java.nio.file.Path;
import java.util.Optional;
-import seedu.address.commons.core.Config;
-import seedu.address.commons.exceptions.DataConversionException;
+import seedu.expense.commons.core.Config;
+import seedu.expense.commons.exceptions.DataConversionException;
/**
* A class for accessing the Config File.
diff --git a/src/main/java/seedu/address/commons/util/FileUtil.java b/src/main/java/seedu/expense/commons/util/FileUtil.java
similarity index 97%
rename from src/main/java/seedu/address/commons/util/FileUtil.java
rename to src/main/java/seedu/expense/commons/util/FileUtil.java
index b1e2767cdd9..44a49622c50 100644
--- a/src/main/java/seedu/address/commons/util/FileUtil.java
+++ b/src/main/java/seedu/expense/commons/util/FileUtil.java
@@ -1,4 +1,4 @@
-package seedu.address.commons.util;
+package seedu.expense.commons.util;
import java.io.IOException;
import java.nio.file.Files;
@@ -20,6 +20,7 @@ public static boolean isFileExists(Path file) {
/**
* Returns true if {@code path} can be converted into a {@code Path} via {@link Paths#get(String)},
* otherwise returns false.
+ *
* @param path A string representing the file path. Cannot be null.
*/
public static boolean isValidPath(String path) {
@@ -33,6 +34,7 @@ public static boolean isValidPath(String path) {
/**
* Creates a file if it does not exist along with its missing parent directories.
+ *
* @throws IOException if the file or directory cannot be created.
*/
public static void createIfMissing(Path file) throws IOException {
diff --git a/src/main/java/seedu/address/commons/util/JsonUtil.java b/src/main/java/seedu/expense/commons/util/JsonUtil.java
similarity index 94%
rename from src/main/java/seedu/address/commons/util/JsonUtil.java
rename to src/main/java/seedu/expense/commons/util/JsonUtil.java
index 8ef609f055d..ae4fd426668 100644
--- a/src/main/java/seedu/address/commons/util/JsonUtil.java
+++ b/src/main/java/seedu/expense/commons/util/JsonUtil.java
@@ -1,4 +1,4 @@
-package seedu.address.commons.util;
+package seedu.expense.commons.util;
import static java.util.Objects.requireNonNull;
@@ -20,8 +20,8 @@
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
-import seedu.address.commons.core.LogsCenter;
-import seedu.address.commons.exceptions.DataConversionException;
+import seedu.expense.commons.core.LogsCenter;
+import seedu.expense.commons.exceptions.DataConversionException;
/**
* Converts a Java object instance to JSON and vice versa
@@ -51,7 +51,8 @@ static
* Returns null if there are no matches
- *
*/
private Level getLoggingLevel(String loggingLevelString) {
return Level.parse(loggingLevelString);
diff --git a/src/main/java/seedu/address/commons/util/StringUtil.java b/src/main/java/seedu/expense/commons/util/StringUtil.java
similarity index 82%
rename from src/main/java/seedu/address/commons/util/StringUtil.java
rename to src/main/java/seedu/expense/commons/util/StringUtil.java
index 61cc8c9a1cb..8d1f9e272d0 100644
--- a/src/main/java/seedu/address/commons/util/StringUtil.java
+++ b/src/main/java/seedu/expense/commons/util/StringUtil.java
@@ -1,7 +1,7 @@
-package seedu.address.commons.util;
+package seedu.expense.commons.util;
import static java.util.Objects.requireNonNull;
-import static seedu.address.commons.util.AppUtil.checkArgument;
+import static seedu.expense.commons.util.AppUtil.checkArgument;
import java.io.PrintWriter;
import java.io.StringWriter;
@@ -14,28 +14,29 @@ public class StringUtil {
/**
* Returns true if the {@code sentence} contains the {@code word}.
- * Ignores case, but a full word match is required.
- *
+ * Able to take in up to 3 parameters, specifying sorts according to Amount, Date and Description.
+ *
* E.g if {@code argsString} = "e/hip/900", {@code prefix} = "p/" and
* {@code fromIndex} = 0, this method returns -1 as there are no valid
* occurrences of "p/" with whitespace before it. However, if
@@ -82,7 +83,7 @@ private static int findPrefixPosition(String argsString, String prefix, int from
*
* @param argsString Arguments string of the form: {@code preamble
- * The data from the sample address book will be used instead if {@code storage}'s address book is not found,
- * or an empty address book will be used instead if errors occur when reading {@code storage}'s address book.
+ * Returns a {@code ModelManager} with the data from {@code storage}'s expense book and {@code userPrefs}.
+ * The data from the sample expense book will be used instead if {@code storage}'s expense book is not found,
+ * or an empty expense book will be used instead if errors occur when reading {@code storage}'s expense book.
*/
private Model initModelManager(Storage storage, ReadOnlyUserPrefs userPrefs) {
- Optional
* These loggers have been configured to output messages to the console and a {@code .log} file by default,
- * at the {@code INFO} level. A new {@code .log} file with a new numbering will be created after the log
- * file reaches 5MB big, up to a maximum of 5 files.
+ * at the {@code INFO} level. A new {@code .log} file with a new numbering will be created after the log
+ * file reaches 5MB big, up to a maximum of 5 files.
*/
public class LogsCenter {
private static final int MAX_FILE_COUNT = 5;
private static final int MAX_FILE_SIZE_IN_BYTES = (int) (Math.pow(2, 20) * 5); // 5MB
- private static final String LOG_FILE = "addressbook.log";
+ private static final String LOG_FILE = "expensebook.log";
private static Level currentLogLevel = Level.INFO;
private static final Logger logger = LogsCenter.getLogger(LogsCenter.class);
private static FileHandler fileHandler;
@@ -95,6 +95,7 @@ private static void addFileHandler(Logger logger) {
/**
* Creates a {@code FileHandler} for the log file.
+ *
* @throws IOException if there are problems opening the file.
*/
private static FileHandler createFileHandler() throws IOException {
diff --git a/src/main/java/seedu/expense/commons/core/Messages.java b/src/main/java/seedu/expense/commons/core/Messages.java
new file mode 100644
index 00000000000..02b69f89bf8
--- /dev/null
+++ b/src/main/java/seedu/expense/commons/core/Messages.java
@@ -0,0 +1,18 @@
+package seedu.expense.commons.core;
+
+import seedu.expense.logic.commands.AddCategoryCommand;
+
+/**
+ * Container for user visible messages.
+ */
+public class Messages {
+
+ public static final String MESSAGE_UNKNOWN_COMMAND = "Unknown command";
+ public static final String MESSAGE_INVALID_COMMAND_FORMAT = "Invalid command format! \n%1$s";
+ public static final String MESSAGE_INVALID_EXPENSE_DISPLAYED_INDEX = "The expense index provided is invalid";
+ public static final String MESSAGE_EXPENSES_LISTED_OVERVIEW = "%1$d expenses listed!";
+ public static final String MESSAGE_INVALID_CATEGORY = "The \"%s\" category does not exist in the expense book. "
+ + "If you need to, please add it using the \"" + AddCategoryCommand.COMMAND_WORD + "\" command first.";
+ public static final String MESSAGE_INPUT_OVERLIMIT =
+ "Input is too long! Maximum characters for %1$s: %2$d";
+}
diff --git a/src/main/java/seedu/address/commons/core/Version.java b/src/main/java/seedu/expense/commons/core/Version.java
similarity index 98%
rename from src/main/java/seedu/address/commons/core/Version.java
rename to src/main/java/seedu/expense/commons/core/Version.java
index 12142ec1e32..86dead60daf 100644
--- a/src/main/java/seedu/address/commons/core/Version.java
+++ b/src/main/java/seedu/expense/commons/core/Version.java
@@ -1,4 +1,4 @@
-package seedu.address.commons.core;
+package seedu.expense.commons.core;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -50,6 +50,7 @@ public boolean isEarlyAccess() {
/**
* Parses a version number string in the format V1.2.3.
+ *
* @param versionString version number string
* @return a Version object
*/
diff --git a/src/main/java/seedu/address/commons/core/index/Index.java b/src/main/java/seedu/expense/commons/core/index/Index.java
similarity index 97%
rename from src/main/java/seedu/address/commons/core/index/Index.java
rename to src/main/java/seedu/expense/commons/core/index/Index.java
index 19536439c09..c283fc45052 100644
--- a/src/main/java/seedu/address/commons/core/index/Index.java
+++ b/src/main/java/seedu/expense/commons/core/index/Index.java
@@ -1,8 +1,8 @@
-package seedu.address.commons.core.index;
+package seedu.expense.commons.core.index;
/**
* Represents a zero-based or one-based index.
- *
+ *
examples:
+ * Ignores case, but a full word match is required.
+ *
examples:
* containsWordIgnoreCase("ABc def", "abc") == true
* containsWordIgnoreCase("ABc def", "DEF") == true
* containsWordIgnoreCase("ABc def", "AB") == false //not a full word match
*
+ *
* @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);
requireNonNull(word);
- String preppedWord = word.trim();
+ String preppedWord = word.trim().toLowerCase();
checkArgument(!preppedWord.isEmpty(), "Word parameter cannot be empty");
checkArgument(preppedWord.split("\\s+").length == 1, "Word parameter should be a single word");
- String preppedSentence = sentence;
+ String preppedSentence = sentence.toLowerCase();
String[] wordsInPreppedSentence = preppedSentence.split("\\s+");
return Arrays.stream(wordsInPreppedSentence)
- .anyMatch(preppedWord::equalsIgnoreCase);
+ .anyMatch(x -> x.contains(preppedWord));
}
/**
@@ -53,6 +54,7 @@ public static String getDetails(Throwable t) {
* e.g. 1, 2, 3, ..., {@code Integer.MAX_VALUE}
* 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) {
diff --git a/src/main/java/seedu/expense/logic/Logic.java b/src/main/java/seedu/expense/logic/Logic.java
new file mode 100644
index 00000000000..1cb8d308c4c
--- /dev/null
+++ b/src/main/java/seedu/expense/logic/Logic.java
@@ -0,0 +1,61 @@
+package seedu.expense.logic;
+
+import java.nio.file.Path;
+
+import javafx.collections.ObservableList;
+import seedu.expense.commons.core.GuiSettings;
+import seedu.expense.logic.commands.CommandResult;
+import seedu.expense.logic.commands.exceptions.CommandException;
+import seedu.expense.logic.parser.exceptions.ParseException;
+import seedu.expense.model.ReadOnlyExpenseBook;
+import seedu.expense.model.Statistics;
+import seedu.expense.model.expense.Expense;
+
+/**
+ * API of the Logic component
+ */
+public interface Logic {
+ /**
+ * Executes the command and returns the result.
+ *
+ * @param commandText The command as entered by the user.
+ * @return the result of the command execution.
+ * @throws CommandException If an error occurs during command execution.
+ * @throws ParseException If an error occurs during parsing.
+ */
+ CommandResult execute(String commandText) throws CommandException, ParseException;
+
+ /**
+ * Returns the ExpenseBook.
+ *
+ * @see seedu.expense.model.Model#getExpenseBook()
+ */
+ ReadOnlyExpenseBook getExpenseBook();
+
+ /**
+ * Returns the Statistics.
+ *
+ * @see seedu.expense.model.Model#getStatistics()
+ */
+ Statistics getStatistics();
+
+ /**
+ * Returns an unmodifiable view of the filtered list of expenses
+ */
+ ObservableList
- * e.g. {@code some preamble text t/ 11.00 t/12.00 k/ m/ July} where prefixes are {@code t/ k/ m/}.
+ * e.g. {@code some preamble text t/ 11.00 t/12.00 k/ m/ July} where prefixes are {@code t/ k/ m/}.
* 1. An argument's value can be an empty string e.g. the value of {@code k/} in the above example.
* 2. Leading and trailing whitespaces of an argument value will be discarded.
* 3. An argument may be repeated and all its values will be accumulated e.g. the value of {@code t/}
- * in the above example.
+ * in the above example.
*/
public class ArgumentTokenizer {
@@ -21,7 +21,7 @@ public class ArgumentTokenizer {
*
* @param argsString Arguments string of the form: {@code preamble