/*
 * Created on 02-nov-2004
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package org.postgresql.coreDriver;

/**
 * @author jsalas
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class ContextTask {
	private StringBuffer errorMessage;
	private int step;
	private boolean l_endQuery;
	int type;
	
	Object task;
	
	/**
	 * 
	 */
	public ContextTask() {
		errorMessage = null;
		l_endQuery = false;		
		type = 0;
		step = 0;
	}		
		
	/**
	 * @param errorMessage
	 * @param step
	 * @param query
	 * @param type
	 */
	public ContextTask(StringBuffer errorMessage, int step, boolean query,
			int type) {
		super();
		this.errorMessage = errorMessage;
		this.step = step;
		l_endQuery = query;
		this.type = type;
	}
	
	public void appendErrorMessage(String error){
		errorMessage.append(error);
	}
	
	public void incStep(){
		step++;
	}
	
	/* ---------- Getters and Setters ---------- */	
	/**
	 * @return Returns the errorMessage.
	 */
	public StringBuffer getErrorMessage() {
		return errorMessage;
	}
	/**
	 * @param errorMessage The errorMessage to set.
	 */
	public void setErrorMessage(StringBuffer errorMessage) {
		this.errorMessage = errorMessage;
	}
	/**
	 * @return Returns the l_endQuery.
	 */
	public boolean isL_endQuery() {
		return l_endQuery;
	}
	/**
	 * @param query The l_endQuery to set.
	 */
	public void setL_endQuery(boolean query) {
		l_endQuery = query;
	}
	/**
	 * @return Returns the step.
	 */
	public int getStep() {
		return step;
	}
	/**
	 * @param step The step to set.
	 */
	public void setStep(int step) {
		this.step = step;
	}
	/**
	 * @return Returns the task.
	 */
	public Object getTask() {
		return task;
	}
	/**
	 * @param task The task to set.
	 */
	public void setTask(Object task) {
		this.task = task;
	}
	/**
	 * @return Returns the type.
	 */
	public int getType() {
		return type;
	}
	/**
	 * @param type The type to set.
	 */
	public void setType(int type) {
		this.type = type;
	}
}
