Skip to content

Commit

Permalink
Merge pull request #380
Browse files Browse the repository at this point in the history
Minor code refactor
  • Loading branch information
CYX22222003 authored Nov 11, 2024
2 parents f6ef003 + bd6fe6c commit c9c9135
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
import seedu.address.model.tag.Tag;

/**
* Implements command to delete a tag from a person
* format: deltag [INDEX] t/[TAG NAME]
* Implements command to delete a tag from a person.
* format: deltag [INDEX] t/[TAG NAME].
*/
public class DeleteTagCommand extends Command {
public static final String COMMAND_WORD = "deltag";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,16 @@
import seedu.address.model.tag.Tag;

/**
* Parse the delete tag command.
* Parses the delete tag command.
*/
public class DeleteTagCommandParser implements Parser<DeleteTagCommand> {
/**
* Parses the given string of arguments in the context of Delete tag command.
* Parses the given string of arguments in the context of delete tag command.
* and returns DeleteTagCommand object for execution.
* @throws ParseException if user input does not conform the expected input
*/
public DeleteTagCommand parse(String args) throws ParseException {
requireNonNull(args);
// assert !args.isEmpty(); // This causes error to not be displayed properly
ArgumentMultimap argMultiMap = ArgumentTokenizer.tokenize(args, PREFIX_TAG);

Index index;
Expand Down
14 changes: 5 additions & 9 deletions src/main/java/seedu/address/model/CampusConnect.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import java.util.List;
import java.util.Set;
import java.util.Stack;

import javafx.collections.ObservableList;
import seedu.address.commons.util.ToStringBuilder;
Expand All @@ -16,15 +15,12 @@
import seedu.address.model.tag.TagCategory;

/**
* Wraps all data at the CampusConnect level
* Duplicates are not allowed (by .isSamePerson comparison)
* Wraps all data at the CampusConnect level.
* Duplicates are not allowed.
*/
public class CampusConnect implements ReadOnlyCampusConnect {

private final UniquePersonList persons;
private final Stack<ReadOnlyCampusConnect> prev = new Stack<>();
private final Stack<ReadOnlyCampusConnect> future = new Stack<>();

private final VersionedCampusConnect versionedCampusConnect = new VersionedCampusConnect();

/*
Expand Down Expand Up @@ -60,7 +56,7 @@ public void saveCurrentState() {
}

/**
* Recovers from previous states
* Recovers from previous state.
*/
public ReadOnlyCampusConnect recoverPreviousState() throws UndoException {
ReadOnlyCampusConnect out = versionedCampusConnect.extractOldData();
Expand All @@ -69,7 +65,7 @@ public ReadOnlyCampusConnect recoverPreviousState() throws UndoException {
}

/**
* Recovers previously undone states
* Recovers the previously undone state.
*/
public ReadOnlyCampusConnect recoverUndoneState() throws RedoException {
ReadOnlyCampusConnect out = versionedCampusConnect.extractUndoneData();
Expand Down Expand Up @@ -151,7 +147,7 @@ public void removePersonTag(Person p, Tag t) {
}

/**
* Adds a new Tag to person
* Adds a new Tag to a person.
*/
public void addPersonTags(Person p, Set<Tag> tagList) {
persons.addPersonTags(p, tagList);
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/seedu/address/model/Model.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ public interface Model {

/**
* Deletes a tag from a person.
* The person must exist as well as the tag
* The person must exist as well as the tag.
*/
void deletePersonTag(Person p, Tag tag);

/**
* Adds a set of tag to person
* Adds a set of tag to person.
*/
void addPersonTags(Person p, Set<Tag>t);

Expand Down Expand Up @@ -131,12 +131,12 @@ public interface Model {
void updateFilteredPersonList(Predicate<Person> predicate);

/**
* Undoes the previous actions of users
* Undoes the previous actions of users.
*/
void undoCampusConnect() throws CommandException;

/**
* Restores state before previous undo actions of users
* Restores state before previous undo actions of users.
*/
void redoCampusConnect() throws CommandException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void saveCurrentData(ReadOnlyCampusConnect data) {
}

/**
* Clear all undone data in the future stack.
* Clears all undone data in the future stack.
*/
public void clearUndoneData() {
future.clear();
Expand Down

0 comments on commit c9c9135

Please sign in to comment.