Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify address book comments and sample data #73

Merged
merged 5 commits into from
Oct 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/main/java/seedu/address/MainApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ public void init() throws Exception {
}

/**
* Returns a {@code ModelManager} with the data from {@code storage}'s address book and {@code userPrefs}. <br>
* 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 MoneyGoWhere and {@code userPrefs}. <br>
* The data from the sample MoneyGoWhere will be used instead if {@code storage}'s MoneyGoWhere is not found,
* or an empty MoneyGoWhere will be used instead if errors occur when reading {@code storage}'s MoneyGoWhere.
*/
private Model initModelManager(Storage storage, ReadOnlyUserPrefs userPrefs) {
Optional<ReadOnlyAddressBook> addressBookOptional;
Expand Down Expand Up @@ -173,7 +173,7 @@ public void start(Stage primaryStage) {

@Override
public void stop() {
logger.info("============================ [ Stopping Address Book ] =============================");
logger.info("============================ [ Stopping MoneyGoWhere ] =============================");
try {
storage.saveUserPrefs(model.getUserPrefs());
} catch (IOException e) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/logic/Logic.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public interface Logic {
ObservableList<Spending> getFilteredSpendingList();

/**
* Returns the user prefs' address book file path.
* Returns the user prefs' MoneyGoWhere file path.
*/
Path getAddressBookFilePath();

Expand Down
10 changes: 5 additions & 5 deletions src/main/java/seedu/address/logic/commands/AddCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,29 @@
import seedu.address.model.spending.Spending;

/**
* Adds a Spending to the address book.
* Adds a Spending to the MoneyGoWhere list.
*/
public class AddCommand extends Command {

public static final String COMMAND_WORD = "add";

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Adds a Spending to the address book. "
public static final String MESSAGE_USAGE = COMMAND_WORD + ": Adds a Spending to MoneyGoWhere. "
+ "Parameters: "
+ PREFIX_NAME + "NAME "
+ PREFIX_DATE + "DATE "
+ PREFIX_REMARK + "REMARK "
+ PREFIX_COST + "COST "
+ "[" + PREFIX_TAG + "TAG]...\n"
+ "Example: " + COMMAND_WORD + " "
+ PREFIX_NAME + "John Doe "
+ PREFIX_NAME + "Apple "
+ PREFIX_DATE + "today "
+ PREFIX_COST + "1.50 "
+ PREFIX_REMARK + "Likes to play games"
+ PREFIX_REMARK + "Keeps the doctor away "
+ PREFIX_TAG + "friends "
+ PREFIX_TAG + "owesMoney";

public static final String MESSAGE_SUCCESS = "New Spending added: %1$s";
public static final String MESSAGE_DUPLICATE_SPENDING = "This Spending already exists in the address book";
public static final String MESSAGE_DUPLICATE_SPENDING = "This Spending already exists in MoneyGoWhere";

private final Spending toAdd;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import seedu.address.model.budget.Budget;

/**
* Sets the budget of the address book.
* Sets the budget of the MoneyGoWhere list.
*/
public class BudgetCommand extends Command {
public static final String COMMAND_WORD = "budget";
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/seedu/address/logic/commands/ClearCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
import seedu.address.model.Model;

/**
* Clears the address book.
* Clears the MoneyGoWhere list.
*/
public class ClearCommand extends Command {

public static final String COMMAND_WORD = "clear";
public static final String MESSAGE_SUCCESS = "Address book has been cleared!";
public static final String MESSAGE_SUCCESS = "MoneyGoWhere has been cleared!";


@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import seedu.address.model.spending.Spending;

/**
* Deletes a Spending identified using it's displayed index from the address book.
* Deletes a Spending identified using it's displayed index from the MoneyGoWhere list.
*/
public class DeleteCommand extends Command {

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/seedu/address/logic/commands/EditCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import seedu.address.model.tag.Tag;

/**
* Edits the details of an existing Spending in the address book.
* Edits the details of an existing Spending in the MoneyGoWhere list.
*/
public class EditCommand extends Command {

Expand All @@ -48,7 +48,7 @@ public class EditCommand extends Command {

public static final String MESSAGE_EDIT_SPENDING_SUCCESS = "Edited Spending: %1$s";
public static final String MESSAGE_NOT_EDITED = "At least one field to edit must be provided.";
public static final String MESSAGE_DUPLICATE_SPENDING = "This Spending already exists in the address book.";
public static final String MESSAGE_DUPLICATE_SPENDING = "This Spending already exists in the MoneyGoWhere list.";

private final Index index;
private final EditSpendingDescriptor editSpendingDescriptor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class ExitCommand extends Command {

public static final String COMMAND_WORD = "exit";

public static final String MESSAGE_EXIT_ACKNOWLEDGEMENT = "Exiting Address Book as requested ...";
public static final String MESSAGE_EXIT_ACKNOWLEDGEMENT = "Exiting MoneyGoWhere as requested ...";

@Override
public CommandResult execute(Model model) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import seedu.address.model.spending.NameContainsKeywordsPredicate;

/**
* Finds and lists all persons in address book whose name contains any of the argument keywords.
* Finds and lists all persons in MoneyGoWhere whose name contains any of the argument keywords.
* Keyword matching is case insensitive.
*/
public class FindCommand extends Command {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import seedu.address.model.Model;

/**
* Lists all persons in the address book to the user.
* Lists all persons in the MoneyGoWhere list to the user.
*/
public class ListCommand extends Command {

Expand Down
14 changes: 7 additions & 7 deletions src/main/java/seedu/address/model/AddressBook.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,26 +64,26 @@ public void resetData(ReadOnlyAddressBook newData) {
//// Spending-level operations

/**
* Returns true if a Spending with the same identity as {@code Spending} exists in the address book.
* Returns true if a Spending with the same identity as {@code Spending} exists in MoneyGoWhere.
*/
public boolean hasSpending(Spending spending) {
requireNonNull(spending);
return spendings.contains(spending);
}

/**
* Adds a Spending to the address book.
* The Spending must not already exist in the address book.
* Adds a Spending to the MoneyGoWhere list.
* The Spending must not already exist in the MoneyGoWhere list.
*/
public void addSpending(Spending p) {
spendings.add(p);
}

/**
* Replaces the given Spending {@code target} in the list with {@code editedPerson}.
* {@code target} must exist in the address book.
* {@code target} must exist in the MoneyGoWhere list.
* The Spending identity of {@code editedPerson} must not be the same as another existing
* Spending in the address book.
* Spending in the MoneyGoWhere list.
*/
public void setSpending(Spending target, Spending editedSpending) {
requireNonNull(editedSpending);
Expand All @@ -93,7 +93,7 @@ public void setSpending(Spending target, Spending editedSpending) {

/**
* Removes {@code key} from this {@code AddressBook}.
* {@code key} must exist in the address book.
* {@code key} must exist in the MoneyGoWhere list.
*/
public void removeSpending(Spending key) {
spendings.remove(key);
Expand All @@ -107,7 +107,7 @@ public Budget getBudget() {
}

/**
* Replaces the value of budget in the address book with {@code budget}.
* Replaces the value of budget in the MoneyGoWhere list with {@code budget}.
*/
public void setBudget(Budget budget) {
this.budget.setValue(budget.getValue());
Expand Down
20 changes: 10 additions & 10 deletions src/main/java/seedu/address/model/Model.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,45 +36,45 @@ public interface Model {
void setGuiSettings(GuiSettings guiSettings);

/**
* Returns the user prefs' address book file path.
* Returns the user prefs' MoneyGoWhere file path.
*/
Path getAddressBookFilePath();

/**
* Sets the user prefs' address book file path.
* Sets the user prefs' MoneyGoWhere file path.
*/
void setAddressBookFilePath(Path addressBookFilePath);

/**
* Replaces address book data with the data in {@code addressBook}.
* Replaces MoneyGoWhere data with the data in {@code addressBook}.
*/
void setAddressBook(ReadOnlyAddressBook addressBook);

/** Returns the AddressBook */
ReadOnlyAddressBook getAddressBook();

/**
* Returns true if a Spending with the same identity as {@code Spending} exists in the address book.
* Returns true if a Spending with the same identity as {@code Spending} exists in the MoneyGoWhere list.
*/
boolean hasSpending(Spending spending);

/**
* Deletes the given Spending.
* The Spending must exist in the address book.
* The Spending must exist in the MoneyGoWhere list.
*/
void deleteSpending(Spending target);

/**
* Adds the given Spending.
* {@code Spending} must not already exist in the address book.
* {@code Spending} must not already exist in the MoneyGoWhere list.
*/
void addSpending(Spending spending);

/**
* Replaces the given Spending {@code target} with {@code editedSpending}.
* {@code target} must exist in the address book.
* {@code target} must exist in the MoneyGoWhere list.
* The Spending identity of {@code editedSpending} must not be the same as
* another existing Spending in the address book.
* another existing Spending in the MoneyGoWhere list.
*/
void setSpending(Spending target, Spending editedSpending);

Expand All @@ -88,12 +88,12 @@ public interface Model {
void updateFilteredSpendingList(Predicate<Spending> predicate);

/**
* Replaces the previous budget of address book with the new budget.
* Replaces the previous budget of MoneyGoWhere with the new budget.
*/
void setBudget(Budget budget);

/**
* Gets the current budget of the address book.
* Gets the current budget of the MoneyGoWhere list.
*/
Budget getBudget();
}
4 changes: 2 additions & 2 deletions src/main/java/seedu/address/model/ModelManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import seedu.address.model.spending.Spending;

/**
* Represents the in-memory model of the address book data.
* Represents the in-memory model of the MoneyGoWhere list data.
*/
public class ModelManager implements Model {
private static final Logger logger = LogsCenter.getLogger(ModelManager.class);
Expand All @@ -31,7 +31,7 @@ public ModelManager(ReadOnlyAddressBook addressBook, ReadOnlyUserPrefs userPrefs
super();
requireAllNonNull(addressBook, userPrefs);

logger.fine("Initializing with address book: " + addressBook + " and user prefs " + userPrefs);
logger.fine("Initializing with MoneyGoWhere: " + addressBook + " and user prefs " + userPrefs);

this.addressBook = new AddressBook(addressBook);
this.userPrefs = new UserPrefs(userPrefs);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/seedu/address/model/ReadOnlyAddressBook.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import seedu.address.model.spending.Spending;

/**
* Unmodifiable view of an address book
* Unmodifiable view of the MoneyGoWhere list
*/
public interface ReadOnlyAddressBook {

Expand All @@ -16,7 +16,7 @@ public interface ReadOnlyAddressBook {
ObservableList<Spending> getSpendingList();

/**
* Returns the Budget of the Address Book.
* Returns the Budget of the MoneyGoWhere list.
*/
Budget getBudget();
}
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/model/UserPrefs.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
public class UserPrefs implements ReadOnlyUserPrefs {

private GuiSettings guiSettings = new GuiSettings();
private Path addressBookFilePath = Paths.get("data" , "addressbook.json");
private Path addressBookFilePath = Paths.get("data" , "moneygowhere.json");

/**
* Creates a {@code UserPrefs} with default values.
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/seedu/address/model/budget/Budget.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
import static seedu.address.commons.util.AppUtil.checkArgument;

/**
* Represents the budget in the address book.
* Represents the budget in the MoneyGoWhere list.
*/
public class Budget {

public static final String MESSAGE_CONSTRAINTS = "Budget values should be positive number";
public static final String VALIDATION_REGEX = "^[+]?([0-9]+(?:[\\.][0-9]*)?|\\.[0-9]+)$";
public static final String VALIDATION_REGEX = "^[+]?([0-9]+(?:[.][0-9]*)?|\\.[0-9]+)$";

private double value;

Expand All @@ -19,7 +19,6 @@ public class Budget {
* @param budget A valid budget value.
*/
public Budget(double budget) {
requireNonNull(budget);
checkArgument(isValidBudget(budget), MESSAGE_CONSTRAINTS);
this.value = budget;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/model/spending/Cost.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import static seedu.address.commons.util.AppUtil.checkArgument;

/**
* Represents a Spending's cost in the address book.
* Represents a Spending's cost in the MoneyGoWhere list.
* Guarantees: immutable; is valid as declared in {@link #isValidCost(String)}
*/
public class Cost {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/model/spending/Name.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import static seedu.address.commons.util.AppUtil.checkArgument;

/**
* Represents a Person's name in the address book.
* Represents a Person's name in the MoneyGoWhere list.
* Guarantees: immutable; is valid as declared in {@link #isValidName(String)}
*/
public class Name {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/model/spending/Remark.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import static java.util.Objects.requireNonNull;

/**
* Represents a Spending's remark in the address book. Guarantees: immutable; is always valid
* Represents a Spending's remark in the MoneyGoWhere list. Guarantees: immutable; is always valid
*/
public class Remark {

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/model/spending/Spending.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import seedu.address.model.tag.Tag;

/**
* Represents a Person in the address book.
* Represents a Person in the MoneyGoWhere list.
* Guarantees: details are present and not null, field values are validated, immutable.
*/
public class Spending {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/model/tag/Tag.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import static seedu.address.commons.util.AppUtil.checkArgument;

/**
* Represents a Tag in the address book.
* Represents a Tag in the MoneyGoWhere list.
* Guarantees: immutable; name is valid as declared in {@link #isValidTagName(String)}
*/
public class Tag {
Expand Down
Loading