/**
 * <copyright>
 * </copyright>
 *

 */
package org.xtext.example.mydsl3.myDsl.impl;

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

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.xtext.example.mydsl3.myDsl.Belief;
import org.xtext.example.mydsl3.myDsl.Capabilities;
import org.xtext.example.mydsl3.myDsl.Goal;
import org.xtext.example.mydsl3.myDsl.MyDslPackage;
import org.xtext.example.mydsl3.myDsl.Plan;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Capabilities</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.xtext.example.mydsl3.myDsl.impl.CapabilitiesImpl#getName <em>Name</em>}</li>
 *   <li>{@link org.xtext.example.mydsl3.myDsl.impl.CapabilitiesImpl#getDescription <em>Description</em>}</li>
 *   <li>{@link org.xtext.example.mydsl3.myDsl.impl.CapabilitiesImpl#getCap <em>Cap</em>}</li>
 *   <li>{@link org.xtext.example.mydsl3.myDsl.impl.CapabilitiesImpl#getBelief <em>Belief</em>}</li>
 *   <li>{@link org.xtext.example.mydsl3.myDsl.impl.CapabilitiesImpl#getGoal <em>Goal</em>}</li>
 *   <li>{@link org.xtext.example.mydsl3.myDsl.impl.CapabilitiesImpl#getPlan <em>Plan</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class CapabilitiesImpl extends MinimalEObjectImpl.Container implements Capabilities
{
  /**
   * 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 default value of the '{@link #getDescription() <em>Description</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getDescription()
   * @generated
   * @ordered
   */
  protected static final String DESCRİPTİON_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getDescription() <em>Description</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getDescription()
   * @generated
   * @ordered
   */
  protected String description = DESCRİPTİON_EDEFAULT;

  /**
   * The cached value of the '{@link #getCap() <em>Cap</em>}' reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getCap()
   * @generated
   * @ordered
   */
  protected Capabilities cap;

  /**
   * The cached value of the '{@link #getBelief() <em>Belief</em>}' reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getBelief()
   * @generated
   * @ordered
   */
  protected Belief belief;

  /**
   * The cached value of the '{@link #getGoal() <em>Goal</em>}' reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getGoal()
   * @generated
   * @ordered
   */
  protected Goal goal;

  /**
   * The cached value of the '{@link #getPlan() <em>Plan</em>}' reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getPlan()
   * @generated
   * @ordered
   */
  protected Plan plan;

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

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return MyDslPackage.Literals.CAPABİLİTİES;
  }

  /**
   * <!-- 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, MyDslPackage.CAPABİLİTİES__NAME, oldName, name));
  }

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

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setDescription(String newDescription)
  {
    String oldDescription = description;
    description = newDescription;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, MyDslPackage.CAPABİLİTİES__DESCRİPTİON, oldDescription, description));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Capabilities getCap()
  {
    if (cap != null && cap.eIsProxy())
    {
      InternalEObject oldCap = (InternalEObject)cap;
      cap = (Capabilities)eResolveProxy(oldCap);
      if (cap != oldCap)
      {
        if (eNotificationRequired())
          eNotify(new ENotificationImpl(this, Notification.RESOLVE, MyDslPackage.CAPABİLİTİES__CAP, oldCap, cap));
      }
    }
    return cap;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Capabilities basicGetCap()
  {
    return cap;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setCap(Capabilities newCap)
  {
    Capabilities oldCap = cap;
    cap = newCap;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, MyDslPackage.CAPABİLİTİES__CAP, oldCap, cap));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Belief getBelief()
  {
    if (belief != null && belief.eIsProxy())
    {
      InternalEObject oldBelief = (InternalEObject)belief;
      belief = (Belief)eResolveProxy(oldBelief);
      if (belief != oldBelief)
      {
        if (eNotificationRequired())
          eNotify(new ENotificationImpl(this, Notification.RESOLVE, MyDslPackage.CAPABİLİTİES__BELİEF, oldBelief, belief));
      }
    }
    return belief;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Belief basicGetBelief()
  {
    return belief;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setBelief(Belief newBelief)
  {
    Belief oldBelief = belief;
    belief = newBelief;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, MyDslPackage.CAPABİLİTİES__BELİEF, oldBelief, belief));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Goal getGoal()
  {
    if (goal != null && goal.eIsProxy())
    {
      InternalEObject oldGoal = (InternalEObject)goal;
      goal = (Goal)eResolveProxy(oldGoal);
      if (goal != oldGoal)
      {
        if (eNotificationRequired())
          eNotify(new ENotificationImpl(this, Notification.RESOLVE, MyDslPackage.CAPABİLİTİES__GOAL, oldGoal, goal));
      }
    }
    return goal;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Goal basicGetGoal()
  {
    return goal;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setGoal(Goal newGoal)
  {
    Goal oldGoal = goal;
    goal = newGoal;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, MyDslPackage.CAPABİLİTİES__GOAL, oldGoal, goal));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Plan getPlan()
  {
    if (plan != null && plan.eIsProxy())
    {
      InternalEObject oldPlan = (InternalEObject)plan;
      plan = (Plan)eResolveProxy(oldPlan);
      if (plan != oldPlan)
      {
        if (eNotificationRequired())
          eNotify(new ENotificationImpl(this, Notification.RESOLVE, MyDslPackage.CAPABİLİTİES__PLAN, oldPlan, plan));
      }
    }
    return plan;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Plan basicGetPlan()
  {
    return plan;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setPlan(Plan newPlan)
  {
    Plan oldPlan = plan;
    plan = newPlan;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, MyDslPackage.CAPABİLİTİES__PLAN, oldPlan, plan));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case MyDslPackage.CAPABİLİTİES__NAME:
        return getName();
      case MyDslPackage.CAPABİLİTİES__DESCRİPTİON:
        return getDescription();
      case MyDslPackage.CAPABİLİTİES__CAP:
        if (resolve) return getCap();
        return basicGetCap();
      case MyDslPackage.CAPABİLİTİES__BELİEF:
        if (resolve) return getBelief();
        return basicGetBelief();
      case MyDslPackage.CAPABİLİTİES__GOAL:
        if (resolve) return getGoal();
        return basicGetGoal();
      case MyDslPackage.CAPABİLİTİES__PLAN:
        if (resolve) return getPlan();
        return basicGetPlan();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case MyDslPackage.CAPABİLİTİES__NAME:
        setName((String)newValue);
        return;
      case MyDslPackage.CAPABİLİTİES__DESCRİPTİON:
        setDescription((String)newValue);
        return;
      case MyDslPackage.CAPABİLİTİES__CAP:
        setCap((Capabilities)newValue);
        return;
      case MyDslPackage.CAPABİLİTİES__BELİEF:
        setBelief((Belief)newValue);
        return;
      case MyDslPackage.CAPABİLİTİES__GOAL:
        setGoal((Goal)newValue);
        return;
      case MyDslPackage.CAPABİLİTİES__PLAN:
        setPlan((Plan)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case MyDslPackage.CAPABİLİTİES__NAME:
        setName(NAME_EDEFAULT);
        return;
      case MyDslPackage.CAPABİLİTİES__DESCRİPTİON:
        setDescription(DESCRİPTİON_EDEFAULT);
        return;
      case MyDslPackage.CAPABİLİTİES__CAP:
        setCap((Capabilities)null);
        return;
      case MyDslPackage.CAPABİLİTİES__BELİEF:
        setBelief((Belief)null);
        return;
      case MyDslPackage.CAPABİLİTİES__GOAL:
        setGoal((Goal)null);
        return;
      case MyDslPackage.CAPABİLİTİES__PLAN:
        setPlan((Plan)null);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case MyDslPackage.CAPABİLİTİES__NAME:
        return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
      case MyDslPackage.CAPABİLİTİES__DESCRİPTİON:
        return DESCRİPTİON_EDEFAULT == null ? description != null : !DESCRİPTİON_EDEFAULT.equals(description);
      case MyDslPackage.CAPABİLİTİES__CAP:
        return cap != null;
      case MyDslPackage.CAPABİLİTİES__BELİEF:
        return belief != null;
      case MyDslPackage.CAPABİLİTİES__GOAL:
        return goal != null;
      case MyDslPackage.CAPABİLİTİES__PLAN:
        return plan != 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(", description: ");
    result.append(description);
    result.append(')');
    return result.toString();
  }

} //CapabilitiesImpl
