package cn.com.qmth.stmms.biz.exam.model;

import java.util.List;

public class QuestionDetail implements Comparable<QuestionDetail> {

    private int number;

    private String title;

    private int index;

    private List<QuestionUnit> questions;

    public int getNumber() {
        return number;
    }

    public void setNumber(int number) {
        this.number = number;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    public List<QuestionUnit> getQuestions() {
        return questions;
    }

    public void setQuestions(List<QuestionUnit> questions) {
        this.questions = questions;
    }

    @Override
    public int compareTo(QuestionDetail o) {
        if (index > 0 && o.getIndex() > 0) {
            return index - o.getIndex();
        } else {
            return number - o.getNumber();
        }
    }
}
