content: /**
   */
  package com.intel.llvm.ireditor.lLVM_IR.impl;
  
  import com.intel.llvm.ireditor.lLVM_IR.Instruction;
  import com.intel.llvm.ireditor.lLVM_IR.Instruction_phi;
  import com.intel.llvm.ireditor.lLVM_IR.LLVM_IRPackage;
  import com.intel.llvm.ireditor.lLVM_IR.MetadataSuffix;
  import com.intel.llvm.ireditor.lLVM_IR.StartingInstruction;
  
  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;
  
  /**
   * <!-- begin-user-doc -->
   * An implementation of the model object '<em><b>Starting Instruction</b></em>'.
   * <!-- end-user-doc -->
   * <p>
   * The following features are implemented:
   * <ul>
   *   <li>{@link com.intel.llvm.ireditor.lLVM_IR.impl.StartingInstructionImpl#getMetadata <em>Metadata</em>}</li>
   *   <li>{@link com.intel.llvm.ireditor.lLVM_IR.impl.StartingInstructionImpl#getInstruction <em>Instruction</em>}</li>
   * </ul>
   * </p>
   *
   * @generated
   */
  public class StartingInstructionImpl extends NamedInstructionImpl implements StartingInstruction
  {
    /**
     * The cached value of the '{@link #getMetadata() <em>Metadata</em>}' containment reference list.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getMetadata()
     * @generated
     * @ordered
     */
    protected EList<MetadataSuffix> metadata;
  
    /**
     * The cached value of the '{@link #getInstruction() <em>Instruction</em>}' containment reference.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getInstruction()
     * @generated
     * @ordered
     */
    protected Instruction_phi instruction;
  
    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    protected StartingInstructionImpl()
    {
      super();
    }
  
    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    protected EClass eStaticClass()
    {
      return LLVM_IRPackage.Literals.STARTING_INSTRUCTION;
    }
  
    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public EList<MetadataSuffix> getMetadata()
    {
      if (metadata == null)
      {
        metadata = new EObjectContainmentEList<MetadataSuffix>(MetadataSuffix.class, this, LLVM_IRPackage.STARTING_INSTRUCTION__METADATA);
      }
      return metadata;
    }
  
    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public Instruction_phi getInstruction()
    {
      return instruction;
    }
  
    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public NotificationChain basicSetInstruction(Instruction_phi newInstruction, NotificationChain msgs)
    {
      Instruction_phi oldInstruction = instruction;
      instruction = newInstruction;
      if (eNotificationRequired())
      {
        ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, LLVM_IRPackage.STARTING_INSTRUCTION__INSTRUCTION, oldInstruction, newInstruction);
        if (msgs == null) msgs = notification; else msgs.add(notification);
      }
      return msgs;
    }
  
    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setInstruction(Instruction_phi newInstruction)
    {
      if (newInstruction != instruction)
      {
        NotificationChain msgs = null;
        if (instruction != null)
          msgs = ((InternalEObject)instruction).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - LLVM_IRPackage.STARTING_INSTRUCTION__INSTRUCTION, null, msgs);
        if (newInstruction != null)
          msgs = ((InternalEObject)newInstruction).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - LLVM_IRPackage.STARTING_INSTRUCTION__INSTRUCTION, null, msgs);
        msgs = basicSetInstruction(newInstruction, msgs);
        if (msgs != null) msgs.dispatch();
      }
      else if (eNotificationRequired())
        eNotify(new ENotificationImpl(this, Notification.SET, LLVM_IRPackage.STARTING_INSTRUCTION__INSTRUCTION, newInstruction, newInstruction));
    }
  
    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
    {
      switch (featureID)
      {
        case LLVM_IRPackage.STARTING_INSTRUCTION__METADATA:
          return ((InternalEList<?>)getMetadata()).basicRemove(otherEnd, msgs);
        case LLVM_IRPackage.STARTING_INSTRUCTION__INSTRUCTION:
          return basicSetInstruction(null, 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 LLVM_IRPackage.STARTING_INSTRUCTION__METADATA:
          return getMetadata();
        case LLVM_IRPackage.STARTING_INSTRUCTION__INSTRUCTION:
          return getInstruction();
      }
      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 LLVM_IRPackage.STARTING_INSTRUCTION__METADATA:
          getMetadata().clear();
          getMetadata().addAll((Collection<? extends MetadataSuffix>)newValue);
          return;
        case LLVM_IRPackage.STARTING_INSTRUCTION__INSTRUCTION:
          setInstruction((Instruction_phi)newValue);
          return;
      }
      super.eSet(featureID, newValue);
    }
  
    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public void eUnset(int featureID)
    {
      switch (featureID)
      {
        case LLVM_IRPackage.STARTING_INSTRUCTION__METADATA:
          getMetadata().clear();
          return;
        case LLVM_IRPackage.STARTING_INSTRUCTION__INSTRUCTION:
          setInstruction((Instruction_phi)null);
          return;
      }
      super.eUnset(featureID);
    }
  
    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public boolean eIsSet(int featureID)
    {
      switch (featureID)
      {
        case LLVM_IRPackage.STARTING_INSTRUCTION__METADATA:
          return metadata != null && !metadata.isEmpty();
        case LLVM_IRPackage.STARTING_INSTRUCTION__INSTRUCTION:
          return instruction != null;
      }
      return super.eIsSet(featureID);
    }
  
    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
    {
      if (baseClass == Instruction.class)
      {
        switch (derivedFeatureID)
        {
          case LLVM_IRPackage.STARTING_INSTRUCTION__METADATA: return LLVM_IRPackage.INSTRUCTION__METADATA;
          default: return -1;
        }
      }
      return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
    }
  
    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
    {
      if (baseClass == Instruction.class)
      {
        switch (baseFeatureID)
        {
          case LLVM_IRPackage.INSTRUCTION__METADATA: return LLVM_IRPackage.STARTING_INSTRUCTION__METADATA;
          default: return -1;
        }
      }
      return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
    }
  
  } //StartingInstructionImpl
  