/*
 * Copyright (c) 2017 Michael D'Arcy and Brianne O'Niel.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.group13.androidsdk.mycards;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * The methods of the Card class are mostly self-explanatory, so I will omit detailed
 * descriptions on them for now. The main thing to know is that the Card class contains all the
 * relevant information about a card, and is mainly used to pass flashcard information between
 * classes.
 */
@SuppressWarnings("unused")
public class Card {

    @SuppressWarnings("FieldCanBeLocal")
    private int id = -1;

    private String frontText = "";
    private String backText = "";
    private List<String> tags = new ArrayList<>();

    private Date lastReviewDate = new Date(0);
    private Date nextReviewDate = new Date(0);
    private double easiness = 2.5;

    public Card(int id, String frontText, String backText, Date nextReviewDate, Date lastReviewDate, double easiness) {
        this.id = id;
        this.frontText = frontText;
        this.backText = backText;
        this.nextReviewDate = nextReviewDate;
        this.lastReviewDate = lastReviewDate;
        this.easiness = easiness;
    }


    public String getFrontText() {
        return frontText;
    }


    public void setFrontText(String frontText) {
        this.frontText = frontText;
    }


    public String getBackText() {
        return backText;
    }


    public void setBackText(String backText) {
        this.backText = backText;
    }


    public int getId() {
        return id;
    }


    public String[] getTags() {
        return tags.toArray(new String[tags.size()]);
    }


    public void addTag(String tag) {
        this.tags.add(tag);
    }


    public void removeTag(String tag) {
        this.tags.remove(tag);
    }


    public Date getLastReviewDate() {
        return lastReviewDate;
    }


    public void setLastReviewDate(Date lastReviewDate) {
        this.lastReviewDate = lastReviewDate;
    }


    public Date getNextReviewDate() {
        return nextReviewDate;
    }


    public void setNextReviewDate(Date nextReviewDate) {
        this.nextReviewDate = nextReviewDate;
    }


    public double getEasiness() {
        return easiness;
    }


    public void setEasiness(double easiness) {
        this.easiness = easiness;
    }


}

@@ -1419,16 +1419,32 @@
 (int id,
+%0A               
  String 
@@ -1453,16 +1453,32 @@
 ontText,
+%0A               
  String 
@@ -1486,16 +1486,32 @@
 ackText,
+%0A               
  Date ne
@@ -1523,16 +1523,32 @@
 iewDate,
+%0A               
  Date la
@@ -1560,16 +1560,32 @@
 iewDate,
+%0A               
  double 
@@ -2183,32 +2183,93 @@
 turn id;%0A    %7D%0A%0A
+    public void setId(int id) %7B%0A        this.id = id;%0A    %7D%0A%0A
 %0A    public Stri
@@ -3031,10 +3031,1528 @@
     %7D%0A%0A%0A
+    @Override%0A    public boolean equals(Object o) %7B%0A        if (this == o) %7B%0A            return true;%0A        %7D%0A        if (o == null %7C%7C getClass() != o.getClass()) %7B%0A            return false;%0A        %7D%0A%0A        Card card = (Card) o;%0A%0A        if (id != card.id) %7B%0A            return false;%0A        %7D%0A        if (Double.compare(card.easiness, easiness) != 0) %7B%0A            return false;%0A        %7D%0A        if (!frontText.equals(card.frontText)) %7B%0A            return false;%0A        %7D%0A        if (!backText.equals(card.backText)) %7B%0A            return false;%0A        %7D%0A        if (!tags.equals(card.tags)) %7B%0A            return false;%0A        %7D%0A        if (lastReviewDate != null ? !lastReviewDate.equals(card.lastReviewDate) : card%0A                .lastReviewDate != null) %7B%0A            return false;%0A        %7D%0A        return nextReviewDate != null ? nextReviewDate.equals(card.nextReviewDate) : card%0A                .nextReviewDate == null;%0A%0A    %7D%0A%0A    @Override%0A    public int hashCode() %7B%0A        int result;%0A        long temp;%0A        result = id;%0A        result = 31 * result + frontText.hashCode();%0A        result = 31 * result + backText.hashCode();%0A        result = 31 * result + tags.hashCode();%0A        result = 31 * result + (lastReviewDate != null ? lastReviewDate.hashCode() : 0);%0A        result = 31 * result + (nextReviewDate != null ? nextReviewDate.hashCode() : 0);%0A        temp = Double.doubleToLongBits(easiness);%0A        result = 31 * result + (int) (temp %5E (temp %3E%3E%3E 32));%0A        return result;%0A    %7D%0A
 %7D%0A

Add equals() and hashcode() methods for Card