From d7752b07596f5f380f66d6e25c4f6e466eaf8c84 Mon Sep 17 00:00:00 2001 From: itsmejr257 Date: Wed, 3 Apr 2024 23:05:40 +0800 Subject: [PATCH 1/9] Add JavaDoc comments to RecurringExpenseCommand --- .../command/RecurringExpenseCommand.java | 112 +++++++++++++++--- 1 file changed, 97 insertions(+), 15 deletions(-) diff --git a/src/main/java/seedu/budgetbuddy/command/RecurringExpenseCommand.java b/src/main/java/seedu/budgetbuddy/command/RecurringExpenseCommand.java index a125d4cea8..a23770c7e6 100644 --- a/src/main/java/seedu/budgetbuddy/command/RecurringExpenseCommand.java +++ b/src/main/java/seedu/budgetbuddy/command/RecurringExpenseCommand.java @@ -2,6 +2,7 @@ import seedu.budgetbuddy.commons.Expense; import seedu.budgetbuddy.commons.ExpenseList; +import seedu.budgetbuddy.commons.RecurringExpenseList; import seedu.budgetbuddy.commons.RecurringExpensesList; import seedu.budgetbuddy.Ui; import seedu.budgetbuddy.exception.BudgetBuddyException; @@ -18,7 +19,6 @@ public class RecurringExpenseCommand extends Command{ private String initialListName; private String commandType; private int listNumber; - private String category; private Double amount; private String description; @@ -26,11 +26,27 @@ public class RecurringExpenseCommand extends Command{ private final Ui ui = new Ui(); + /** + * Constructs a RecurringExpenseCommand for operations that only require the recurringExpensesList. + * This constructor is used when the commandType is `viewlists` + * + * @param recurringExpensesList The overall recurringExpensesList containing the list of ExpenseList + * @param commandType The commandType of the RecurringExpenseCommand + */ public RecurringExpenseCommand(RecurringExpensesList recurringExpensesList, String commandType) { this.commandType = commandType; this.recurringExpensesList = recurringExpensesList; } + /** + * Constructs a RecurringExpenseCommand for operations that require the name of the ExpenseList + * , the recurringExpensesList + * This constructor is used when the commandType is `newlist` + * + * @param initialListName The name of the new RecurringExpenseList to create + * @param recurringExpensesList The overall recurringExpensesList containing the list of ExpenseList + * @param commandType The commandType of the RecurringExpenseCommand + */ public RecurringExpenseCommand(String initialListName, RecurringExpensesList recurringExpensesList, String commandType) { this.initialListName = initialListName; @@ -38,6 +54,14 @@ public RecurringExpenseCommand(String initialListName, this.recurringExpensesList = recurringExpensesList; } + /** + * Constructs a RecurringExpenseCommand for operations that require listNumber, recurringExpensesList + * This constructor is used when the commandType is either `viewexpenses` or `removelist` + * + * @param listNumber The listNumber associated to the listName printed during a `viewlists` command + * @param recurringExpensesList The overall recurringExpensesList containing the list of ExpenseList + * @param commandType The commandType of the RecurringExpenseCommand + */ public RecurringExpenseCommand(int listNumber, RecurringExpensesList recurringExpensesList, String commandType) { this.listNumber = listNumber; @@ -45,6 +69,17 @@ public RecurringExpenseCommand(int listNumber, this.recurringExpensesList = recurringExpensesList; } + + /** + * Constructs a RecurringExpenseCommand for operations that require listNumber, recurringExpensesList + * , overallExpenses. + * This constructor is used when the commandType is `addrec` + * + * @param listNumber The listNumber associated to the listName printed during a `viewlists` command + * @param recurringExpensesList The overall recurringExpensesList containing the list of ExpenseList + * @param overallExpenses The overall ExpenseList containing all the user's expenses + * @param commandType The commandType of the RecurringExpenseCommand + */ public RecurringExpenseCommand(int listNumber, RecurringExpensesList recurringExpensesList, ExpenseList overallExpenses, String commandType) { @@ -54,6 +89,18 @@ public RecurringExpenseCommand(int listNumber, RecurringExpensesList recurringEx this.commandType = commandType; } + /** + * Constructs a RecurringExpenseCommand for operations that require listNumber, recurringExpensesList, + * category, amount, description. + * This constructor is used when the commandType is `newexpense` + * + * @param listNumber The listNumber associated to the listName printed during a `viewlists` command + * @param recurringExpensesList The overall recurringExpensesList containing the list of ExpenseList + * @param category The category of the new expense user wishes to add + * @param amount The amount of the new expense user wishes to add + * @param description The description of the new expense user wishes to add + * @param commandType The commandType of the RecurringExpenseCommand + */ public RecurringExpenseCommand(int listNumber, RecurringExpensesList recurringExpensesList, String category, Double amount, String description, String commandType) { @@ -65,12 +112,21 @@ public RecurringExpenseCommand(int listNumber, RecurringExpensesList recurringEx this.commandType = commandType; } - + /** + * Adds a new list with the name `listName` to the recurringExpensesList + * + * @param listName The name of the new list + */ private void addNewList(String listName) { recurringExpensesList.addNewRecurringList(listName); } - private void removeList() { + /** + * Removes the ExpenseList located at listNumber in the overall recurringExpensesList + * + * @param listNumber The list position of the ExpenseList to remove + */ + private void removeList(int listNumber) { if (listNumber == 0 || listNumber > recurringExpensesList.getSize()) { System.out.println("Invalid List Number. Choose a List Number from 1 onwards"); @@ -81,7 +137,17 @@ private void removeList() { recurringExpensesList.removeList(listNumber); } - private void addExpenseToList() { + + /** + * Adds an Expense with the provided category, amount and description to the ExpenseList located + * at the provided listNumber in the overall recurringExpensesList + * + * @param listNumber The list position of the ExpenseList to add the Expense in + * @param category The category of the Expense to add + * @param amount The amount of the Expense to add + * @param description The description of the Expense to add + */ + private void addExpenseToList(int listNumber, String category, Double amount, String description) { if (listNumber <= 0 || listNumber > recurringExpensesList.getSize()) { System.out.println("Invalid List Number. Choose a List Number from 1 onwards"); @@ -106,7 +172,17 @@ private void addExpenseToList() { } - private void addRecurringExpensesToExpenses() { + + /** + * Adds all Expenses in the ExpenseList located at the provided listNumber in the `recurringExpensesList`, + * into the provided `overallExpenses` + * + * @param listNumber The list position of the ExpenseList in recurringExpensesList + * @param recurringExpensesList The overall recurringExpensesList + * @param overallExpenses The overall expenses + */ + private void addRecurringExpensesToExpenses(int listNumber, RecurringExpensesList recurringExpensesList + , ExpenseList overallExpenses) { if (listNumber <= 0 || listNumber > recurringExpensesList.getSize()) { System.out.println("Invalid List Number. Choose a List Number from 1 onwards"); @@ -136,7 +212,14 @@ private void addRecurringExpensesToExpenses() { } - private void printExpensesAtIndex() { + /** + * Prints all expenses in the ExpenseList located at the provided `listNumber` in the overall + * `recurringExpensesList` + * + * @param listNumber The list position of the ExpenseList in recurringExpensesList + * @param recurringExpensesList The recurringExpensesList to obtain ExpenseList from + */ + private void printExpensesAtIndex(int listNumber, RecurringExpensesList recurringExpensesList) { if (listNumber <= 0 || listNumber > recurringExpensesList.getSize()) { System.out.println("Invalid List Number. Choose a List Number from 1 onwards"); @@ -149,6 +232,10 @@ private void printExpensesAtIndex() { expenseList.listExpenses(null); } + + /** + * Prints the names of all ExpenseList in the recurringExpensesList + */ private void printList() { recurringExpensesList.printAllRecurringLists(); } @@ -158,26 +245,21 @@ public void execute(){ case "newlist": addNewList(initialListName); break; - case "viewlists": printList(); break; - case "removelist": - removeList(); + removeList(this.listNumber); break; - case "newexpense": - addExpenseToList(); + addExpenseToList(this.listNumber, this.category, this.amount, this.description); break; case "addrec": - addRecurringExpensesToExpenses(); + addRecurringExpensesToExpenses(this.listNumber, this.recurringExpensesList, this.overallExpenses); break; - case "viewexpenses": - printExpensesAtIndex(); + printExpensesAtIndex(this.listNumber, this.recurringExpensesList); break; - default: break; } From 722a79a22d70fdf5c1d437a1efe5a87cff77b271 Mon Sep 17 00:00:00 2001 From: itsmejr257 Date: Wed, 3 Apr 2024 23:05:50 +0800 Subject: [PATCH 2/9] Add JavaDoc comments to RecurringExpenseCommandCreator --- .../RecurringExpenseCommandCreator.java | 105 ++++++++++++++++++ 1 file changed, 105 insertions(+) diff --git a/src/main/java/seedu/budgetbuddy/commandcreator/RecurringExpenseCommandCreator.java b/src/main/java/seedu/budgetbuddy/commandcreator/RecurringExpenseCommandCreator.java index 84ab6a2d1c..49f7f36f3d 100644 --- a/src/main/java/seedu/budgetbuddy/commandcreator/RecurringExpenseCommandCreator.java +++ b/src/main/java/seedu/budgetbuddy/commandcreator/RecurringExpenseCommandCreator.java @@ -19,6 +19,13 @@ public class RecurringExpenseCommandCreator extends CommandCreator{ private RecurringExpensesList recurringExpensesList; private ExpenseList expenses; + + /** + * Constructs a RecurringExpenseCommandCreator with the provided input, recurringExpensesList and expenses + * @param input The user input + * @param recurringExpensesList The RecurringExpensesList containing a list of ExpenseList + * @param expenses The ExpenseList containing user's overall expenses + */ public RecurringExpenseCommandCreator(String input, RecurringExpensesList recurringExpensesList , ExpenseList expenses) { @@ -27,6 +34,12 @@ public RecurringExpenseCommandCreator(String input, RecurringExpensesList recurr this.expenses = expenses; } + /** + * Checks the input for the presence of `|` and `!`. Throws the BudgetBuddyException if detected in the user input + * + * @param input The user input + * @throws IllegalArgumentException if any of the required prefixes are not found + */ private void checkForInvalidCharacters(String input) throws BudgetBuddyException{ if (input.contains("|") || input.contains("!")) { LOGGER.log(Level.WARNING, "An attempt of including a | and ! in input has been detected." + @@ -35,6 +48,13 @@ private void checkForInvalidCharacters(String input) throws BudgetBuddyException } } + /** + * Creates a RecurringExpenseCommand to view all expenses in a specific ExpenseList in recurringExpensesList + * This method obtains the listNumber from the provided commandParts. + * + * @param commandParts The split parts of the input command string + * @return RecurringExpenseCommand if list number is valid, returns null if list number is invalid or empty + */ public Command createViewExpensesCommand(String[] commandParts) { try { String listNumberAsString = commandParts[2]; @@ -52,6 +72,15 @@ public Command createViewExpensesCommand(String[] commandParts) { return null; } } + + /** + * Creates a RecurringExpenseCommand to add the expenses in a specific ExpenseList in recurringExpensesList into + * the overall ExpenseList. + * This method obtains the listNumber from the provided commandParts. + * + * @param commandParts The split parts of the input command string + * @return RecurringExpenseCommand if the list number is valid, returns null if list number is invalid or empty + */ public Command createAddListToOverallExpensesCommand(String[] commandParts) { try { @@ -72,12 +101,26 @@ public Command createAddListToOverallExpensesCommand(String[] commandParts) { } + + /** + * Checks the input for the presence of all the required to/ , d/, a/ and c/ prefixes + * + * @param input The user input + * @throws IllegalArgumentException if any of the required prefixes are not found + */ private static void checkForInvalidParameters(String input) { if (!input.contains("to/") || !input.contains("d/") || !input.contains("a/") || !input.contains("c/")) { throw new IllegalArgumentException("Please Ensure that you include to/, c/, a/ and d/"); } } + /** + * Parses the description from the input string + * + * @param input The user input + * @return The extracted description from the d/ prefix + * @throws BudgetBuddyException if the description is empty + */ private String parseDescription(String input) throws BudgetBuddyException { int indexOfDescriptionPrefix = input.indexOf(DESCRIPTION_PREFIX); int startIndexOfDescription = indexOfDescriptionPrefix + DESCRIPTION_PREFIX.length(); @@ -93,6 +136,15 @@ private String parseDescription(String input) throws BudgetBuddyException { return description; } + + /** + * Parses the amount from the input string + * + * @param input The user input + * @return The extracted amount from the a/ prefix + * @throws NumberFormatException If the extracted amount is not a valid double + * @throws BudgetBuddyException If the extracted amount is empty + */ private Double parseAmount(String input) throws NumberFormatException, BudgetBuddyException{ int indexOfAmountPrefix = input.indexOf(AMOUNT_PREFIX); int startIndexOfAmount = indexOfAmountPrefix + AMOUNT_PREFIX.length(); @@ -112,6 +164,13 @@ private Double parseAmount(String input) throws NumberFormatException, BudgetBud return amount; } + /** + * Parses the category from the input string + * + * @param input The user input + * @return The extracted category from the c/ prefix + * @throws BudgetBuddyException If the category is empty + */ private String parseCategory(String input) throws BudgetBuddyException{ int indexOfCategoryPrefix = input.indexOf(CATEGORY_PREFIX); int startIndexOfCategory = indexOfCategoryPrefix + CATEGORY_PREFIX.length(); @@ -127,6 +186,15 @@ private String parseCategory(String input) throws BudgetBuddyException{ return category; } + + /** + * Parses the list number from the input string + * + * @param input The user input + * @return The extracted list number from the `to/` prefix + * @throws NumberFormatException if the list number is not a valid number + * @throws BudgetBuddyException if the list number is empty + */ private int parseListNumber(String input) throws NumberFormatException, BudgetBuddyException{ int indexOfListNumberPrefix = input.indexOf(LISTNUMBER_PREFIX); int startIndexOfListNumber = indexOfListNumberPrefix + LISTNUMBER_PREFIX.length(); @@ -145,6 +213,13 @@ private int parseListNumber(String input) throws NumberFormatException, BudgetBu return listNumber; } + + /** + * Creates a RecurringExpenseCommand to add an expense into a specific ExpenseList in recurringExpensesList + * + * @param input The user input + * @return RecurringExpenseCommand if user input is valid, returns null if any of the user input is invalid + */ public Command createAddExpenseToListCommand(String input) { try { checkForInvalidParameters(input); @@ -183,6 +258,13 @@ public Command createAddExpenseToListCommand(String input) { } + /** + * Creates a RecurringExpenseCommand to remove a specified ExpenseList in the recurringExpensesList + * This method uses the provided commandParts to obtain the list Number of the ExpenseList to remove + * + * @param commandParts The split parts of the user input + * @return RecurringExpenseCommand if user input is valid, returns null if listNumber is empty or invalid + */ public Command createRemoveListCommand(String[] commandParts) { try { String listNumberAsString = commandParts[2]; @@ -200,10 +282,24 @@ public Command createRemoveListCommand(String[] commandParts) { return null; } } + + + /** + * Creates a RecurringExpenseCommand to print all the names of the ExpenseLists present in recurringExpensesList + * + * @return A RecurringExpenseCommand + */ public Command createViewListCommand() { return new RecurringExpenseCommand(recurringExpensesList, "viewlists"); } + /** + * Creates a RecurringExpenseCommand to add a new RecurringExpenseList into recurringExpensesList + * This method uses the provided `commandParts` to extract the listName of the new RecurringExpenseList + * + * @param commandParts The split parts of the user input + * @return RecurringExpenseCommand if listName is valid, returns null if the listName extracted is empty + */ public Command createNewListCommand(String[] commandParts) { try { String listName = commandParts[2]; @@ -220,6 +316,15 @@ public Command createNewListCommand(String[] commandParts) { return null; } } + + /** + * Handles the creation of the various types of RecurringExpenseCommand based on the extracted commandType + * This method extracts the commandType from the user input, and calls methods based on the commandType + * + * @param input The user input + * @return RecurringExpenseCommand if commandType extracted is a valid commandType, + * returns null if commandType is not valid + */ public Command handleRecCommand(String input){ String[] commandParts = input.split(" "); String commandType = commandParts[1]; From d2b568940badccb2a4766613cb92aad8357dacde Mon Sep 17 00:00:00 2001 From: itsmejr257 Date: Wed, 3 Apr 2024 23:06:05 +0800 Subject: [PATCH 3/9] Add JavaDoc comments to RecurringExpenseList --- .../budgetbuddy/commons/RecurringExpenseList.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/main/java/seedu/budgetbuddy/commons/RecurringExpenseList.java b/src/main/java/seedu/budgetbuddy/commons/RecurringExpenseList.java index 2cc5f0917b..5ee70e91fe 100644 --- a/src/main/java/seedu/budgetbuddy/commons/RecurringExpenseList.java +++ b/src/main/java/seedu/budgetbuddy/commons/RecurringExpenseList.java @@ -2,14 +2,29 @@ import java.util.ArrayList; + +/** + * Represents a list of expenses for recurring expenses. This class extends + * the ExpenseList class. + */ public class RecurringExpenseList extends ExpenseList{ String name; + /** + * Constructs a new RecurringExpenseList with the provided name and list of expenses + * @param name The provided name for the recurring expense list + * @param expenses An arraylist of Expense objects + */ public RecurringExpenseList(String name, ArrayList expenses) { this.name = name; super.expenses = expenses; } + /** + * Returns the name of this recurring expense list + * + * @return The name of this recurring expense list. + */ @Override public String getName() { return this.name; From c740788c9b09fd3716149dd8d8b45a0d46bb2704 Mon Sep 17 00:00:00 2001 From: itsmejr257 Date: Wed, 3 Apr 2024 23:06:17 +0800 Subject: [PATCH 4/9] Add JavaDoc comments to RecurringExpensesList --- .../commons/RecurringExpensesList.java | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/src/main/java/seedu/budgetbuddy/commons/RecurringExpensesList.java b/src/main/java/seedu/budgetbuddy/commons/RecurringExpensesList.java index 64654115f6..33c5d8384d 100644 --- a/src/main/java/seedu/budgetbuddy/commons/RecurringExpensesList.java +++ b/src/main/java/seedu/budgetbuddy/commons/RecurringExpensesList.java @@ -4,6 +4,11 @@ import java.util.ArrayList; +/** + * Represents a list of ExpenseList. Each ExpenseList contains multiple expenses. + * This class provides methods to add, remove and manage the list of ExpenseList + * + */ public class RecurringExpensesList { protected ArrayList recurringExpenses; @@ -12,9 +17,19 @@ public class RecurringExpensesList { public RecurringExpensesList(ArrayList recurringExpenses) { this.recurringExpenses = recurringExpenses; } + + /** + * Constructs an RecurringExpensesList object with an empty ArrayList + */ public RecurringExpensesList() { this.recurringExpenses = new ArrayList<>(); } + + /** + * Adds a new RecurringExpenseList with the provided listName to the list of recurring expenses + * + * @param listName Name of the RecurringExpenseList to be added + */ public void addNewRecurringList(String listName) { assert !listName.contains("!") && !listName.contains("|") : "List Name should not contain a ! or |"; @@ -28,6 +43,11 @@ public void addNewRecurringList(String listName) { ui.printDivider(); } + /** + * Removes the ExpenseList at the provided listNumber in the list of recurring expenses + * + * @param listNumber Position of list to delete according to the provided list of recurring expenses printed to user + */ public void removeList(int listNumber) { int listNumberAsArrayPosition = listNumber - 1; recurringExpenses.remove(listNumberAsArrayPosition); @@ -38,6 +58,12 @@ public void removeList(int listNumber) { } + /** + * Prints the names of all ExpenseList within the main list of recurring expenses. If there are + * no ExpenseList inside recurringExpensesList, a message indicating the absence of recurring expenses + * is displayed + * + */ public void printAllRecurringLists() { int counter = 1; @@ -61,10 +87,23 @@ public void printAllRecurringLists() { ui.printDivider(); } + /** + * Returns the number of ExpenseList present in recurringExpensesList + * + * @return The size of recurringExpensesList + */ public int getSize() { return recurringExpenses.size(); } + /** + * Returns the ExpenseList at the specified position. + * Position of the ExpenseList is 1-based, so position is subtracted by 1 to convert to + * ArrayList index + * + * @param listNumber Position of ExpenseList according to the printed list to the user + * @return The ExpenseList at the listNumber provided + */ public ExpenseList getExpenseListAtListNumber(int listNumber) { int listNumberAsArrayPosition = listNumber - 1; From 2e646d0150b0309a0ad7bfe24badc5b5adc5552b Mon Sep 17 00:00:00 2001 From: itsmejr257 Date: Wed, 3 Apr 2024 23:06:38 +0800 Subject: [PATCH 5/9] Add JavaDoc comments to filterExpenses method in ExpenseList --- .../java/seedu/budgetbuddy/commons/ExpenseList.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/java/seedu/budgetbuddy/commons/ExpenseList.java b/src/main/java/seedu/budgetbuddy/commons/ExpenseList.java index 7142256dae..27a0575afe 100644 --- a/src/main/java/seedu/budgetbuddy/commons/ExpenseList.java +++ b/src/main/java/seedu/budgetbuddy/commons/ExpenseList.java @@ -53,6 +53,19 @@ public List getBudgets() { return this.budgets; } + + /** + * Filters this.expenses based on the provided description, minimum amount and maximum amount. + * This method uses Java streams to perform a case-insensitive search for the description + * , and filters expenses to include the range specified by the minAmount and maxAmount. + * + * @param description The description to match against the description of the Expense object + * @param minAmount The minimum amount value of the Expense object + * @param maxAmount The minimum amount value of the Expense object + * + * @return An ArrayList of Expense object containing all filtered + * Expense which match the provided parameters provided + */ public ArrayList filterExpenses(String description, Double minAmount, Double maxAmount) { assert minAmount == null || maxAmount == null || minAmount <= maxAmount : "Minimum Amount must be smaller than or equals to Max Amount if both are not null"; From c49a923d04727682272bfa5e6d3443a3e908e5b1 Mon Sep 17 00:00:00 2001 From: itsmejr257 Date: Wed, 3 Apr 2024 23:08:36 +0800 Subject: [PATCH 6/9] Remove unused import in RecurringExpenseCommand --- .../seedu/budgetbuddy/command/RecurringExpenseCommand.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/seedu/budgetbuddy/command/RecurringExpenseCommand.java b/src/main/java/seedu/budgetbuddy/command/RecurringExpenseCommand.java index a23770c7e6..4c68b39e7e 100644 --- a/src/main/java/seedu/budgetbuddy/command/RecurringExpenseCommand.java +++ b/src/main/java/seedu/budgetbuddy/command/RecurringExpenseCommand.java @@ -2,7 +2,6 @@ import seedu.budgetbuddy.commons.Expense; import seedu.budgetbuddy.commons.ExpenseList; -import seedu.budgetbuddy.commons.RecurringExpenseList; import seedu.budgetbuddy.commons.RecurringExpensesList; import seedu.budgetbuddy.Ui; import seedu.budgetbuddy.exception.BudgetBuddyException; @@ -171,8 +170,7 @@ private void addExpenseToList(int listNumber, String category, Double amount, St } } - - + /** * Adds all Expenses in the ExpenseList located at the provided listNumber in the `recurringExpensesList`, * into the provided `overallExpenses` From 89a12053c683e555fe1f1724e9d5b6b0727e9fd7 Mon Sep 17 00:00:00 2001 From: itsmejr257 Date: Wed, 3 Apr 2024 23:09:53 +0800 Subject: [PATCH 7/9] Remove unused Exception --- .../budgetbuddy/exception/InvalidCommandException.java | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 src/main/java/seedu/budgetbuddy/exception/InvalidCommandException.java diff --git a/src/main/java/seedu/budgetbuddy/exception/InvalidCommandException.java b/src/main/java/seedu/budgetbuddy/exception/InvalidCommandException.java deleted file mode 100644 index 3f89e77dd9..0000000000 --- a/src/main/java/seedu/budgetbuddy/exception/InvalidCommandException.java +++ /dev/null @@ -1,8 +0,0 @@ -package seedu.budgetbuddy.exception; - -public class InvalidCommandException extends Exception{ - - public InvalidCommandException(String errorMessage) { - super(errorMessage); - } -} From f6b25e4b0889ccc48fc7bfd399904d9360c9ccf6 Mon Sep 17 00:00:00 2001 From: itsmejr257 Date: Wed, 3 Apr 2024 23:10:44 +0800 Subject: [PATCH 8/9] Remove unused ExpenseFile and SavingFile --- src/main/java/seedu/budgetbuddy/data/ExpenseFile.txt | 12 ------------ src/main/java/seedu/budgetbuddy/data/SavingsFile.txt | 2 -- 2 files changed, 14 deletions(-) delete mode 100644 src/main/java/seedu/budgetbuddy/data/ExpenseFile.txt delete mode 100644 src/main/java/seedu/budgetbuddy/data/SavingsFile.txt diff --git a/src/main/java/seedu/budgetbuddy/data/ExpenseFile.txt b/src/main/java/seedu/budgetbuddy/data/ExpenseFile.txt deleted file mode 100644 index e66215148d..0000000000 --- a/src/main/java/seedu/budgetbuddy/data/ExpenseFile.txt +++ /dev/null @@ -1,12 +0,0 @@ -2024-04-03 | Entertainment | 30.00 | movie -2024-04-03 | Groceries | 187.50 | ntuc -2024-04-03 | Transport | 75.00 | MRT -2024-04-03 | Housing | 150.00 | BTO -2024-04-02 | Housing | 50.00 | rent -2024-04-02 | Entertainment | 30.00 | movie -2024-04-02 | Transport | 60.00 | GRAB -2024-04-02 | Entertainment | 30.00 | movie -2024-04-02 | Groceries | 187.50 | ntuc -2024-04-02 | Transport | 75.00 | MRT -2024-04-02 | Housing | 150.00 | BTO -2024-04-02 | Housing | 200.00 | testing diff --git a/src/main/java/seedu/budgetbuddy/data/SavingsFile.txt b/src/main/java/seedu/budgetbuddy/data/SavingsFile.txt deleted file mode 100644 index f7645f7801..0000000000 --- a/src/main/java/seedu/budgetbuddy/data/SavingsFile.txt +++ /dev/null @@ -1,2 +0,0 @@ -Salary | 750.00 -Investments | 75.00 From 7eebdd3167272c4a8db1003d792e1a724e2822fc Mon Sep 17 00:00:00 2001 From: itsmejr257 Date: Wed, 3 Apr 2024 23:13:30 +0800 Subject: [PATCH 9/9] Remove unused Storage class in SavingList --- src/main/java/seedu/budgetbuddy/commons/SavingList.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/main/java/seedu/budgetbuddy/commons/SavingList.java b/src/main/java/seedu/budgetbuddy/commons/SavingList.java index 73bfc6f857..92c9d763a7 100644 --- a/src/main/java/seedu/budgetbuddy/commons/SavingList.java +++ b/src/main/java/seedu/budgetbuddy/commons/SavingList.java @@ -9,8 +9,6 @@ import java.util.List; import java.util.stream.Collectors; - -import seedu.budgetbuddy.Storage; import seedu.budgetbuddy.Ui; import seedu.budgetbuddy.exception.BudgetBuddyException; @@ -20,7 +18,6 @@ public class SavingList { protected ArrayList savings; protected ArrayList categories; protected double initialAmount; - protected Storage storage; Ui ui = new Ui(); @@ -30,7 +27,6 @@ public SavingList() { this.categories = new ArrayList<>(Arrays.asList("Salary", "Investments", "Gifts", "Others")); this.initialAmount = 0; - this.storage = new Storage("src/main/java/seedu/budgetbuddy/data/SavingsFile.txt"); } public int size() {