content: /**
   */
  package com.intel.llvm.ireditor.lLVM_IR.impl;
  
  import com.intel.llvm.ireditor.lLVM_IR.AggregateInstruction;
  import com.intel.llvm.ireditor.lLVM_IR.Constant;
  import com.intel.llvm.ireditor.lLVM_IR.LLVM_IRPackage;
  import com.intel.llvm.ireditor.lLVM_IR.TypedValue;
  
  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.impl.MinimalEObjectImpl;
  
  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>Aggregate Instruction</b></em>'.
   * <!-- end-user-doc -->
   * <p>
   * The following features are implemented:
   * <ul>
   *   <li>{@link com.intel.llvm.ireditor.lLVM_IR.impl.AggregateInstructionImpl#getOpcode <em>Opcode</em>}</li>
   *   <li>{@link com.intel.llvm.ireditor.lLVM_IR.impl.AggregateInstructionImpl#getAggregate <em>Aggregate</em>}</li>
   *   <li>{@link com.intel.llvm.ireditor.lLVM_IR.impl.AggregateInstructionImpl#getIndices <em>Indices</em>}</li>
   * </ul>
   * </p>
   *
   * @generated
   */
  public class AggregateInstructionImpl extends MinimalEObjectImpl.Container implements AggregateInstruction
  {
    /**
     * The default value of the '{@link #getOpcode() <em>Opcode</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getOpcode()
     * @generated
     * @ordered
     */
    protected static final String OPCODE_EDEFAULT = null;
  
    /**
     * The cached value of the '{@link #getOpcode() <em>Opcode</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getOpcode()
     * @generated
     * @ordered
     */
    protected String opcode = OPCODE_EDEFAULT;
  
    /**
     * The cached value of the '{@link #getAggregate() <em>Aggregate</em>}' containment reference.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getAggregate()
     * @generated
     * @ordered
     */
    protected TypedValue aggregate;
  
    /**
     * The cached value of the '{@link #getIndices() <em>Indices</em>}' containment reference list.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getIndices()
     * @generated
     * @ordered
     */
    protected EList<Constant> indices;
  
    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    protected AggregateInstructionImpl()
    {
      super();
    }
  
    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    protected EClass eStaticClass()
    {
      return LLVM_IRPackage.Literals.AGGREGATE_INSTRUCTION;
    }
  
    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public String getOpcode()
    {
      return opcode;
    }
  
    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setOpcode(String newOpcode)
    {
      String oldOpcode = opcode;
      opcode = newOpcode;
      if (eNotificationRequired())
        eNotify(new ENotificationImpl(this, Notification.SET, LLVM_IRPackage.AGGREGATE_INSTRUCTION__OPCODE, oldOpcode, opcode));
    }
  
    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public TypedValue getAggregate()
    {
      return aggregate;
    }
  
    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public NotificationChain basicSetAggregate(TypedValue newAggregate, NotificationChain msgs)
    {
      TypedValue oldAggregate = aggregate;
      aggregate = newAggregate;
      if (eNotificationRequired())
      {
        ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, LLVM_IRPackage.AGGREGATE_INSTRUCTION__AGGREGATE, oldAggregate, newAggregate);
        if (msgs == null) msgs = notification; else msgs.add(notification);
      }
      return msgs;
    }
  
    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setAggregate(TypedValue newAggregate)
    {
      if (newAggregate != aggregate)
      {
        NotificationChain msgs = null;
        if (aggregate != null)
          msgs = ((InternalEObject)aggregate).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - LLVM_IRPackage.AGGREGATE_INSTRUCTION__AGGREGATE, null, msgs);
        if (newAggregate != null)
          msgs = ((InternalEObject)newAggregate).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - LLVM_IRPackage.AGGREGATE_INSTRUCTION__AGGREGATE, null, msgs);
        msgs = basicSetAggregate(newAggregate, msgs);
        if (msgs != null) msgs.dispatch();
      }
      else if (eNotificationRequired())
        eNotify(new ENotificationImpl(this, Notification.SET, LLVM_IRPackage.AGGREGATE_INSTRUCTION__AGGREGATE, newAggregate, newAggregate));
    }
  
    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public EList<Constant> getIndices()
    {
      if (indices == null)
      {
        indices = new EObjectContainmentEList<Constant>(Constant.class, this, LLVM_IRPackage.AGGREGATE_INSTRUCTION__INDICES);
      }
      return indices;
    }
  
    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
    {
      switch (featureID)
      {
        case LLVM_IRPackage.AGGREGATE_INSTRUCTION__AGGREGATE:
          return basicSetAggregate(null, msgs);
        case LLVM_IRPackage.AGGREGATE_INSTRUCTION__INDICES:
          return ((InternalEList<?>)getIndices()).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 LLVM_IRPackage.AGGREGATE_INSTRUCTION__OPCODE:
          return getOpcode();
        case LLVM_IRPackage.AGGREGATE_INSTRUCTION__AGGREGATE:
          return getAggregate();
        case LLVM_IRPackage.AGGREGATE_INSTRUCTION__INDICES:
          return getIndices();
      }
      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.AGGREGATE_INSTRUCTION__OPCODE:
          setOpcode((String)newValue);
          return;
        case LLVM_IRPackage.AGGREGATE_INSTRUCTION__AGGREGATE:
          setAggregate((TypedValue)newValue);
          return;
        case LLVM_IRPackage.AGGREGATE_INSTRUCTION__INDICES:
          getIndices().clear();
          getIndices().addAll((Collection<? extends Constant>)newValue);
          return;
      }
      super.eSet(featureID, newValue);
    }
  
    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public void eUnset(int featureID)
    {
      switch (featureID)
      {
        case LLVM_IRPackage.AGGREGATE_INSTRUCTION__OPCODE:
          setOpcode(OPCODE_EDEFAULT);
          return;
        case LLVM_IRPackage.AGGREGATE_INSTRUCTION__AGGREGATE:
          setAggregate((TypedValue)null);
          return;
        case LLVM_IRPackage.AGGREGATE_INSTRUCTION__INDICES:
          getIndices().clear();
          return;
      }
      super.eUnset(featureID);
    }
  
    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public boolean eIsSet(int featureID)
    {
      switch (featureID)
      {
        case LLVM_IRPackage.AGGREGATE_INSTRUCTION__OPCODE:
          return OPCODE_EDEFAULT == null ? opcode != null : !OPCODE_EDEFAULT.equals(opcode);
        case LLVM_IRPackage.AGGREGATE_INSTRUCTION__AGGREGATE:
          return aggregate != null;
        case LLVM_IRPackage.AGGREGATE_INSTRUCTION__INDICES:
          return indices != null && !indices.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(" (opcode: ");
      result.append(opcode);
      result.append(')');
      return result.toString();
    }
  
  } //AggregateInstructionImpl
  