content: /**
   */
  package com.intel.llvm.ireditor.lLVM_IR.impl;
  
  import com.intel.llvm.ireditor.lLVM_IR.LLVM_IRPackage;
  import com.intel.llvm.ireditor.lLVM_IR.MetadataNode;
  import com.intel.llvm.ireditor.lLVM_IR.NamedMetadata;
  
  import org.eclipse.emf.common.notify.Notification;
  import org.eclipse.emf.common.notify.NotificationChain;
  
  import org.eclipse.emf.ecore.EClass;
  import org.eclipse.emf.ecore.InternalEObject;
  
  import org.eclipse.emf.ecore.impl.ENotificationImpl;
  
  /**
   * <!-- begin-user-doc -->
   * An implementation of the model object '<em><b>Named Metadata</b></em>'.
   * <!-- end-user-doc -->
   * <p>
   * The following features are implemented:
   * <ul>
   *   <li>{@link com.intel.llvm.ireditor.lLVM_IR.impl.NamedMetadataImpl#getName <em>Name</em>}</li>
   *   <li>{@link com.intel.llvm.ireditor.lLVM_IR.impl.NamedMetadataImpl#getNode <em>Node</em>}</li>
   * </ul>
   * </p>
   *
   * @generated
   */
  public class NamedMetadataImpl extends TopLevelElementImpl implements NamedMetadata
  {
    /**
     * The default value of the '{@link #getName() <em>Name</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getName()
     * @generated
     * @ordered
     */
    protected static final String NAME_EDEFAULT = null;
  
    /**
     * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getName()
     * @generated
     * @ordered
     */
    protected String name = NAME_EDEFAULT;
  
    /**
     * The cached value of the '{@link #getNode() <em>Node</em>}' containment reference.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getNode()
     * @generated
     * @ordered
     */
    protected MetadataNode node;
  
    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    protected NamedMetadataImpl()
    {
      super();
    }
  
    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    protected EClass eStaticClass()
    {
      return LLVM_IRPackage.Literals.NAMED_METADATA;
    }
  
    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public String getName()
    {
      return name;
    }
  
    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setName(String newName)
    {
      String oldName = name;
      name = newName;
      if (eNotificationRequired())
        eNotify(new ENotificationImpl(this, Notification.SET, LLVM_IRPackage.NAMED_METADATA__NAME, oldName, name));
    }
  
    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public MetadataNode getNode()
    {
      return node;
    }
  
    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public NotificationChain basicSetNode(MetadataNode newNode, NotificationChain msgs)
    {
      MetadataNode oldNode = node;
      node = newNode;
      if (eNotificationRequired())
      {
        ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, LLVM_IRPackage.NAMED_METADATA__NODE, oldNode, newNode);
        if (msgs == null) msgs = notification; else msgs.add(notification);
      }
      return msgs;
    }
  
    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setNode(MetadataNode newNode)
    {
      if (newNode != node)
      {
        NotificationChain msgs = null;
        if (node != null)
          msgs = ((InternalEObject)node).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - LLVM_IRPackage.NAMED_METADATA__NODE, null, msgs);
        if (newNode != null)
          msgs = ((InternalEObject)newNode).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - LLVM_IRPackage.NAMED_METADATA__NODE, null, msgs);
        msgs = basicSetNode(newNode, msgs);
        if (msgs != null) msgs.dispatch();
      }
      else if (eNotificationRequired())
        eNotify(new ENotificationImpl(this, Notification.SET, LLVM_IRPackage.NAMED_METADATA__NODE, newNode, newNode));
    }
  
    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
    {
      switch (featureID)
      {
        case LLVM_IRPackage.NAMED_METADATA__NODE:
          return basicSetNode(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.NAMED_METADATA__NAME:
          return getName();
        case LLVM_IRPackage.NAMED_METADATA__NODE:
          return getNode();
      }
      return super.eGet(featureID, resolve, coreType);
    }
  
    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public void eSet(int featureID, Object newValue)
    {
      switch (featureID)
      {
        case LLVM_IRPackage.NAMED_METADATA__NAME:
          setName((String)newValue);
          return;
        case LLVM_IRPackage.NAMED_METADATA__NODE:
          setNode((MetadataNode)newValue);
          return;
      }
      super.eSet(featureID, newValue);
    }
  
    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public void eUnset(int featureID)
    {
      switch (featureID)
      {
        case LLVM_IRPackage.NAMED_METADATA__NAME:
          setName(NAME_EDEFAULT);
          return;
        case LLVM_IRPackage.NAMED_METADATA__NODE:
          setNode((MetadataNode)null);
          return;
      }
      super.eUnset(featureID);
    }
  
    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public boolean eIsSet(int featureID)
    {
      switch (featureID)
      {
        case LLVM_IRPackage.NAMED_METADATA__NAME:
          return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
        case LLVM_IRPackage.NAMED_METADATA__NODE:
          return node != null;
      }
      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(" (name: ");
      result.append(name);
      result.append(')');
      return result.toString();
    }
  
  } //NamedMetadataImpl
  