From fc2f119649ef2317bebe5b4532e7bf6dd1743f9a Mon Sep 17 00:00:00 2001 From: Ern Tek Teoh Date: Mon, 13 Apr 2020 23:29:43 +0800 Subject: [PATCH 1/2] added javadocs --- .../java/modulo/logic/commands/AddDeadlineCommand.java | 9 +++++++++ src/main/java/modulo/logic/commands/ClearCommand.java | 6 ++++++ src/main/java/modulo/logic/commands/ExitCommand.java | 6 ++++++ src/main/java/modulo/logic/commands/ExportCommand.java | 7 +++++++ src/main/java/modulo/logic/commands/FindCommand.java | 7 ++++++- src/main/java/modulo/logic/commands/HelpCommand.java | 6 ++++++ src/main/java/modulo/logic/commands/ListCommand.java | 6 ++++++ src/main/java/modulo/logic/commands/ViewCommand.java | 7 +++++++ 8 files changed, 53 insertions(+), 1 deletion(-) diff --git a/src/main/java/modulo/logic/commands/AddDeadlineCommand.java b/src/main/java/modulo/logic/commands/AddDeadlineCommand.java index 19bb90cf606..9df2e4e8553 100644 --- a/src/main/java/modulo/logic/commands/AddDeadlineCommand.java +++ b/src/main/java/modulo/logic/commands/AddDeadlineCommand.java @@ -85,6 +85,15 @@ public boolean get_isRepeated() { return this.isRepeated; } + /** + * Returns the result after execution of AddDeadlineCommand + * + * Deadline will be added to a specified parentEvent, or the current focused event if parentEvent isn't specified + * + * @param model Model of modulo + * @return CommandResult containing info regarding execution of the command + * @throws CommandException If certain prerequisites are unmet + */ @Override public CommandResult execute(Model model) throws CommandException { requireNonNull(model); diff --git a/src/main/java/modulo/logic/commands/ClearCommand.java b/src/main/java/modulo/logic/commands/ClearCommand.java index 1078ddf5453..19170726b71 100644 --- a/src/main/java/modulo/logic/commands/ClearCommand.java +++ b/src/main/java/modulo/logic/commands/ClearCommand.java @@ -15,6 +15,12 @@ public class ClearCommand extends Command { public static final String MESSAGE_USAGE = COMMAND_WORD + ": Clears all data from Modulo.\n" + "Example: " + COMMAND_WORD; + /** + * Returns the result after execution of ClearCommand + * + * @param model Model of modulo + * @return CommandResult containing info regarding execution of the command + */ @Override public CommandResult execute(Model model) { requireNonNull(model); diff --git a/src/main/java/modulo/logic/commands/ExitCommand.java b/src/main/java/modulo/logic/commands/ExitCommand.java index 3fddabe3747..71b64215cfb 100644 --- a/src/main/java/modulo/logic/commands/ExitCommand.java +++ b/src/main/java/modulo/logic/commands/ExitCommand.java @@ -13,6 +13,12 @@ public class ExitCommand extends Command { public static final String MESSAGE_USAGE = COMMAND_WORD + ": Exits Modulo.\n" + "Example: " + COMMAND_WORD; + /** + * Returns the result after execution of ClearCommand + * + * @param model Model of modulo + * @return CommandResult containing info regarding execution of the command + */ @Override public CommandResult execute(Model model) { return new CommandResult(MESSAGE_EXIT_ACKNOWLEDGEMENT, false, true, false, false, null, null); diff --git a/src/main/java/modulo/logic/commands/ExportCommand.java b/src/main/java/modulo/logic/commands/ExportCommand.java index 8991bd4ab2c..433d724b5d8 100644 --- a/src/main/java/modulo/logic/commands/ExportCommand.java +++ b/src/main/java/modulo/logic/commands/ExportCommand.java @@ -43,6 +43,13 @@ public ExportCommand(Path exportDirectory) { this.exportDirectory = exportDirectory; } + /** + * Returns the result after execution of ExportCommand + * + * @param model Model of modulo + * @return CommandResult containing info regarding execution of the command + * @throws CommandException When system fails to write to file + */ @Override public CommandResult execute(Model model) throws CommandException { diff --git a/src/main/java/modulo/logic/commands/FindCommand.java b/src/main/java/modulo/logic/commands/FindCommand.java index 60717aa8801..bc33aff71a6 100644 --- a/src/main/java/modulo/logic/commands/FindCommand.java +++ b/src/main/java/modulo/logic/commands/FindCommand.java @@ -28,7 +28,12 @@ public FindCommand(NameContainsKeywordsPredicate predicate) { this.predicate = predicate; } - + /** + * Returns the result after execution of FindCommand + * + * @param model Model of modulo + * @return CommandResult containing info regarding execution of the command + */ @Override public CommandResult execute(Model model) { requireNonNull(model); diff --git a/src/main/java/modulo/logic/commands/HelpCommand.java b/src/main/java/modulo/logic/commands/HelpCommand.java index ace942bb3bf..6f8462b4ffc 100644 --- a/src/main/java/modulo/logic/commands/HelpCommand.java +++ b/src/main/java/modulo/logic/commands/HelpCommand.java @@ -14,6 +14,12 @@ public class HelpCommand extends Command { public static final String MESSAGE_USAGE = COMMAND_WORD + ": Shows program usage instructions.\n" + "Example: " + COMMAND_WORD; + /** + * Returns the result after execution of HelpCommand + * + * @param model Model of modulo + * @return CommandResult containing info on where to seek help + */ @Override public CommandResult execute(Model model) { return new CommandResult(MESSAGE_SHOWING_HELP, true, false, false, false, null, null); diff --git a/src/main/java/modulo/logic/commands/ListCommand.java b/src/main/java/modulo/logic/commands/ListCommand.java index b7cb776c40f..520659c55ef 100644 --- a/src/main/java/modulo/logic/commands/ListCommand.java +++ b/src/main/java/modulo/logic/commands/ListCommand.java @@ -31,6 +31,12 @@ public ListCommand(DisplayableType displayableType) { this.displayableType = displayableType; } + /** + * Returns the result after execution of ListCommand + * + * @param model Model of modulo + * @return CommandResult containing info regarding execution of the command + */ @Override public CommandResult execute(Model model) { requireNonNull(model); diff --git a/src/main/java/modulo/logic/commands/ViewCommand.java b/src/main/java/modulo/logic/commands/ViewCommand.java index 247ff88b52c..9ee6ca34649 100644 --- a/src/main/java/modulo/logic/commands/ViewCommand.java +++ b/src/main/java/modulo/logic/commands/ViewCommand.java @@ -34,6 +34,13 @@ public ViewCommand(Index index) { this.index = index; } + /** + * Returns the result after execution of ViewCommand + * + * @param model Model of modulo + * @return CommandResult containing info regarding execution of the command + * @throws CommandException When index specified is invalid + */ @Override public CommandResult execute(Model model) throws CommandException { requireNonNull(model); From dccb2e626bb7dcb3f16f3dcf22296e3b21dc4f95 Mon Sep 17 00:00:00 2001 From: Ern Tek Teoh Date: Mon, 13 Apr 2020 23:30:43 +0800 Subject: [PATCH 2/2] minor adjustment --- src/main/java/modulo/logic/commands/ExitCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/modulo/logic/commands/ExitCommand.java b/src/main/java/modulo/logic/commands/ExitCommand.java index 71b64215cfb..78f7373d838 100644 --- a/src/main/java/modulo/logic/commands/ExitCommand.java +++ b/src/main/java/modulo/logic/commands/ExitCommand.java @@ -14,7 +14,7 @@ public class ExitCommand extends Command { + "Example: " + COMMAND_WORD; /** - * Returns the result after execution of ClearCommand + * Returns the result after execution of ExitCommand * * @param model Model of modulo * @return CommandResult containing info regarding execution of the command