Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[W8.6b][W15-B2] Tan Kai Yong #950

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified doc/images/mainClassDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 10 additions & 1 deletion src/seedu/addressbook/data/AddressBook.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package seedu.addressbook.data;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
Expand All @@ -11,6 +12,7 @@
import seedu.addressbook.data.person.UniquePersonList.DuplicatePersonException;
import seedu.addressbook.data.person.UniquePersonList.PersonNotFoundException;
import seedu.addressbook.data.tag.Tag;
import seedu.addressbook.data.tag.Tagging;
import seedu.addressbook.data.tag.UniqueTagList;

/**
Expand All @@ -24,7 +26,7 @@ public class AddressBook {

private final UniquePersonList allPersons;
private final UniqueTagList allTags; // can contain tags not attached to any person

private static ArrayList<Tagging> taggingList = new ArrayList<Tagging>();
/**
* Creates an empty address book.
*/
Expand Down Expand Up @@ -121,6 +123,13 @@ public UniqueTagList getAllTags() {
return new UniqueTagList(allTags);
}

/**
*Return a list of tagging which store all sessions where a tag is added or removed from a specific person
*/
public static ArrayList<Tagging> getTaggingList() {
return taggingList;
}

@Override
public boolean equals(Object other) {
return other == this // short circuit if same object
Expand Down
31 changes: 31 additions & 0 deletions src/seedu/addressbook/data/tag/Tagging.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package seedu.addressbook.data.tag;

import seedu.addressbook.data.person.Person;

/**
* Store adding or deleting a tag for a specific person that happened during that session.
*/
public class Tagging {

private String personName;
private String tagName;
private String methodType;

public Tagging(String personName, String tagName, String methodType) {
this.personName = personName;
this.tagName = tagName;
this.methodType = methodType;
}

public String getPersonName() {
return this.personName;
}

public String getTagName() {
return this.tagName;
}

public String getMethodType() {
return methodType;
}
}