/**
 * <copyright>
 * </copyright>
 *
 * $Id: WorkProductDescriptionImpl.java,v 1.2 2006/06/23 00:01:25 jxi Exp $
 */
package org.eclipse.epf.xml.uma.impl;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

import org.eclipse.epf.xml.uma.UmaPackage;
import org.eclipse.epf.xml.uma.WorkProductDescription;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Work Product Description</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.eclipse.epf.xml.uma.impl.WorkProductDescriptionImpl#getImpactOfNotHaving <em>Impact Of Not Having</em>}</li>
 *   <li>{@link org.eclipse.epf.xml.uma.impl.WorkProductDescriptionImpl#getPurpose <em>Purpose</em>}</li>
 *   <li>{@link org.eclipse.epf.xml.uma.impl.WorkProductDescriptionImpl#getReasonsForNotNeeding <em>Reasons For Not Needing</em>}</li>
 *   <li>{@link org.eclipse.epf.xml.uma.impl.WorkProductDescriptionImpl#getExternalId <em>External Id</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class WorkProductDescriptionImpl extends ContentDescriptionImpl implements WorkProductDescription {
	/**
	 * The default value of the '{@link #getImpactOfNotHaving() <em>Impact Of Not Having</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getImpactOfNotHaving()
	 * @generated
	 * @ordered
	 */
	protected static final String IMPACT_OF_NOT_HAVING_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getImpactOfNotHaving() <em>Impact Of Not Having</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getImpactOfNotHaving()
	 * @generated
	 * @ordered
	 */
	protected String impactOfNotHaving = IMPACT_OF_NOT_HAVING_EDEFAULT;

	/**
	 * The default value of the '{@link #getPurpose() <em>Purpose</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getPurpose()
	 * @generated
	 * @ordered
	 */
	protected static final String PURPOSE_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getPurpose() <em>Purpose</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getPurpose()
	 * @generated
	 * @ordered
	 */
	protected String purpose = PURPOSE_EDEFAULT;

	/**
	 * The default value of the '{@link #getReasonsForNotNeeding() <em>Reasons For Not Needing</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getReasonsForNotNeeding()
	 * @generated
	 * @ordered
	 */
	protected static final String REASONS_FOR_NOT_NEEDING_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getReasonsForNotNeeding() <em>Reasons For Not Needing</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getReasonsForNotNeeding()
	 * @generated
	 * @ordered
	 */
	protected String reasonsForNotNeeding = REASONS_FOR_NOT_NEEDING_EDEFAULT;

	/**
	 * The default value of the '{@link #getExternalId() <em>External Id</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getExternalId()
	 * @generated
	 * @ordered
	 */
	protected static final String EXTERNAL_ID_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getExternalId() <em>External Id</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getExternalId()
	 * @generated
	 * @ordered
	 */
	protected String externalId = EXTERNAL_ID_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected WorkProductDescriptionImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected EClass eStaticClass() {
		return UmaPackage.Literals.WORK_PRODUCT_DESCRIPTION;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getImpactOfNotHaving() {
		return impactOfNotHaving;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setImpactOfNotHaving(String newImpactOfNotHaving) {
		String oldImpactOfNotHaving = impactOfNotHaving;
		impactOfNotHaving = newImpactOfNotHaving;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, UmaPackage.WORK_PRODUCT_DESCRIPTION__IMPACT_OF_NOT_HAVING, oldImpactOfNotHaving, impactOfNotHaving));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getPurpose() {
		return purpose;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setPurpose(String newPurpose) {
		String oldPurpose = purpose;
		purpose = newPurpose;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, UmaPackage.WORK_PRODUCT_DESCRIPTION__PURPOSE, oldPurpose, purpose));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getReasonsForNotNeeding() {
		return reasonsForNotNeeding;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setReasonsForNotNeeding(String newReasonsForNotNeeding) {
		String oldReasonsForNotNeeding = reasonsForNotNeeding;
		reasonsForNotNeeding = newReasonsForNotNeeding;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, UmaPackage.WORK_PRODUCT_DESCRIPTION__REASONS_FOR_NOT_NEEDING, oldReasonsForNotNeeding, reasonsForNotNeeding));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getExternalId() {
		return externalId;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setExternalId(String newExternalId) {
		String oldExternalId = externalId;
		externalId = newExternalId;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, UmaPackage.WORK_PRODUCT_DESCRIPTION__EXTERNAL_ID, oldExternalId, externalId));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case UmaPackage.WORK_PRODUCT_DESCRIPTION__IMPACT_OF_NOT_HAVING:
				return getImpactOfNotHaving();
			case UmaPackage.WORK_PRODUCT_DESCRIPTION__PURPOSE:
				return getPurpose();
			case UmaPackage.WORK_PRODUCT_DESCRIPTION__REASONS_FOR_NOT_NEEDING:
				return getReasonsForNotNeeding();
			case UmaPackage.WORK_PRODUCT_DESCRIPTION__EXTERNAL_ID:
				return getExternalId();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case UmaPackage.WORK_PRODUCT_DESCRIPTION__IMPACT_OF_NOT_HAVING:
				setImpactOfNotHaving((String)newValue);
				return;
			case UmaPackage.WORK_PRODUCT_DESCRIPTION__PURPOSE:
				setPurpose((String)newValue);
				return;
			case UmaPackage.WORK_PRODUCT_DESCRIPTION__REASONS_FOR_NOT_NEEDING:
				setReasonsForNotNeeding((String)newValue);
				return;
			case UmaPackage.WORK_PRODUCT_DESCRIPTION__EXTERNAL_ID:
				setExternalId((String)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void eUnset(int featureID) {
		switch (featureID) {
			case UmaPackage.WORK_PRODUCT_DESCRIPTION__IMPACT_OF_NOT_HAVING:
				setImpactOfNotHaving(IMPACT_OF_NOT_HAVING_EDEFAULT);
				return;
			case UmaPackage.WORK_PRODUCT_DESCRIPTION__PURPOSE:
				setPurpose(PURPOSE_EDEFAULT);
				return;
			case UmaPackage.WORK_PRODUCT_DESCRIPTION__REASONS_FOR_NOT_NEEDING:
				setReasonsForNotNeeding(REASONS_FOR_NOT_NEEDING_EDEFAULT);
				return;
			case UmaPackage.WORK_PRODUCT_DESCRIPTION__EXTERNAL_ID:
				setExternalId(EXTERNAL_ID_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case UmaPackage.WORK_PRODUCT_DESCRIPTION__IMPACT_OF_NOT_HAVING:
				return IMPACT_OF_NOT_HAVING_EDEFAULT == null ? impactOfNotHaving != null : !IMPACT_OF_NOT_HAVING_EDEFAULT.equals(impactOfNotHaving);
			case UmaPackage.WORK_PRODUCT_DESCRIPTION__PURPOSE:
				return PURPOSE_EDEFAULT == null ? purpose != null : !PURPOSE_EDEFAULT.equals(purpose);
			case UmaPackage.WORK_PRODUCT_DESCRIPTION__REASONS_FOR_NOT_NEEDING:
				return REASONS_FOR_NOT_NEEDING_EDEFAULT == null ? reasonsForNotNeeding != null : !REASONS_FOR_NOT_NEEDING_EDEFAULT.equals(reasonsForNotNeeding);
			case UmaPackage.WORK_PRODUCT_DESCRIPTION__EXTERNAL_ID:
				return EXTERNAL_ID_EDEFAULT == null ? externalId != null : !EXTERNAL_ID_EDEFAULT.equals(externalId);
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (impactOfNotHaving: ");
		result.append(impactOfNotHaving);
		result.append(", purpose: ");
		result.append(purpose);
		result.append(", reasonsForNotNeeding: ");
		result.append(reasonsForNotNeeding);
		result.append(", externalId: ");
		result.append(externalId);
		result.append(')');
		return result.toString();
	}

} //WorkProductDescriptionImpl