package net.sourceforge.jsurveyor;
/**
 * Class to model freetext answers. Saves the text a user inputs.
 * @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
 */
public class AnswerFreeText extends Answer {

	/**
	 * Field freeText
	 */
	private String freeText;

	/**
	 * Constructor for AnswerFreeText
	 */
	public AnswerFreeText() {
		super();
	}
	
	/**
	 * Constructor for AnswerFreeText
	 * @param questionID int
	 */
	public AnswerFreeText(int questionID) {
		super(questionID);
	}
	
	/**
	 * Constructor for AnswerFreeText
	 * @param questionID int
	 * @param freeText String
	 */
	public AnswerFreeText(int questionID, String freeText) {
		super(questionID);
		this.freeText = freeText;
	}
	
	/**
	 * Constructor for AnswerFreeText, use through DataAccess.
	 * @param answerID int
	 * @param questionID int
	 * @param freeText String
	 */
	public AnswerFreeText(int answerID, int questionID, String freeText) {
		super(answerID, questionID);
		this.freeText = freeText;
	}

	/**
	 * Returns the answered freetext
	 * @return String
	 */
	public String getFreeText() {
		return freeText;
	}
	
	/**
	 * Sets the aswered freetext
	 * @param freeText String
	 */
	public void setFreeText(String freeText) {
		this.freeText = freeText;
	}

	/**
	 * Returns the answerID prefixed with a F to represent it is a freetext.
	 * @return String
	 */
	public String toString() {
		
		return "F" + getAnswerID();
	}

}
