Skip to content

Commit

Permalink
refactor address into revision. Update Khiang Leon's delete command
Browse files Browse the repository at this point in the history
  • Loading branch information
wilfredbtan committed Oct 17, 2019
1 parent 14b14a9 commit 60e45cc
Show file tree
Hide file tree
Showing 149 changed files with 919 additions and 844 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ plugins {
}

// Specifies the entry point of the application
mainClassName = 'seedu.address.Main'
mainClassName = 'seedu.revision.Main'

sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
Expand Down
10 changes: 5 additions & 5 deletions docs/tutorials/AddRemark.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ For now, let's keep `RemarkCommand` as simple as possible and print some output.
We accomplish that by returning a `CommandResult` with an accompanying message.

.RemarkCommand.java
[source, java]
[source,java]
----
package seedu.address.logic.commands;
package seedu.revision.logic.commands;
import seedu.address.model.Model;
import seedu.revision.model.Model;
/**
* Changes the remark of an existing person in the address book.
Expand Down Expand Up @@ -108,9 +108,9 @@ We start by modifying the constructor of `RemarkCommand` to accept an `Index` an
While we are at it, let's change the error message to echo the values.
While this is not a replacement for tests, it is an obvious way to tell if our code is functioning as intended.

[source, java]
[source,java]
----
import static seedu.address.commons.util.CollectionUtil.requireAllNonNull;
import static seedu.revision.commons.util.CollectionUtil.requireAllNonNull;
//...
public class RemarkCommand extends Command {
//...
Expand Down
53 changes: 0 additions & 53 deletions src/main/java/seedu/address/logic/commands/DeleteCommand.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package seedu.address;
package seedu.revision;

import java.nio.file.Path;
import java.nio.file.Paths;
Expand All @@ -7,8 +7,8 @@
import java.util.logging.Logger;

import javafx.application.Application;
import seedu.address.commons.core.LogsCenter;
import seedu.address.commons.util.FileUtil;
import seedu.revision.commons.core.LogsCenter;
import seedu.revision.commons.util.FileUtil;

/**
* Represents the parsed command-line parameters given to the application.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package seedu.address;
package seedu.revision;

import javafx.application.Application;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package seedu.address;
package seedu.revision;

import java.io.IOException;
import java.nio.file.Path;
Expand All @@ -7,29 +7,29 @@

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.revision.commons.core.Config;
import seedu.revision.commons.core.LogsCenter;
import seedu.revision.commons.core.Version;
import seedu.revision.commons.exceptions.DataConversionException;
import seedu.revision.commons.util.ConfigUtil;
import seedu.revision.commons.util.StringUtil;
import seedu.revision.logic.Logic;
import seedu.revision.logic.LogicManager;
import seedu.revision.model.AddressBook;
import seedu.revision.model.Model;
import seedu.revision.model.ModelManager;
import seedu.revision.model.ReadOnlyAddressBook;
import seedu.revision.model.ReadOnlyUserPrefs;
import seedu.revision.model.UserPrefs;
import seedu.revision.model.util.SampleDataUtil;
import seedu.revision.storage.AddressBookStorage;
import seedu.revision.storage.JsonAddressBookStorage;
import seedu.revision.storage.JsonUserPrefsStorage;
import seedu.revision.storage.Storage;
import seedu.revision.storage.StorageManager;
import seedu.revision.storage.UserPrefsStorage;
import seedu.revision.ui.Ui;
import seedu.revision.ui.UiManager;

/**
* Runs the application.
Expand Down 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 revision tool and {@code userPrefs}. <br>
* The data from the sample revision tool will be used instead if {@code storage}'s revision tool is not found,
* or an empty revision tool will be used instead if errors occur when reading {@code storage}'s revision tool.
*/
private Model initModelManager(Storage storage, ReadOnlyUserPrefs userPrefs) {
Optional<ReadOnlyAddressBook> addressBookOptional;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package seedu.address.commons.core;
package seedu.revision.commons.core;

import java.nio.file.Path;
import java.nio.file.Paths;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package seedu.address.commons.core;
package seedu.revision.commons.core;

import java.awt.Point;
import java.io.Serializable;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package seedu.address.commons.core;
package seedu.revision.commons.core;

import java.io.IOException;
import java.util.Arrays;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package seedu.address.commons.core;
package seedu.revision.commons.core;

/**
* Container for user visible messages.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package seedu.address.commons.core;
package seedu.revision.commons.core;

import java.util.regex.Matcher;
import java.util.regex.Pattern;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package seedu.address.commons.core.index;
package seedu.revision.commons.core.index;

/**
* Represents a zero-based or one-based index.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package seedu.address.commons.exceptions;
package seedu.revision.commons.exceptions;

/**
* Represents an error during conversion of data from one format to another
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package seedu.address.commons.exceptions;
package seedu.revision.commons.exceptions;

/**
* Signals that some given data does not fulfill some constraints.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package seedu.address.commons.util;
package seedu.revision.commons.util;

import static java.util.Objects.requireNonNull;

import javafx.scene.image.Image;
import seedu.address.MainApp;
import seedu.revision.MainApp;

/**
* A container for App specific utility functions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package seedu.address.commons.util;
package seedu.revision.commons.util;

import static java.util.Objects.requireNonNull;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package seedu.address.commons.util;
package seedu.revision.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.revision.commons.core.Config;
import seedu.revision.commons.exceptions.DataConversionException;

/**
* A class for accessing the Config File.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package seedu.address.commons.util;
package seedu.revision.commons.util;

import java.io.IOException;
import java.nio.file.Files;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package seedu.address.commons.util;
package seedu.revision.commons.util;

import static java.util.Objects.requireNonNull;

Expand All @@ -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.revision.commons.core.LogsCenter;
import seedu.revision.commons.exceptions.DataConversionException;

/**
* Converts a Java object instance to JSON and vice versa
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package seedu.address.commons.util;
package seedu.revision.commons.util;

import static java.util.Objects.requireNonNull;
import static seedu.address.commons.util.AppUtil.checkArgument;
import static seedu.revision.commons.util.AppUtil.checkArgument;

import java.io.PrintWriter;
import java.io.StringWriter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package seedu.address.logic;
package seedu.revision.logic;

import java.nio.file.Path;

import javafx.collections.ObservableList;
import seedu.address.commons.core.GuiSettings;
import seedu.address.logic.commands.CommandResult;
import seedu.address.logic.commands.exceptions.CommandException;
import seedu.address.logic.parser.exceptions.ParseException;
import seedu.address.model.ReadOnlyAddressBook;
import seedu.address.model.answerable.Answerable;
import seedu.revision.commons.core.GuiSettings;
import seedu.revision.logic.commands.CommandResult;
import seedu.revision.logic.commands.exceptions.CommandException;
import seedu.revision.logic.parser.exceptions.ParseException;
import seedu.revision.model.ReadOnlyAddressBook;
import seedu.revision.model.answerable.Answerable;

/**
* API of the Logic component
Expand All @@ -26,15 +26,15 @@ public interface Logic {
/**
* Returns the AddressBook.
*
* @see seedu.address.model.Model#getAddressBook()
* @see seedu.revision.model.Model#getAddressBook()
*/
ReadOnlyAddressBook getAddressBook();

/** Returns an unmodifiable view of the filtered list of answerables */
ObservableList<Answerable> getFilteredAnswerableList();

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
package seedu.address.logic;
package seedu.revision.logic;

import java.io.IOException;
import java.nio.file.Path;
import java.util.logging.Logger;

import javafx.collections.ObservableList;
import seedu.address.commons.core.GuiSettings;
import seedu.address.commons.core.LogsCenter;
import seedu.address.logic.commands.Command;
import seedu.address.logic.commands.CommandResult;
import seedu.address.logic.commands.exceptions.CommandException;
import seedu.address.logic.parser.AddressBookParser;
import seedu.address.logic.parser.exceptions.ParseException;
import seedu.address.model.Model;
import seedu.address.model.ReadOnlyAddressBook;
import seedu.address.model.answerable.Answerable;
import seedu.address.storage.Storage;
import seedu.revision.commons.core.GuiSettings;
import seedu.revision.commons.core.LogsCenter;
import seedu.revision.logic.commands.Command;
import seedu.revision.logic.commands.CommandResult;
import seedu.revision.logic.commands.exceptions.CommandException;
import seedu.revision.logic.parser.AddressBookParser;
import seedu.revision.logic.parser.exceptions.ParseException;
import seedu.revision.model.Model;
import seedu.revision.model.ReadOnlyAddressBook;
import seedu.revision.model.answerable.Answerable;
import seedu.revision.storage.Storage;

/**
* The main LogicManager of the app.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package seedu.address.logic.commands;
package seedu.revision.logic.commands;

import static java.util.Objects.requireNonNull;
import static seedu.address.logic.parser.CliSyntax.PREFIX_CATEGORY;
import static seedu.address.logic.parser.CliSyntax.PREFIX_QUESTION;
import static seedu.address.logic.parser.CliSyntax.PREFIX_DIFFICULTY;
import static seedu.revision.logic.parser.CliSyntax.PREFIX_CATEGORY;
import static seedu.revision.logic.parser.CliSyntax.PREFIX_QUESTION;
import static seedu.revision.logic.parser.CliSyntax.PREFIX_DIFFICULTY;

import seedu.address.logic.commands.exceptions.CommandException;
import seedu.address.model.Model;
import seedu.address.model.answerable.Answerable;
import seedu.revision.logic.commands.exceptions.CommandException;
import seedu.revision.model.Model;
import seedu.revision.model.answerable.Answerable;

/**
* Adds a answerable to the address book.
* Adds a answerable to the revision tool.
*/
public class AddCommand extends Command {

Expand Down
Loading

0 comments on commit 60e45cc

Please sign in to comment.