package zero.zd.zquestionnaire;

import java.util.ArrayList;

import zero.zd.zquestionnaire.model.QnA;
import zero.zd.zquestionnaire.model.QnaSubject;

public class QnaState {

    private static final String TAG = QnaState.class.getSimpleName();
    private static final QnaState sQnaStateInstance = new QnaState();

    private QnaSubject mQnaSubject;
    private ArrayList<QnA> mMistakeQnaList;


    private QnaState() {
    }

    public static QnaState getInstance() {
        return sQnaStateInstance;
    }

    public QnaSubject getQnaSubject() {
        return mQnaSubject;
    }

    public void setQnaSubject(QnaSubject qnaSubject) {
        mQnaSubject = qnaSubject;
    }

    public ArrayList<QnA> getQnAList() {
        return mQnaSubject.getQnaList();
    }

    public void setQnAList(ArrayList<QnA> qnAList) {
        mQnaSubject.setQnaList(qnAList);
    }

    public ArrayList<QnA> getMistakeQnaList() {
        return mMistakeQnaList;
    }

    public void setMistakeQnaList(ArrayList<QnA> mistakeQnaList) {
        mMistakeQnaList = mistakeQnaList;
    }

    @Override
    public String toString() {
        String out = "QNA LIST: \n";
        for (QnA qna : mQnaSubject.getQnaList()) {
            out += qna.toString() + "\n";
        }
        out += "END";
        return out;
    }
}

@@ -169,17 +169,16 @@
 State %7B%0A
-%0A
     priv
@@ -342,24 +342,61 @@
 QnaSubject;%0A
+    private ArrayList%3CQnA%3E mQnaList;%0A
     private 
@@ -428,17 +428,16 @@
 aList;%0A%0A
-%0A
     priv
@@ -750,18 +750,72 @@
 etQn
-A
+a
 List(
-) %7B%0A
+boolean isOriginalList) %7B%0A        if (isOriginalList)%0A    
     
@@ -847,24 +847,49 @@
 tQnaList();%0A
+        return mQnaList;%0A
     %7D%0A%0A    p
@@ -904,17 +904,17 @@
 id setQn
-A
+a
 List(Arr
@@ -927,17 +927,17 @@
 %3CQnA%3E qn
-A
+a
 List) %7B%0A
@@ -952,35 +952,22 @@
 mQna
-Subject.setQna
 List
-(qnA
+ = qna
 List
-)
 ;%0A  

Create Current QnaList