Question.java :  » Mobile » wevote » org » wevote » client » chart » model » Java Open Source

Java Open Source » Mobile » wevote 
wevote » org » wevote » client » chart » model » Question.java
package org.wevote.client.chart.model;

import java.util.Vector;

/**
 * Conteins question info and collection of answers for it
 *
 * @author NorthernDemon
 */

public class Question {
    
    private int id;
    private String title, pool, question, date;
    private Vector<Answer> answers = new Vector<Answer>();
    
    /**
     * @param id number of question in database
     */
    public void setId(int id) {
        this.id = id;
    }

    /**
     * @param title name of question
     */
    public void setTitle(String title) {
        this.title = title;
    }

    /**
     * @param pool name of pool to which question belong to
     */
    public void setPool(String pool) {
        this.pool = pool;
    }

    /**
     * @param question actual question text
     */
    public void setQuestion(String question) {
        this.question = question;
    }

    /**
     * @param date of voting
     */
    public void setDate(String date) {
        this.date = date;
    }

    /**
     * Adds answer to collection
     *
     * @param answer object of Answer.java, containig one answer unit
     */
    public void addAnswers(Answer answer) {
        this.answers.add(answer);
    }

    /**
     * @return number of question in database
     */
    public int getId() {
        return id;
    }

    /**
     * @return name of question
     */
    public String getTitle() {
        return title;
    }

    /**
     * @return name of pool to which question belong to
     */
    public String getPool() {
        return pool;
    }

    /**
     * @return actual question text
     */
    public String getQuestion() {
        return question;
    }

    /**
     * @return date of voting
     */
    public String getDate() {
        return date;
    }

    /**
     * @return collection of answers
     */
    public Vector<Answer> getAnswers() {
        return answers;
    }

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.