| /** |
| */ |
| package org.eclipse.qvto.examples.xtext.qvtoperationalcs.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.common.notify.NotificationChain; |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.InternalEObject; |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.ocl.xtext.basecs.impl.TypedElementCSImpl; |
| import org.eclipse.ocl.xtext.basecs.util.BaseCSVisitor; |
| import org.eclipse.qvto.examples.xtext.qvtoperationalcs.DirectionKindCS; |
| import org.eclipse.qvto.examples.xtext.qvtoperationalcs.InitPartCS; |
| import org.eclipse.qvto.examples.xtext.qvtoperationalcs.ParameterDeclarationCS; |
| import org.eclipse.qvto.examples.xtext.qvtoperationalcs.QVTOperationalCSPackage; |
| import org.eclipse.qvto.examples.xtext.qvtoperationalcs.util.QVTOperationalCSVisitor; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Parameter Declaration CS</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.qvto.examples.xtext.qvtoperationalcs.impl.ParameterDeclarationCSImpl#getDirection <em>Direction</em>}</li> |
| * <li>{@link org.eclipse.qvto.examples.xtext.qvtoperationalcs.impl.ParameterDeclarationCSImpl#getInitPart <em>Init Part</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class ParameterDeclarationCSImpl extends TypedElementCSImpl implements ParameterDeclarationCS { |
| /** |
| * The default value of the '{@link #getDirection() <em>Direction</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDirection() |
| * @generated |
| * @ordered |
| */ |
| protected static final DirectionKindCS DIRECTION_EDEFAULT = DirectionKindCS.IN; |
| |
| /** |
| * The cached value of the '{@link #getDirection() <em>Direction</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDirection() |
| * @generated |
| * @ordered |
| */ |
| protected DirectionKindCS direction = DIRECTION_EDEFAULT; |
| |
| /** |
| * This is true if the Direction attribute has been set. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| * @ordered |
| */ |
| protected boolean directionESet; |
| |
| /** |
| * The cached value of the '{@link #getInitPart() <em>Init Part</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getInitPart() |
| * @generated |
| * @ordered |
| */ |
| protected InitPartCS initPart; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected ParameterDeclarationCSImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return QVTOperationalCSPackage.Literals.PARAMETER_DECLARATION_CS; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public DirectionKindCS getDirection() { |
| return direction; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setDirection(DirectionKindCS newDirection) { |
| DirectionKindCS oldDirection = direction; |
| direction = newDirection == null ? DIRECTION_EDEFAULT : newDirection; |
| boolean oldDirectionESet = directionESet; |
| directionESet = true; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, QVTOperationalCSPackage.PARAMETER_DECLARATION_CS__DIRECTION, oldDirection, direction, !oldDirectionESet)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void unsetDirection() { |
| DirectionKindCS oldDirection = direction; |
| boolean oldDirectionESet = directionESet; |
| direction = DIRECTION_EDEFAULT; |
| directionESet = false; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.UNSET, QVTOperationalCSPackage.PARAMETER_DECLARATION_CS__DIRECTION, oldDirection, DIRECTION_EDEFAULT, oldDirectionESet)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean isSetDirection() { |
| return directionESet; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public InitPartCS getInitPart() { |
| return initPart; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetInitPart(InitPartCS newInitPart, NotificationChain msgs) { |
| InitPartCS oldInitPart = initPart; |
| initPart = newInitPart; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, QVTOperationalCSPackage.PARAMETER_DECLARATION_CS__INIT_PART, oldInitPart, newInitPart); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setInitPart(InitPartCS newInitPart) { |
| if (newInitPart != initPart) { |
| NotificationChain msgs = null; |
| if (initPart != null) |
| msgs = ((InternalEObject)initPart).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - QVTOperationalCSPackage.PARAMETER_DECLARATION_CS__INIT_PART, null, msgs); |
| if (newInitPart != null) |
| msgs = ((InternalEObject)newInitPart).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - QVTOperationalCSPackage.PARAMETER_DECLARATION_CS__INIT_PART, null, msgs); |
| msgs = basicSetInitPart(newInitPart, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, QVTOperationalCSPackage.PARAMETER_DECLARATION_CS__INIT_PART, newInitPart, newInitPart)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String toString() { |
| return super.toString(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case QVTOperationalCSPackage.PARAMETER_DECLARATION_CS__INIT_PART: |
| return basicSetInitPart(null, msgs); |
| } |
| return super.eInverseRemove(otherEnd, featureID, msgs); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case QVTOperationalCSPackage.PARAMETER_DECLARATION_CS__DIRECTION: |
| return getDirection(); |
| case QVTOperationalCSPackage.PARAMETER_DECLARATION_CS__INIT_PART: |
| return getInitPart(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case QVTOperationalCSPackage.PARAMETER_DECLARATION_CS__DIRECTION: |
| setDirection((DirectionKindCS)newValue); |
| return; |
| case QVTOperationalCSPackage.PARAMETER_DECLARATION_CS__INIT_PART: |
| setInitPart((InitPartCS)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case QVTOperationalCSPackage.PARAMETER_DECLARATION_CS__DIRECTION: |
| unsetDirection(); |
| return; |
| case QVTOperationalCSPackage.PARAMETER_DECLARATION_CS__INIT_PART: |
| setInitPart((InitPartCS)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case QVTOperationalCSPackage.PARAMETER_DECLARATION_CS__DIRECTION: |
| return isSetDirection(); |
| case QVTOperationalCSPackage.PARAMETER_DECLARATION_CS__INIT_PART: |
| return initPart != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * {@inheritDoc} |
| * @generated |
| */ |
| @SuppressWarnings("unchecked") |
| @Override |
| public <R> R accept(BaseCSVisitor<R> visitor) { |
| return (R) ((QVTOperationalCSVisitor<?>)visitor).visitParameterDeclarationCS(this); |
| } |
| |
| } //ParameterDeclarationCSImpl |