Skip to content

Commit

Permalink
Merge pull request #306 from lamchenghou/lamchenghou/final-changes
Browse files Browse the repository at this point in the history
Add final changes
  • Loading branch information
lamchenghou authored Nov 14, 2023
2 parents 7724260 + e8e4a2e commit cbdcf20
Show file tree
Hide file tree
Showing 10 changed files with 72 additions and 36 deletions.
24 changes: 15 additions & 9 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
layout: default.md
title: "Developer Guide"
pageNav: 3
layout: default.md
title: "Developer Guide"
pageNav: 3
---
<bottom-head>
<link rel="stylesheet" href="stylesheets/userguide.css">
Expand Down Expand Up @@ -64,6 +64,7 @@ note-taking system will assist you in organising your important information you
- 10.2 [Redesigning the UI](#10-2-redesigning-the-ui)
11. [Acknowledgements](#11-acknowledgements)

</div>
<br>

---
Expand Down Expand Up @@ -216,8 +217,7 @@ The `SeplendidModel` component,

### 4.5 Storage Component

**API
** : [`Storage.java`](https://github.com/AY2324S1-CS2103T-W10-2/tp/blob/master/src/main/java/seedu/address/storage/Storage.java)
**API** : [`Storage.java`](https://github.com/AY2324S1-CS2103T-W10-2/tp/blob/master/src/main/java/seedu/address/storage/Storage.java)

<puml src="diagrams/StorageClassDiagram.puml" width="100%" />

Expand Down Expand Up @@ -262,7 +262,7 @@ The below diagram gives a high-level overview on how the `SeplendidParser` parse

### 5.2 List Feature

#### Overview
#### Overview \
<br>
The `list` command generates a list of SEPlendid data. The data can be in the for of a `localcourse`, `partnercourse`,
`university`, `mapping`, or `note`. This allows the viewing of all the data type that is listed.
Expand Down Expand Up @@ -297,6 +297,11 @@ Each data type has to be specified to ensure organisation of sample data.

### 5.3 Add Feature

**Overview** \
The `add` command allows for the adding of new courses, universities and notes. This allows the creation of new
datatypes.
### 5.3 Add Feature

#### Overview
<br>
The `add` command allows for the adding of `localcourse`, `partnercourse`, `mapping` and `notes`. This allows the
Expand Down Expand Up @@ -532,6 +537,7 @@ non-empty, the deletion will be performed, otherwise a `CommandException` will b
* Cons: We must ensure that deletion cascades, in order to maintain data integrity. This can introduce bugs if not
done correctly.


<br>

---
Expand Down Expand Up @@ -574,7 +580,7 @@ The following further describes our target users:
* prefers typing to mouse interactions
* is reasonably comfortable using CLI apps

**Value proposition**
**Value proposition:** \
SEPlendid aims to provide an advanced search, allowing users to search for mappings by various attributes such
as partner universities' course names, and NUS course codes. We aim to also include features such as the ability to
contribute course mappings, and note-taking.
Expand Down Expand Up @@ -613,8 +619,8 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli
| `* *` | student | delete my notes | remove my note |
| `* ` | student | update the list of my notes | edit any mistakes or update new information |
| `* ` | student | tag my notes | to organise my notes |

*{More to be added}*
| `* ` | student | search for my notes based on the tag | to find my notes based on the tag |
| `* ` | student | clear the tags for my notes | to organise my notes based on tags |

<br>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ public class SeplendidLogicManager implements SeplendidLogic {

// Note, during morphing Storage handles both ab3 and SEPlendid.
// On the other hand, SEPlendid has its own LogicManager.
// TBD: remove this developer's note.
private final SeplendidModel model;
private final Storage storage;
private final SeplendidParser seplendidParser;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ public LocalCourseAddCommand(LocalCourse localCourse) {
localCourseToAdd = localCourse;
}

/**
* Perfoms the Addition of the local course.
*
* @param seplendidModel {@code SeplendidModel} which the command should operate on.
* @return {@code CommandResult} that describes the result of the deletion.
* @throws CommandException If an error occurs during the deletion.
*/
@Override
public CommandResult execute(SeplendidModel seplendidModel) throws CommandException {
requireNonNull(seplendidModel);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ public LocalCourseDeleteCommand(LocalCode localCode) {
this.localCodeToDelete = localCode;
}

/**
* Perfoms the deletion of the local course.
*
* @param seplendidModel {@code SeplendidModel} which the command should operate on.
* @return {@code CommandResult} that describes the result of the deletion.
* @throws CommandException If an error occurs during the deletion.
*/
@Override
public CommandResult execute(SeplendidModel seplendidModel) throws CommandException {
requireNonNull(seplendidModel);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ public class LocalCourseListCommand extends LocalCourseCommand {

public static final String MESSAGE_SUCCESS = "Listed all local courses";

/**
* Lists all local courses in the LocalCourseCatalogue, by applying a show-all predicate.
*
* @param seplendidModel {@code SeplendidModel} which the command should operate on.
* @return CommandResult indicating success of execution.
* @throws CommandException On error.
*/
@Override
public CommandResult execute(SeplendidModel seplendidModel) throws CommandException {
requireNonNull(seplendidModel);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ public MappingSearchCommand(MappingAttributeContainsKeywordPredicate predicate)
this.predicate = predicate;
}

/**
* Searches the mapping list and returns a CommandResult.
*
* @param seplendidModel {@code SeplendidModel} which the command should operate on.
* @return {@code CommandResult} that describes changes made when command execute runs successfully.
* @throws CommandException If an error occurs during command execution.
*/
@Override
public CommandResult execute(SeplendidModel seplendidModel) throws CommandException {
requireNonNull(seplendidModel);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ public MappingSortCommand(MappingComparatorByAttribute mappingComparator) {
this.mappingComparator = mappingComparator;
}

/**
* Sorts the mapping list and returns a CommandResult.
*
* @param seplendidModel {@code SeplendidModel} which the command should operate on.
* @return {@code CommandResult} that describes changes made when command execute runs successfully.
* @throws CommandException If an error occurs during command execution.
*/
@Override
public CommandResult execute(SeplendidModel seplendidModel) throws CommandException {
requireNonNull(seplendidModel);
Expand Down
43 changes: 21 additions & 22 deletions src/main/java/seedu/address/logic/parser/SeplendidParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
/**
* Parses user input into the SEPlendid CLI.
* <p>
* TBD: Add parsing for help command
*/
public class SeplendidParser {
/**
Expand All @@ -78,17 +77,17 @@ public class SeplendidParser {
private static final String REGEX_GROUP_ACTION_WORD = "actionWord";
private static final String REGEX_GROUP_ARGUMENTS = "arguments";
private static final Pattern COMMAND_FORMAT_COMMAND = Pattern.compile(String.format(
"(?<%s>\\S+)",
REGEX_GROUP_COMMAND_WORD));
"(?<%s>\\S+)",
REGEX_GROUP_COMMAND_WORD));
private static final Pattern COMMAND_FORMAT_COMMAND_ACTION = Pattern.compile(String.format(
"(?<%s>\\S+)\\s(?<%s>\\S+)",
REGEX_GROUP_COMMAND_WORD,
REGEX_GROUP_ACTION_WORD));
"(?<%s>\\S+)\\s(?<%s>\\S+)",
REGEX_GROUP_COMMAND_WORD,
REGEX_GROUP_ACTION_WORD));
private static final Pattern COMMAND_FORMAT_COMMAND_ACTION_ARG = Pattern.compile(String.format(
"(?<%s>\\S+)\\s(?<%s>\\S+)\\s(?<%s>.*)",
REGEX_GROUP_COMMAND_WORD,
REGEX_GROUP_ACTION_WORD,
REGEX_GROUP_ARGUMENTS));
"(?<%s>\\S+)\\s(?<%s>\\S+)\\s(?<%s>.*)",
REGEX_GROUP_COMMAND_WORD,
REGEX_GROUP_ACTION_WORD,
REGEX_GROUP_ARGUMENTS));
private static final Logger logger = SeplendidLogsCenter.getLogger(SeplendidParser.class);

/**
Expand Down Expand Up @@ -142,22 +141,22 @@ public Command parseCommandOnly(String userInput) throws ParseException {
switch (commandWord) {
case LocalCourseCommand.COMMAND_WORD:
throw new ParseException(
UsageMessage.LOCALCOURSE.toString());
UsageMessage.LOCALCOURSE.toString());
case PartnerCourseCommand.COMMAND_WORD:
throw new ParseException(
UsageMessage.PARTNERCOURSE.toString());
UsageMessage.PARTNERCOURSE.toString());
case NoteCommand.COMMAND_WORD:
throw new ParseException(
UsageMessage.NOTE.toString());
UsageMessage.NOTE.toString());
case UniversityCommand.COMMAND_WORD:
throw new ParseException(
UsageMessage.UNIVERSITY.toString());
UsageMessage.UNIVERSITY.toString());
case MappingCommand.COMMAND_WORD:
throw new ParseException(
UsageMessage.MAPPING.toString());
UsageMessage.MAPPING.toString());
default:
throw new ParseException(
UsageMessage.HELP.toString());
UsageMessage.HELP.toString());
}
}

Expand Down Expand Up @@ -246,7 +245,7 @@ public Command parseCommandActionArg(String userInput) throws ParseException {
}

private LocalCourseCommand getLocalCourseCommandWithArg(String userInput, String actionWord, String arguments)
throws ParseException {
throws ParseException {
switch (actionWord) {
case LocalCourseAddCommand.ACTION_WORD:
return new LocalCourseAddCommandParser().parse(arguments);
Expand All @@ -269,7 +268,7 @@ private LocalCourseCommand getLocalCourseCommandWithArg(String userInput, String
}

private LocalCourseCommand getLocalCourseCommandWithoutArg(String userInput, String actionWord)
throws ParseException {
throws ParseException {
if (actionWord.equals(LocalCourseListCommand.ACTION_WORD)) {
return new LocalCourseListCommand();
}
Expand All @@ -292,7 +291,7 @@ private LocalCourseCommand getLocalCourseCommandWithoutArg(String userInput, Str
}

private PartnerCourseCommand getPartnerCourseCommandWithArg(String userInput, String actionWord, String arguments)
throws ParseException {
throws ParseException {
switch (actionWord) {
case PartnerCourseAddCommand.ACTION_WORD:
return new PartnerCourseAddCommandParser().parse(arguments);
Expand All @@ -315,7 +314,7 @@ private PartnerCourseCommand getPartnerCourseCommandWithArg(String userInput, St
}

private PartnerCourseCommand getPartnerCourseCommandWithoutArg(String userInput, String actionWord)
throws ParseException {
throws ParseException {
if (actionWord.equals(PartnerCourseListCommand.ACTION_WORD)) {
return new PartnerCourseListCommand();
}
Expand Down Expand Up @@ -355,7 +354,7 @@ private UniversityCommand getUniversityCommandWithoutArg(String userInput, Strin
}

private UniversityCommand getUniversityCommandWithArg(String userInput, String actionWord, String arguments)
throws ParseException {
throws ParseException {
if (actionWord.equals(UniversitySearchCommand.ACTION_WORD)) {
return new UniversitySearchCommandParser().parse(arguments);
}
Expand Down Expand Up @@ -412,7 +411,7 @@ private MappingCommand getMappingCommandWithoutArg(String userInput, String acti
}

private NoteCommand getNoteCommandWithArg(String userInput, String actionWord, String arguments)
throws ParseException {
throws ParseException {
switch (actionWord) {
case NoteAddCommand.ACTION_WORD:
return new NoteAddCommandParser().parse(arguments);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public static void assertSeplendidCommandFailure(Command command, SeplendidModel
// we are unable to defensively copy the model for comparison later, so we can
// only do so by copying its components.

// TBD: To other developers: please add on other data types appropriately
// To other developers: please add on other data types appropriately
LocalCourseCatalogue expectedLocalCourseCatalogue =
new LocalCourseCatalogue(actualModel.getLocalCourseCatalogue());
List<LocalCourse> expectedFilteredLocalCourseList = new ArrayList<>(actualModel.getFilteredLocalCourseList());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,5 @@ public void equals() {
// null -> returns false
assertFalse(universitySortCommandByUniversityName.equals(null));

// different task -> returns false
// TBD when country for university is ready.

}
}

0 comments on commit cbdcf20

Please sign in to comment.