Package org.eclipse.papyrus.sysml.activities.internal.impl

Source Code of org.eclipse.papyrus.sysml.activities.internal.impl.ControlOperatorImpl

/*****************************************************************************
* Copyright (c) 2009 CEA LIST.
*
*   
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
*  Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
*
*****************************************************************************/
package org.eclipse.papyrus.sysml.activities.internal.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.eclipse.papyrus.sysml.activities.ActivitiesPackage;
import org.eclipse.papyrus.sysml.activities.ControlOperator;
import org.eclipse.uml2.uml.Behavior;
import org.eclipse.uml2.uml.Operation;

/**
* <!-- begin-user-doc --> An implementation of the model object ' <em><b>Control Operator</b></em>'. <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.papyrus.sysml.activities.internal.impl.ControlOperatorImpl#getBase_Operation <em>Base Operation</em>}</li>
* <li>{@link org.eclipse.papyrus.sysml.activities.internal.impl.ControlOperatorImpl#getBase_Behavior <em>Base Behavior</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class ControlOperatorImpl extends MinimalEObjectImpl.Container implements ControlOperator {

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

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

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

  /**
   * <!-- begin-user-doc --> <!-- end-user-doc -->
   *
   * @generated
   */
  public Behavior basicGetBase_Behavior() {
    return base_Behavior;
  }

  /**
   * <!-- begin-user-doc --> <!-- end-user-doc -->
   *
   * @generated
   */
  public Operation basicGetBase_Operation() {
    return base_Operation;
  }

  /**
   * <!-- begin-user-doc --> <!-- end-user-doc -->
   *
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType) {
    switch(featureID) {
    case ActivitiesPackage.CONTROL_OPERATOR__BASE_OPERATION:
      if(resolve)
        return getBase_Operation();
      return basicGetBase_Operation();
    case ActivitiesPackage.CONTROL_OPERATOR__BASE_BEHAVIOR:
      if(resolve)
        return getBase_Behavior();
      return basicGetBase_Behavior();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc --> <!-- end-user-doc -->
   *
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID) {
    switch(featureID) {
    case ActivitiesPackage.CONTROL_OPERATOR__BASE_OPERATION:
      return base_Operation != null;
    case ActivitiesPackage.CONTROL_OPERATOR__BASE_BEHAVIOR:
      return base_Behavior != null;
    }
    return super.eIsSet(featureID);
  }

  /**
   * <!-- begin-user-doc --> <!-- end-user-doc -->
   *
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue) {
    switch(featureID) {
    case ActivitiesPackage.CONTROL_OPERATOR__BASE_OPERATION:
      setBase_Operation((Operation)newValue);
      return;
    case ActivitiesPackage.CONTROL_OPERATOR__BASE_BEHAVIOR:
      setBase_Behavior((Behavior)newValue);
      return;
    }
    super.eSet(featureID, newValue);
  }

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

  /**
   * <!-- begin-user-doc --> <!-- end-user-doc -->
   *
   * @generated
   */
  @Override
  public void eUnset(int featureID) {
    switch(featureID) {
    case ActivitiesPackage.CONTROL_OPERATOR__BASE_OPERATION:
      setBase_Operation((Operation)null);
      return;
    case ActivitiesPackage.CONTROL_OPERATOR__BASE_BEHAVIOR:
      setBase_Behavior((Behavior)null);
      return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc --> <!-- end-user-doc -->
   *
   * @generated
   */
  public Behavior getBase_Behavior() {
    if(base_Behavior != null && base_Behavior.eIsProxy()) {
      InternalEObject oldBase_Behavior = (InternalEObject)base_Behavior;
      base_Behavior = (Behavior)eResolveProxy(oldBase_Behavior);
      if(base_Behavior != oldBase_Behavior) {
        if(eNotificationRequired())
          eNotify(new ENotificationImpl(this, Notification.RESOLVE, ActivitiesPackage.CONTROL_OPERATOR__BASE_BEHAVIOR, oldBase_Behavior, base_Behavior));
      }
    }
    return base_Behavior;
  }

  /**
   * <!-- begin-user-doc --> <!-- end-user-doc -->
   *
   * @generated
   */
  public Operation getBase_Operation() {
    if(base_Operation != null && base_Operation.eIsProxy()) {
      InternalEObject oldBase_Operation = (InternalEObject)base_Operation;
      base_Operation = (Operation)eResolveProxy(oldBase_Operation);
      if(base_Operation != oldBase_Operation) {
        if(eNotificationRequired())
          eNotify(new ENotificationImpl(this, Notification.RESOLVE, ActivitiesPackage.CONTROL_OPERATOR__BASE_OPERATION, oldBase_Operation, base_Operation));
      }
    }
    return base_Operation;
  }

  /**
   * <!-- begin-user-doc --> <!-- end-user-doc -->
   *
   * @generated
   */
  public void setBase_Behavior(Behavior newBase_Behavior) {
    Behavior oldBase_Behavior = base_Behavior;
    base_Behavior = newBase_Behavior;
    if(eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ActivitiesPackage.CONTROL_OPERATOR__BASE_BEHAVIOR, oldBase_Behavior, base_Behavior));
  }

  /**
   * <!-- begin-user-doc --> <!-- end-user-doc -->
   *
   * @generated
   */
  public void setBase_Operation(Operation newBase_Operation) {
    Operation oldBase_Operation = base_Operation;
    base_Operation = newBase_Operation;
    if(eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ActivitiesPackage.CONTROL_OPERATOR__BASE_OPERATION, oldBase_Operation, base_Operation));
  }

} // ControlOperatorImpl
TOP

Related Classes of org.eclipse.papyrus.sysml.activities.internal.impl.ControlOperatorImpl

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.