blob: 0511222ca40c503208bd4f314d7e99ae7d27416b [file] [log] [blame]
/**
* Copyright (c) 2015 CEA LIST.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - Initial API and implementation
*
*/
package org.eclipse.papyrus.sysml14.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.sysml14.activities.ActivitiesPackage;
import org.eclipse.papyrus.sysml14.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:
* </p>
* <ul>
* <li>{@link org.eclipse.papyrus.sysml14.activities.internal.impl.ControlOperatorImpl#getBase_Behavior <em>Base Behavior</em>}</li>
* <li>{@link org.eclipse.papyrus.sysml14.activities.internal.impl.ControlOperatorImpl#getBase_Operation <em>Base Operation</em>}</li>
* </ul>
*
* @generated
*/
public class ControlOperatorImpl extends MinimalEObjectImpl.Container implements ControlOperator {
/**
* 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;
/**
* 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;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ControlOperatorImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return ActivitiesPackage.Literals.CONTROL_OPERATOR;
}
/**
* <!-- 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 Behavior basicGetBase_Behavior() {
return base_Behavior;
}
/**
* <!-- 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 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 Operation basicGetBase_Operation() {
return base_Operation;
}
/**
* <!-- 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));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case ActivitiesPackage.CONTROL_OPERATOR__BASE_BEHAVIOR:
if (resolve) return getBase_Behavior();
return basicGetBase_Behavior();
case ActivitiesPackage.CONTROL_OPERATOR__BASE_OPERATION:
if (resolve) return getBase_Operation();
return basicGetBase_Operation();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case ActivitiesPackage.CONTROL_OPERATOR__BASE_BEHAVIOR:
setBase_Behavior((Behavior)newValue);
return;
case ActivitiesPackage.CONTROL_OPERATOR__BASE_OPERATION:
setBase_Operation((Operation)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ActivitiesPackage.CONTROL_OPERATOR__BASE_BEHAVIOR:
setBase_Behavior((Behavior)null);
return;
case ActivitiesPackage.CONTROL_OPERATOR__BASE_OPERATION:
setBase_Operation((Operation)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ActivitiesPackage.CONTROL_OPERATOR__BASE_BEHAVIOR:
return base_Behavior != null;
case ActivitiesPackage.CONTROL_OPERATOR__BASE_OPERATION:
return base_Operation != null;
}
return super.eIsSet(featureID);
}
} //ControlOperatorImpl