package org.sakaiproject.wontovlab.model;
// default package
// Generated 20/03/2008 11:41:34 by Hibernate Tools 3.2.0.b11


import java.util.HashSet;
import java.util.Set;

/**
 * VlStep generated by hbm2java
 */
public class Step  implements java.io.Serializable {


     private Long stepId;
     private Experiment experiment;
     private String description;
     private Set stepMaterials = new HashSet(0);
     private Set executedExpLog = new HashSet(0);
     
     private Set stepsForStepDestinationId = new HashSet(0);
     private Set stepsForStepSourceId = new HashSet(0);

     private Set experimentFirstStep = new HashSet(0);
     private Set experimentLastStep = new HashSet(0);
     
    public Step() {
    }

	
    public Step(Experiment experiment, String description) {
        this.experiment = experiment;
        this.description = description;
    }
    public Step(Experiment experiment, String description, Set stepMaterials) {
       this.experiment = experiment;
       this.description = description;
       this.stepMaterials = stepMaterials;
    }
    
    public Step(Experiment experiment, String description, Set stepMaterials, Set stepsForStepSourceId, Set stepsForStepDestinationId, Set executedExpLog) {
        this.experiment = experiment;
        this.description = description;
        this.stepMaterials = stepMaterials;
        this.stepsForStepSourceId = stepsForStepSourceId;
        this.stepsForStepDestinationId = stepsForStepDestinationId;
        this.executedExpLog = executedExpLog;
     }
   
    public Long getStepId() {
        return this.stepId;
    }
    public void setStepId(Long stepId) {
        this.stepId = stepId;
    }

    public Experiment getExperiment() {
        return this.experiment;
    }
    public void setExperiment(Experiment experiment) {
        this.experiment = experiment;
    }

    public String getDescription() {
        return this.description;
    }
    public void setDescription(String description) {
        this.description = description;
    }

    public Set getStepMaterials() {
        return this.stepMaterials;
    }
    public void setStepMaterials(Set stepMaterials) {
        this.stepMaterials = stepMaterials;
    }


	public Set getStepsForStepDestinationId() {
		return stepsForStepDestinationId;
	}
	public void setStepsForStepDestinationId(Set stepsForStepDestinationId) {
		this.stepsForStepDestinationId = stepsForStepDestinationId;
	}

	public Long getStepsForStepDestinationIdFormatted() {
		String x = new String();
		
		if (stepsForStepDestinationId.size() == 0)
			x="0";
			
		x = stepsForStepDestinationId.toString().replace("[", "");
		x = x.toString().replace("]", "");
		return Long.parseLong(x);
	}
	
	public Set getStepsForStepSourceId() {
		return stepsForStepSourceId;
	}
	
	public void setStepsForStepSourceId(Set stepsForStepSourceId) {
		this.stepsForStepSourceId = stepsForStepSourceId;
	}

	public Long getStepsForStepSourceIdFormatted() {
		String x = new String();
		
		if (stepsForStepSourceId.size() == 0)
			x="0";
		
		x = stepsForStepSourceId.toString().replace("[", "");
		x = x.toString().replace("]", "");
		return Long.parseLong(x);
	}
	
    public void addStepSource (Step step)
    {
    	stepsForStepSourceId.add(step);
    }
    
    public void addStepDestination (Step step)
    {
    	stepsForStepDestinationId.add(step);
    }
    
    
    
    public Set getExecutedExpLog() {
		return executedExpLog;
	}


	public void setExecutedExpLog(Set executedExpLog) {
		this.executedExpLog = executedExpLog;
	}


	@Override
    public String toString() {
    	return this.getStepId().toString();
    }


	public Set getExperimentFirstStep() {
		return experimentFirstStep;
	}


	public void setExperimentFirstStep(Set experimentFirstStep) {
		this.experimentFirstStep = experimentFirstStep;
	}


	public Set getExperimentLastStep() {
		return experimentLastStep;
	}


	public void setExperimentLastStep(Set experimentLastStep) {
		this.experimentLastStep = experimentLastStep;
	}



    
	
	
    
	




}


