/*
 * Created on 2004-2-9
 *
 * To change the template for this generated file go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
package workflow.wfmc.xpdl.parameter;

import workflow.wfmc.xpdl.XPDLObject;

/**
 * @author zosatapo
 *
 * To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
public final class FormalParameter extends XPDLObject
{
  private Class  type; 
  private int index;
  private ParameterMode mode;
  
  public FormalParameter()
  {
    super();
  }
    
  public FormalParameter(String id, Class type, int index,String mode)
  {
    this(id,type,index,ParameterMode.parse(mode));
  }
  
  public FormalParameter(String id, Class type, int index,ParameterMode mode)
  {
    // name is same with id
    super(id,id);
    this.type = type;
    this.index=index;
    this.mode=mode;
  }
    
  public void setType(Class type_)
  {
    this.type = type_;
  }

  public Class getType()
  {
    return type;
  }
  
  public void setIndex(int index)
  {
    this.index=index;
  }
    
  public int  getIndex()
  {
    return index;
  }
  
  public void  setMode(String mode)
  {
    this.mode=ParameterMode.parse(mode);
  }
  
  public void setMode(ParameterMode mode)
  {
    this.mode=mode;
  }

  public ParameterMode getMode()
  {
    return mode;
  }
  
  public String toString()
  {
    return "[id=" + getUUID() + "] " +
           "[type=" + type + "] ";
  }
}
