/**
 * <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.AgentState;
import org.xtext.example.mydsl3.myDsl.AgentType;
import org.xtext.example.mydsl3.myDsl.Capabilities;
import org.xtext.example.mydsl3.myDsl.MyDslPackage;
import org.xtext.example.mydsl3.myDsl.Role;
import org.xtext.example.mydsl3.myDsl.SemanticWebAgent;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Semantic Web Agent</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.xtext.example.mydsl3.myDsl.impl.SemanticWebAgentImpl#getName <em>Name</em>}</li>
 *   <li>{@link org.xtext.example.mydsl3.myDsl.impl.SemanticWebAgentImpl#getDescription <em>Description</em>}</li>
 *   <li>{@link org.xtext.example.mydsl3.myDsl.impl.SemanticWebAgentImpl#getProperties <em>Properties</em>}</li>
 *   <li>{@link org.xtext.example.mydsl3.myDsl.impl.SemanticWebAgentImpl#getSemanticwebagent <em>Semanticwebagent</em>}</li>
 *   <li>{@link org.xtext.example.mydsl3.myDsl.impl.SemanticWebAgentImpl#getAgentstate <em>Agentstate</em>}</li>
 *   <li>{@link org.xtext.example.mydsl3.myDsl.impl.SemanticWebAgentImpl#getCap <em>Cap</em>}</li>
 *   <li>{@link org.xtext.example.mydsl3.myDsl.impl.SemanticWebAgentImpl#getAgenttype <em>Agenttype</em>}</li>
 *   <li>{@link org.xtext.example.mydsl3.myDsl.impl.SemanticWebAgentImpl#getRole <em>Role</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class SemanticWebAgentImpl extends MinimalEObjectImpl.Container implements SemanticWebAgent
{
  /**
   * 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 default value of the '{@link #getProperties() <em>Properties</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getProperties()
   * @generated
   * @ordered
   */
  protected static final String PROPERTİES_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getProperties() <em>Properties</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getProperties()
   * @generated
   * @ordered
   */
  protected String properties = PROPERTİES_EDEFAULT;

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

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

  /**
   * 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 #getAgenttype() <em>Agenttype</em>}' reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getAgenttype()
   * @generated
   * @ordered
   */
  protected AgentType agenttype;

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

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

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

  /**
   * <!-- 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.SEMANTİC_WEB_AGENT__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.SEMANTİC_WEB_AGENT__DESCRİPTİON, oldDescription, description));
  }

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

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setProperties(String newProperties)
  {
    String oldProperties = properties;
    properties = newProperties;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, MyDslPackage.SEMANTİC_WEB_AGENT__PROPERTİES, oldProperties, properties));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public SemanticWebAgent getSemanticwebagent()
  {
    if (semanticwebagent != null && semanticwebagent.eIsProxy())
    {
      InternalEObject oldSemanticwebagent = (InternalEObject)semanticwebagent;
      semanticwebagent = (SemanticWebAgent)eResolveProxy(oldSemanticwebagent);
      if (semanticwebagent != oldSemanticwebagent)
      {
        if (eNotificationRequired())
          eNotify(new ENotificationImpl(this, Notification.RESOLVE, MyDslPackage.SEMANTİC_WEB_AGENT__SEMANTİCWEBAGENT, oldSemanticwebagent, semanticwebagent));
      }
    }
    return semanticwebagent;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public SemanticWebAgent basicGetSemanticwebagent()
  {
    return semanticwebagent;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setSemanticwebagent(SemanticWebAgent newSemanticwebagent)
  {
    SemanticWebAgent oldSemanticwebagent = semanticwebagent;
    semanticwebagent = newSemanticwebagent;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, MyDslPackage.SEMANTİC_WEB_AGENT__SEMANTİCWEBAGENT, oldSemanticwebagent, semanticwebagent));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public AgentState getAgentstate()
  {
    if (agentstate != null && agentstate.eIsProxy())
    {
      InternalEObject oldAgentstate = (InternalEObject)agentstate;
      agentstate = (AgentState)eResolveProxy(oldAgentstate);
      if (agentstate != oldAgentstate)
      {
        if (eNotificationRequired())
          eNotify(new ENotificationImpl(this, Notification.RESOLVE, MyDslPackage.SEMANTİC_WEB_AGENT__AGENTSTATE, oldAgentstate, agentstate));
      }
    }
    return agentstate;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public AgentState basicGetAgentstate()
  {
    return agentstate;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setAgentstate(AgentState newAgentstate)
  {
    AgentState oldAgentstate = agentstate;
    agentstate = newAgentstate;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, MyDslPackage.SEMANTİC_WEB_AGENT__AGENTSTATE, oldAgentstate, agentstate));
  }

  /**
   * <!-- 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.SEMANTİC_WEB_AGENT__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.SEMANTİC_WEB_AGENT__CAP, oldCap, cap));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public AgentType getAgenttype()
  {
    if (agenttype != null && agenttype.eIsProxy())
    {
      InternalEObject oldAgenttype = (InternalEObject)agenttype;
      agenttype = (AgentType)eResolveProxy(oldAgenttype);
      if (agenttype != oldAgenttype)
      {
        if (eNotificationRequired())
          eNotify(new ENotificationImpl(this, Notification.RESOLVE, MyDslPackage.SEMANTİC_WEB_AGENT__AGENTTYPE, oldAgenttype, agenttype));
      }
    }
    return agenttype;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public AgentType basicGetAgenttype()
  {
    return agenttype;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setAgenttype(AgentType newAgenttype)
  {
    AgentType oldAgenttype = agenttype;
    agenttype = newAgenttype;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, MyDslPackage.SEMANTİC_WEB_AGENT__AGENTTYPE, oldAgenttype, agenttype));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Role getRole()
  {
    if (role != null && role.eIsProxy())
    {
      InternalEObject oldRole = (InternalEObject)role;
      role = (Role)eResolveProxy(oldRole);
      if (role != oldRole)
      {
        if (eNotificationRequired())
          eNotify(new ENotificationImpl(this, Notification.RESOLVE, MyDslPackage.SEMANTİC_WEB_AGENT__ROLE, oldRole, role));
      }
    }
    return role;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Role basicGetRole()
  {
    return role;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setRole(Role newRole)
  {
    Role oldRole = role;
    role = newRole;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, MyDslPackage.SEMANTİC_WEB_AGENT__ROLE, oldRole, role));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case MyDslPackage.SEMANTİC_WEB_AGENT__NAME:
        return getName();
      case MyDslPackage.SEMANTİC_WEB_AGENT__DESCRİPTİON:
        return getDescription();
      case MyDslPackage.SEMANTİC_WEB_AGENT__PROPERTİES:
        return getProperties();
      case MyDslPackage.SEMANTİC_WEB_AGENT__SEMANTİCWEBAGENT:
        if (resolve) return getSemanticwebagent();
        return basicGetSemanticwebagent();
      case MyDslPackage.SEMANTİC_WEB_AGENT__AGENTSTATE:
        if (resolve) return getAgentstate();
        return basicGetAgentstate();
      case MyDslPackage.SEMANTİC_WEB_AGENT__CAP:
        if (resolve) return getCap();
        return basicGetCap();
      case MyDslPackage.SEMANTİC_WEB_AGENT__AGENTTYPE:
        if (resolve) return getAgenttype();
        return basicGetAgenttype();
      case MyDslPackage.SEMANTİC_WEB_AGENT__ROLE:
        if (resolve) return getRole();
        return basicGetRole();
    }
    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.SEMANTİC_WEB_AGENT__NAME:
        setName((String)newValue);
        return;
      case MyDslPackage.SEMANTİC_WEB_AGENT__DESCRİPTİON:
        setDescription((String)newValue);
        return;
      case MyDslPackage.SEMANTİC_WEB_AGENT__PROPERTİES:
        setProperties((String)newValue);
        return;
      case MyDslPackage.SEMANTİC_WEB_AGENT__SEMANTİCWEBAGENT:
        setSemanticwebagent((SemanticWebAgent)newValue);
        return;
      case MyDslPackage.SEMANTİC_WEB_AGENT__AGENTSTATE:
        setAgentstate((AgentState)newValue);
        return;
      case MyDslPackage.SEMANTİC_WEB_AGENT__CAP:
        setCap((Capabilities)newValue);
        return;
      case MyDslPackage.SEMANTİC_WEB_AGENT__AGENTTYPE:
        setAgenttype((AgentType)newValue);
        return;
      case MyDslPackage.SEMANTİC_WEB_AGENT__ROLE:
        setRole((Role)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case MyDslPackage.SEMANTİC_WEB_AGENT__NAME:
        setName(NAME_EDEFAULT);
        return;
      case MyDslPackage.SEMANTİC_WEB_AGENT__DESCRİPTİON:
        setDescription(DESCRİPTİON_EDEFAULT);
        return;
      case MyDslPackage.SEMANTİC_WEB_AGENT__PROPERTİES:
        setProperties(PROPERTİES_EDEFAULT);
        return;
      case MyDslPackage.SEMANTİC_WEB_AGENT__SEMANTİCWEBAGENT:
        setSemanticwebagent((SemanticWebAgent)null);
        return;
      case MyDslPackage.SEMANTİC_WEB_AGENT__AGENTSTATE:
        setAgentstate((AgentState)null);
        return;
      case MyDslPackage.SEMANTİC_WEB_AGENT__CAP:
        setCap((Capabilities)null);
        return;
      case MyDslPackage.SEMANTİC_WEB_AGENT__AGENTTYPE:
        setAgenttype((AgentType)null);
        return;
      case MyDslPackage.SEMANTİC_WEB_AGENT__ROLE:
        setRole((Role)null);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case MyDslPackage.SEMANTİC_WEB_AGENT__NAME:
        return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
      case MyDslPackage.SEMANTİC_WEB_AGENT__DESCRİPTİON:
        return DESCRİPTİON_EDEFAULT == null ? description != null : !DESCRİPTİON_EDEFAULT.equals(description);
      case MyDslPackage.SEMANTİC_WEB_AGENT__PROPERTİES:
        return PROPERTİES_EDEFAULT == null ? properties != null : !PROPERTİES_EDEFAULT.equals(properties);
      case MyDslPackage.SEMANTİC_WEB_AGENT__SEMANTİCWEBAGENT:
        return semanticwebagent != null;
      case MyDslPackage.SEMANTİC_WEB_AGENT__AGENTSTATE:
        return agentstate != null;
      case MyDslPackage.SEMANTİC_WEB_AGENT__CAP:
        return cap != null;
      case MyDslPackage.SEMANTİC_WEB_AGENT__AGENTTYPE:
        return agenttype != null;
      case MyDslPackage.SEMANTİC_WEB_AGENT__ROLE:
        return role != 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(", properties: ");
    result.append(properties);
    result.append(')');
    return result.toString();
  }

} //SemanticWebAgentImpl
