/**
 * generated by Xtext 2.26.0
 */
package org.xtext.example.mydsl.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.mydsl.myDsl.AtomicTask;
import org.xtext.example.mydsl.myDsl.MyDslPackage;
import org.xtext.example.mydsl.myDsl.Robots2tasksPerformance;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Robots2tasks Performance</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * </p>
 * <ul>
 *   <li>{@link org.xtext.example.mydsl.myDsl.impl.Robots2tasksPerformanceImpl#getAt <em>At</em>}</li>
 *   <li>{@link org.xtext.example.mydsl.myDsl.impl.Robots2tasksPerformanceImpl#getTime <em>Time</em>}</li>
 *   <li>{@link org.xtext.example.mydsl.myDsl.impl.Robots2tasksPerformanceImpl#getProb <em>Prob</em>}</li>
 * </ul>
 *
 * @generated
 */
public class Robots2tasksPerformanceImpl extends MinimalEObjectImpl.Container implements Robots2tasksPerformance
{
  /**
   * The cached value of the '{@link #getAt() <em>At</em>}' reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getAt()
   * @generated
   * @ordered
   */
  protected AtomicTask at;

  /**
   * The default value of the '{@link #getTime() <em>Time</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getTime()
   * @generated
   * @ordered
   */
  protected static final double TIME_EDEFAULT = 0.0;

  /**
   * The cached value of the '{@link #getTime() <em>Time</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getTime()
   * @generated
   * @ordered
   */
  protected double time = TIME_EDEFAULT;

  /**
   * The default value of the '{@link #getProb() <em>Prob</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getProb()
   * @generated
   * @ordered
   */
  protected static final double PROB_EDEFAULT = 0.0;

  /**
   * The cached value of the '{@link #getProb() <em>Prob</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getProb()
   * @generated
   * @ordered
   */
  protected double prob = PROB_EDEFAULT;

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

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

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public AtomicTask getAt()
  {
    if (at != null && at.eIsProxy())
    {
      InternalEObject oldAt = (InternalEObject)at;
      at = (AtomicTask)eResolveProxy(oldAt);
      if (at != oldAt)
      {
        if (eNotificationRequired())
          eNotify(new ENotificationImpl(this, Notification.RESOLVE, MyDslPackage.ROBOTS2TASKS_PERFORMANCE__AT, oldAt, at));
      }
    }
    return at;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public AtomicTask basicGetAt()
  {
    return at;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void setAt(AtomicTask newAt)
  {
    AtomicTask oldAt = at;
    at = newAt;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, MyDslPackage.ROBOTS2TASKS_PERFORMANCE__AT, oldAt, at));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public double getTime()
  {
    return time;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void setTime(double newTime)
  {
    double oldTime = time;
    time = newTime;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, MyDslPackage.ROBOTS2TASKS_PERFORMANCE__TIME, oldTime, time));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public double getProb()
  {
    return prob;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void setProb(double newProb)
  {
    double oldProb = prob;
    prob = newProb;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, MyDslPackage.ROBOTS2TASKS_PERFORMANCE__PROB, oldProb, prob));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case MyDslPackage.ROBOTS2TASKS_PERFORMANCE__AT:
        if (resolve) return getAt();
        return basicGetAt();
      case MyDslPackage.ROBOTS2TASKS_PERFORMANCE__TIME:
        return getTime();
      case MyDslPackage.ROBOTS2TASKS_PERFORMANCE__PROB:
        return getProb();
    }
    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.ROBOTS2TASKS_PERFORMANCE__AT:
        setAt((AtomicTask)newValue);
        return;
      case MyDslPackage.ROBOTS2TASKS_PERFORMANCE__TIME:
        setTime((Double)newValue);
        return;
      case MyDslPackage.ROBOTS2TASKS_PERFORMANCE__PROB:
        setProb((Double)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case MyDslPackage.ROBOTS2TASKS_PERFORMANCE__AT:
        setAt((AtomicTask)null);
        return;
      case MyDslPackage.ROBOTS2TASKS_PERFORMANCE__TIME:
        setTime(TIME_EDEFAULT);
        return;
      case MyDslPackage.ROBOTS2TASKS_PERFORMANCE__PROB:
        setProb(PROB_EDEFAULT);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case MyDslPackage.ROBOTS2TASKS_PERFORMANCE__AT:
        return at != null;
      case MyDslPackage.ROBOTS2TASKS_PERFORMANCE__TIME:
        return time != TIME_EDEFAULT;
      case MyDslPackage.ROBOTS2TASKS_PERFORMANCE__PROB:
        return prob != PROB_EDEFAULT;
    }
    return super.eIsSet(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public String toString()
  {
    if (eIsProxy()) return super.toString();

    StringBuilder result = new StringBuilder(super.toString());
    result.append(" (time: ");
    result.append(time);
    result.append(", prob: ");
    result.append(prob);
    result.append(')');
    return result.toString();
  }

} //Robots2tasksPerformanceImpl
