content: /**
   * (C) Jennic Ltd
   *
   * $Id$
   */
  package com.jennic.ZPSConfiguration.impl;
  
  
  import java.util.Collection;
  
  import org.eclipse.emf.common.notify.Notification;
  import org.eclipse.emf.common.notify.NotificationChain;
  
  import org.eclipse.emf.common.util.EList;
  
  import org.eclipse.emf.ecore.EClass;
  import org.eclipse.emf.ecore.InternalEObject;
  
  import org.eclipse.emf.ecore.impl.ENotificationImpl;
  
  import org.eclipse.emf.ecore.util.EObjectContainmentEList;
  import org.eclipse.emf.ecore.util.InternalEList;
  
  import com.jennic.ZPSConfiguration.Cluster;
  import com.jennic.ZPSConfiguration.Profile;
  import com.jennic.ZPSConfiguration.ZPSConfigurationFactory;
  import com.jennic.ZPSConfiguration.ZPSConfigurationPackage;
  
  /**
   * <!-- begin-user-doc -->
   * An implementation of the model object '<em><b>Profile</b></em>'.
   * <!-- end-user-doc -->
   * <p>
   * The following features are implemented:
   * <ul>
   *   <li>{@link com.jennic.ZPSConfiguration.impl.ProfileImpl#getId <em>Id</em>}</li>
   *   <li>{@link com.jennic.ZPSConfiguration.impl.ProfileImpl#getClusters <em>Clusters</em>}</li>
   * </ul>
   * </p>
   *
   * @generated
   */
  public class ProfileImpl extends NamedObjectImpl implements Profile {
  	/**
  	 * <!-- begin-user-doc -->
  	 * <!-- end-user-doc -->
  	 * @generated
  	 */
  	public static final String copyright = "(C) NXP B.V";
  
  	/**
  	 * The default value of the '{@link #getId() <em>Id</em>}' attribute.
  	 * <!-- begin-user-doc -->
  	 * <!-- end-user-doc -->
  	 * @see #getId()
  	 * @generated
  	 * @ordered
  	 */
  	protected static final Object ID_EDEFAULT = (Object)ZPSConfigurationFactory.eINSTANCE.createFromString(ZPSConfigurationPackage.eINSTANCE.getEUShort(), "1");
  
  	/**
  	 * The cached value of the '{@link #getId() <em>Id</em>}' attribute.
  	 * <!-- begin-user-doc -->
  	 * <!-- end-user-doc -->
  	 * @see #getId()
  	 * @generated
  	 * @ordered
  	 */
  	protected Object id = ID_EDEFAULT;
  
  	/**
  	 * The cached value of the '{@link #getClusters() <em>Clusters</em>}' containment reference list.
  	 * <!-- begin-user-doc -->
  	 * <!-- end-user-doc -->
  	 * @see #getClusters()
  	 * @generated
  	 * @ordered
  	 */
  	protected EList<Cluster> clusters;
  
  	/**
  	 * <!-- begin-user-doc -->
  	 * <!-- end-user-doc -->
  	 * @generated
  	 */
  	protected ProfileImpl() {
  		super();
  	}
  
  	/**
  	 * <!-- begin-user-doc -->
  	 * <!-- end-user-doc -->
  	 * @generated
  	 */
  	@Override
  	protected EClass eStaticClass() {
  		return ZPSConfigurationPackage.Literals.PROFILE;
  	}
  
  	/**
  	 * <!-- begin-user-doc -->
  	 * <!-- end-user-doc -->
  	 * @generated
  	 */
  	public Object getId() {
  		return id;
  	}
  
  	/**
  	 * <!-- begin-user-doc -->
  	 * <!-- end-user-doc -->
  	 * @generated
  	 */
  	public void setId(Object newId) {
  		Object oldId = id;
  		id = newId;
  		if (eNotificationRequired())
  			eNotify(new ENotificationImpl(this, Notification.SET, ZPSConfigurationPackage.PROFILE__ID, oldId, id));
  	}
  
  	/**
  	 * <!-- begin-user-doc -->
  	 * <!-- end-user-doc -->
  	 * @generated
  	 */
  	public EList<Cluster> getClusters() {
  		if (clusters == null) {
  			clusters = new EObjectContainmentEList<Cluster>(Cluster.class, this, ZPSConfigurationPackage.PROFILE__CLUSTERS);
  		}
  		return clusters;
  	}
  
  	/**
  	 * <!-- begin-user-doc -->
  	 * <!-- end-user-doc -->
  	 * @generated
  	 */
  	@Override
  	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
  		switch (featureID) {
  			case ZPSConfigurationPackage.PROFILE__CLUSTERS:
  				return ((InternalEList<?>)getClusters()).basicRemove(otherEnd, msgs);
  		}
  		return super.eInverseRemove(otherEnd, featureID, msgs);
  	}
  
  	/**
  	 * <!-- begin-user-doc -->
  	 * <!-- end-user-doc -->
  	 * @generated
  	 */
  	@Override
  	public Object eGet(int featureID, boolean resolve, boolean coreType) {
  		switch (featureID) {
  			case ZPSConfigurationPackage.PROFILE__ID:
  				return getId();
  			case ZPSConfigurationPackage.PROFILE__CLUSTERS:
  				return getClusters();
  		}
  		return super.eGet(featureID, resolve, coreType);
  	}
  
  	/**
  	 * <!-- begin-user-doc -->
  	 * <!-- end-user-doc -->
  	 * @generated
  	 */
  	@SuppressWarnings("unchecked")
  	@Override
  	public void eSet(int featureID, Object newValue) {
  		switch (featureID) {
  			case ZPSConfigurationPackage.PROFILE__ID:
  				setId((Object)newValue);
  				return;
  			case ZPSConfigurationPackage.PROFILE__CLUSTERS:
  				getClusters().clear();
  				getClusters().addAll((Collection<? extends Cluster>)newValue);
  				return;
  		}
  		super.eSet(featureID, newValue);
  	}
  
  	/**
  	 * <!-- begin-user-doc -->
  	 * <!-- end-user-doc -->
  	 * @generated
  	 */
  	@Override
  	public void eUnset(int featureID) {
  		switch (featureID) {
  			case ZPSConfigurationPackage.PROFILE__ID:
  				setId(ID_EDEFAULT);
  				return;
  			case ZPSConfigurationPackage.PROFILE__CLUSTERS:
  				getClusters().clear();
  				return;
  		}
  		super.eUnset(featureID);
  	}
  
  	/**
  	 * <!-- begin-user-doc -->
  	 * <!-- end-user-doc -->
  	 * @generated
  	 */
  	@Override
  	public boolean eIsSet(int featureID) {
  		switch (featureID) {
  			case ZPSConfigurationPackage.PROFILE__ID:
  				return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);
  			case ZPSConfigurationPackage.PROFILE__CLUSTERS:
  				return clusters != null && !clusters.isEmpty();
  		}
  		return super.eIsSet(featureID);
  	}
  
  	/**
  	 * <!-- begin-user-doc -->
  	 * <!-- end-user-doc -->
  	 * @generated
  	 */
  	@Override
  	public String toString() {
  		if (eIsProxy()) return super.toString();
  
  		StringBuffer result = new StringBuffer(super.toString());
  		result.append(" (Id: ");
  		result.append(id);
  		result.append(')');
  		return result.toString();
  	}
  
  } //ProfileImpl
  