//----------------------------BEGIN LICENSE----------------------------
/* 
 * Willow : the Open Source WorkFlow Project
 * Distributable under GNU LGPL license by gun.org
 *
 * Copyright (C) 2004-2010 huihoo.org 
 * Copyright (C) 2004-2010  ZosaTapo <dertyang@hotmail.com> 
 * 
 * ====================================================================
 * Project Homepage : http://www.huihoo.org/willow
 * Source Forge     : http://sourceforge.net/projects/huihoo
 * Mailing list     : willow@lists.sourceforge.net 
 */
//----------------------------END  LICENSE-----------------------------
package org.huihoo.workflow.xpdl.parameter;

import org.huihoo.workflow.WorkflowComplexComponent;


public final class FormalParameter extends WorkflowComplexComponent
{
  private Class  type; 
  private int index;
  private ParameterMode mode;
  
  public FormalParameter()
  {
    this(null,null,0,(String)null);
  }
    
  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("FormalParameter",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 + "] ";
  }
}
