diff --git a/docs/diagrams/add-remark/ParserClass.puml b/docs/diagrams/add-remark/ParserClass.puml new file mode 100644 index 00000000000..24d390a4023 --- /dev/null +++ b/docs/diagrams/add-remark/ParserClass.puml @@ -0,0 +1,14 @@ +@startuml +hide circle +skinparam classAttributeIconSize 0 + +Class "<>\nParser" as Parser +Class RemarkCommandParser { + +parse(): RemarkCommand +} +Class ParserException + +RemarkCommandParser .up.|> Parser +Parser .right.> ParserException: throws > +RemarkCommandParser .right.> ParserException: throws > +@enduml diff --git a/docs/diagrams/add-remark/RemarkClass.puml b/docs/diagrams/add-remark/RemarkClass.puml new file mode 100644 index 00000000000..019c1ecbbf1 --- /dev/null +++ b/docs/diagrams/add-remark/RemarkClass.puml @@ -0,0 +1,19 @@ +@startuml +hide circle +skinparam classAttributeIconSize 0 + +Class "{abstract}\nCommand" as Command { + +execute(Model): CommandResult +} +Class RemarkCommand { + +COMMAND_WORD: String + +MESSAGE_USAGE: String + +MESSAGE_NOT_IMPLEMENTED_YET: String + +execute(Model): CommandResult +} +Class CommandException + +RemarkCommand -up-|> Command +Command ..> CommandException: throws > +RemarkCommand .right.> CommandException: throws > +@enduml diff --git a/docs/images/add-remark/CommandInterface.png b/docs/images/add-remark/CommandInterface.png deleted file mode 100644 index b52e7811c52..00000000000 Binary files a/docs/images/add-remark/CommandInterface.png and /dev/null differ diff --git a/docs/images/add-remark/ParserInterface.png b/docs/images/add-remark/ParserInterface.png deleted file mode 100644 index 60c7892a534..00000000000 Binary files a/docs/images/add-remark/ParserInterface.png and /dev/null differ diff --git a/docs/images/add-remark/RemarkCommandClass.png b/docs/images/add-remark/RemarkCommandClass.png new file mode 100644 index 00000000000..5687a3e9585 Binary files /dev/null and b/docs/images/add-remark/RemarkCommandClass.png differ diff --git a/docs/images/add-remark/RemarkCommandParserClass.png b/docs/images/add-remark/RemarkCommandParserClass.png new file mode 100644 index 00000000000..d5ad9c8a02f Binary files /dev/null and b/docs/images/add-remark/RemarkCommandParserClass.png differ diff --git a/docs/tutorials/AddRemark.md b/docs/tutorials/AddRemark.md index 9ee4f1c9faf..d98f38982e7 100644 --- a/docs/tutorials/AddRemark.md +++ b/docs/tutorials/AddRemark.md @@ -57,7 +57,7 @@ Run `Main#main` and try out your new `RemarkCommand`. If everything went well, y While we have successfully printed a message to `ResultDisplay`, the command does not do what it is supposed to do. Let’s change the command to throw a `CommandException` to accurately reflect that our command is still a work in progress. -![The relationship between RemarkCommand and Command](../images/add-remark/CommandInterface.png) +![The relationship between RemarkCommand and Command](../images/add-remark/RemarkCommandClass.png) Following the convention in other commands, we add relevant messages as constants and use them. @@ -142,7 +142,7 @@ Now let’s move on to writing a parser that will extract the index and remark f Create a `RemarkCommandParser` class in the `seedu.address.logic.parser` package. The class must extend the `Parser` interface. -![The relationship between Parser and RemarkCommandParser](../images/add-remark/ParserInterface.png) +![The relationship between Parser and RemarkCommandParser](../images/add-remark/RemarkCommandParserClass.png) Thankfully, `ArgumentTokenizer#tokenize()` makes it trivial to parse user input. Let’s take a look at the JavaDoc provided for the function to understand what it does.