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][W13-B2]Bay Wei Heng #947

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
60 changes: 60 additions & 0 deletions src/seedu/addressbook/data/tag/Tagging.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
package seedu.addressbook.data.tag;

import seedu.addressbook.data.person.Person;

import java.util.ArrayList;

/**
* Represents an adding or deleting of a tag for a specific person during a session
* Used for displaying tags changed at the end of a session
*/

public class Tagging {

private static ArrayList<Tagging> taggings;

public enum CHANGE {
ADD, DELETE
}

private final Person person;
private final Tag tag;
private final CHANGE change;

/**
* @param person person whose tag was changed
* @param tag tag that was changed
* @param change type of change
*/
public Tagging(Person person, Tag tag, CHANGE change) {
this.person = person;
this.tag = tag;
this.change = change;
}

/**
* Adds tagging to class-level variable that stores all taggings
*/
public static void addTagging(Tagging tagging) {
taggings.add(tagging);
}

/**
* @return all Taggings, representing all changes made to tags since start of session
*/
public static ArrayList<Tagging> getTaggings() {
return taggings;
}

public Person getPerson() {
return person;
}

public Tag getTag() {
return tag;
}

public CHANGE getChange() {
return change;
}
}