package net.sourceforge.jsurveyor;


/**
 * Abstract class to model answers. 
 * It holds an ID, and a reference to the question that it is an answer to.
 * @version 1.0
 * @author Claus Methmann Christensen
 * @author Anders Spliid Hansen
 * @author Esben Iversen Hansen
 * @author Lars H Jensen
 * @author Marcus Overheu
 * @author Thomas Ramdal
 * @author Peter Thomsen
 */
abstract class Answer {
	
	/**
	 * Field answerID
	 */
	private int answerID;
	/**
	 * Field questionID
	 */
	private int questionID;
	
	/**
	 * Constructor for Answer
	 */
	public Answer() {	
	}
	
	/**
	 * Constructor for Answer, use with new answers.
	 * @param questionID int
	 */
	public Answer(int questionID) {
		this.questionID = questionID;
	}
	
	/**
	 * Constructor for Answer, use with dataAccess to retrieve stored answers.
	 * @param answerID int
	 * @param questionID int
	 */
	public Answer(int answerID, int questionID) {
		this.answerID = answerID;
		this.questionID = questionID;
	}
	
	/**
	 * Returns the questionID that the answer belongs to.
	 * @return int
	 */
	public int getQuestionID() {
		return questionID;
	}
	
	/**
	 * Sets the questionID that the object is an answer for.
	 * @param questionID int
	 */
	public void setQuestionID(int questionID) {
		this.questionID = questionID;
	}
	
	/**
	 * Returns the id of the answer
	 * @return int
	 */
	public int getAnswerID() {
		return answerID;
	}
	
	/**
	 * Sets the id of the answer
	 * @param answerID int
	 */
	public void setAnswerID(int answerID) {
		this.answerID = answerID;
	}
}
