/**
 */
package org.xtext.example.mydsl6.myDsl6.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.xtext.example.mydsl6.myDsl6.Field;
import org.xtext.example.mydsl6.myDsl6.LookUp;
import org.xtext.example.mydsl6.myDsl6.MyDsl6Package;
import org.xtext.example.mydsl6.myDsl6.Type;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Look Up</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.xtext.example.mydsl6.myDsl6.impl.LookUpImpl#getType <em>Type</em>}</li>
 *   <li>{@link org.xtext.example.mydsl6.myDsl6.impl.LookUpImpl#getShowField <em>Show Field</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class LookUpImpl extends FieldImpl implements LookUp
{
  /**
   * The cached value of the '{@link #getType() <em>Type</em>}' reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getType()
   * @generated
   * @ordered
   */
  protected Type type;

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

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

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

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Type getType()
  {
    if (type != null && type.eIsProxy())
    {
      InternalEObject oldType = (InternalEObject)type;
      type = (Type)eResolveProxy(oldType);
      if (type != oldType)
      {
        if (eNotificationRequired())
          eNotify(new ENotificationImpl(this, Notification.RESOLVE, MyDsl6Package.LOOK_UP__TYPE, oldType, type));
      }
    }
    return type;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Type basicGetType()
  {
    return type;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setType(Type newType)
  {
    Type oldType = type;
    type = newType;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, MyDsl6Package.LOOK_UP__TYPE, oldType, type));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Field getShowField()
  {
    if (showField != null && showField.eIsProxy())
    {
      InternalEObject oldShowField = (InternalEObject)showField;
      showField = (Field)eResolveProxy(oldShowField);
      if (showField != oldShowField)
      {
        if (eNotificationRequired())
          eNotify(new ENotificationImpl(this, Notification.RESOLVE, MyDsl6Package.LOOK_UP__SHOW_FIELD, oldShowField, showField));
      }
    }
    return showField;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Field basicGetShowField()
  {
    return showField;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setShowField(Field newShowField)
  {
    Field oldShowField = showField;
    showField = newShowField;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, MyDsl6Package.LOOK_UP__SHOW_FIELD, oldShowField, showField));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case MyDsl6Package.LOOK_UP__TYPE:
        if (resolve) return getType();
        return basicGetType();
      case MyDsl6Package.LOOK_UP__SHOW_FIELD:
        if (resolve) return getShowField();
        return basicGetShowField();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case MyDsl6Package.LOOK_UP__TYPE:
        setType((Type)newValue);
        return;
      case MyDsl6Package.LOOK_UP__SHOW_FIELD:
        setShowField((Field)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case MyDsl6Package.LOOK_UP__TYPE:
        setType((Type)null);
        return;
      case MyDsl6Package.LOOK_UP__SHOW_FIELD:
        setShowField((Field)null);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case MyDsl6Package.LOOK_UP__TYPE:
        return type != null;
      case MyDsl6Package.LOOK_UP__SHOW_FIELD:
        return showField != null;
    }
    return super.eIsSet(featureID);
  }

} //LookUpImpl
