//----------------------------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.usermodel;

import java.util.Iterator;

import org.huihoo.workflow.WorkflowComplexComponent;

public abstract class WorkflowGroup extends WorkflowComplexComponent
{
	/** 
	 * Construct a new WorkflowComponenet.
	 */
	protected WorkflowGroup()
	{
		this(null, null);
	}

	/** 
	 * Construct a new WorkflowComponenet.
	 *
	 * @param uuid_ The element ID
	 * @param name The element name
	 */
	protected WorkflowGroup(String uuid, String name)
	{
		this(uuid, name, null);
	}

	/** 
	 * Construct a new WorkflowComponenet.
	 *
	 * @param uuid_       The element ID
	 * @param name        The element name
	 * @param description The element description
	 */
	protected WorkflowGroup(String uuid_, String name, String description)
	{
		super(uuid_, name, description);
	}

	// ------------------------------------------------------------- Properties
	/**
	 * Set the department of this group.
	 *
	 * @param department The Department
	 */
	public abstract void setDepartment(WorkflowDepartment department);

	/**
	 * Return the Department of this group.
	 */
	public abstract WorkflowDepartment getDepartment();

	public abstract boolean isInDepartment(WorkflowDepartment departement);

	/**
	 * Set the leader of this group.
	 *
	 * @param president The leader
	 */
	public abstract void setPresident(WorkflowParticipant president);

	/**
	 * Return the leader of this group.
	 */
	public abstract WorkflowParticipant getPresident();

	/**
	 * Return the set of {@link WorkflowParticipant}s that are members of this group.
	 */
	public abstract Iterator getParticipants();

	// --------------------------------------------------------- Public Method
	/**
	 * Add a new {@link WorkflowParticipant} to this group.
	 *
	 * @param user The new user
	 */
	public abstract void addPaticipant(WorkflowParticipant user);

	/**
	 * Remove a {@link WorkflowParticipant} from this group.
	 *
	 * @param user The old user
	 */
	public abstract void removeParticipant(WorkflowParticipant user);

	/**
	 * Remove all {@link WorkflowParticipant}s from this group.
	 */
	public abstract void removeParticipants();

	/**
	 * get group's parent, if not exist,return null.
	 */
	public abstract WorkflowGroup getParentGroup();
}
