import java.io.File;

/**
 * error occurred during stamping
 * @author 413
 *
 */
public class Error 
{
	private File screen;
	private Boolean screen_Exist;
	private Integer ErrorPageNumber;	//error page number
	private String ErrorDescription;	//error description
	private Integer level;				//importance of error
	
	/**
	 * Constructor
	 * @param errorPageNumber
	 * @param errorDescription
	 * @param level
	 */
	public Error(Integer errorPageNumber, String errorDescription, Integer level)
	{
		super();
		this.level=level;
		ErrorPageNumber = errorPageNumber;
		ErrorDescription = errorDescription;
		screen_Exist = false;
	}

	/**
	 * Constructor if screen exist
	 * @param errorPageNumber
	 * @param errorDescription
	 * @param level
	 */
	public Error(Integer errorPageNumber, String errorDescription, Integer level, File screen)
	{
		super();
		this.level=level;
		ErrorPageNumber = errorPageNumber;
		ErrorDescription = errorDescription;
		this.screen=screen;
		screen_Exist = true;
	}
	
	/**
	 * return the number of the page where the error appended
	 * @returnErrorPageNumber
	 */
	public Integer getErrorPageNumber()
	{
		return ErrorPageNumber;
	}
	
	/**
	 * set the number of the page where the error appended
	 * @param errorPageNumber
	 */
	public void setErrorPageNumber(Integer errorPageNumber)
	{
		ErrorPageNumber = errorPageNumber;
	}
	
	/**
	 * return the description of the error
	 * @return ErrorDescription
	 */
	public String getErrorDescription()
	{
		return ErrorDescription;
	}
	
	/**
	 * set the description of the error
	 * @param errorDescription
	 */
	public void setErrorDescription(String errorDescription)
	{
		ErrorDescription = errorDescription;
	}
	
	/**
	 * return the level of the error
	 * @return
	 */
	public Integer getLevel()
	{
		return level;
	}
	
	/**
	 * set the level of the error
	 * @param level
	 */
	public void setLevel(Integer level)
	{
		this.level = level;
	}

	/**
	 * used in the display of WindowResult
	 */
	public String toString() 
	{
		return ErrorPageNumber + " : " + ErrorDescription;
	}
	
	/**
	 * get the screen file
	 * @return
	 */
	public File getScreen()
	{
		return screen;
	}

	/**
	 * set the screen file
	 * @param screen
	 */
	public void setScreen(File screen)
	{
		this.screen = screen;
	}

	/**
	 * return true if a screen file is attached to the error
	 * @return
	 */
	public Boolean isScreen_Exist()
	{
		return screen_Exist;
	}

	/**
	 * set if a screen file is attached to the error
	 * @param screen_Exist
	 */
	public void setScreen_Exist(Boolean screen_Exist)
	{
		this.screen_Exist = screen_Exist;
	}
}
