| /** |
| * <copyright> |
| * |
| * Copyright (c) 2013, 2018 Willink Transformations and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v2.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v20.html |
| * |
| * Contributors: |
| * E.D.Willink - Initial API and implementation |
| * |
| * </copyright> |
| */ |
| package org.eclipse.qvtd.xtext.qvtimperativecs.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.jdt.annotation.NonNull; |
| import org.eclipse.ocl.xtext.basecs.util.BaseCSVisitor; |
| import org.eclipse.ocl.xtext.essentialoclcs.impl.ExpCSImpl; |
| import org.eclipse.qvtd.pivot.qvtimperative.GuardParameter; |
| import org.eclipse.qvtd.pivot.qvtimperative.LoopVariable; |
| import org.eclipse.qvtd.xtext.qvtimperativecs.LoopParameterBindingCS; |
| import org.eclipse.qvtd.xtext.qvtimperativecs.QVTimperativeCSPackage; |
| import org.eclipse.qvtd.xtext.qvtimperativecs.util.QVTimperativeCSVisitor; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Loop Parameter Binding CS</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.qvtd.xtext.qvtimperativecs.impl.LoopParameterBindingCSImpl#getValue <em>Value</em>}</li> |
| * <li>{@link org.eclipse.qvtd.xtext.qvtimperativecs.impl.LoopParameterBindingCSImpl#getReferredVariable <em>Referred Variable</em>}</li> |
| * <li>{@link org.eclipse.qvtd.xtext.qvtimperativecs.impl.LoopParameterBindingCSImpl#isIsCheck <em>Is Check</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class LoopParameterBindingCSImpl extends MappingParameterBindingCSImpl implements LoopParameterBindingCS { |
| /** |
| * The number of structural features of the '<em>Loop Parameter Binding CS</em>' class. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| * @ordered |
| */ |
| public static final int LOOP_PARAMETER_BINDING_CS_FEATURE_COUNT = MappingParameterBindingCSImpl.MAPPING_PARAMETER_BINDING_CS_FEATURE_COUNT + 3; |
| |
| /** |
| * The cached value of the '{@link #getValue() <em>Value</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getValue() |
| * @generated |
| * @ordered |
| */ |
| protected LoopVariable value; |
| |
| /** |
| * The cached value of the '{@link #getReferredVariable() <em>Referred Variable</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getReferredVariable() |
| * @generated |
| * @ordered |
| */ |
| protected GuardParameter referredVariable; |
| |
| /** |
| * The default value of the '{@link #isIsCheck() <em>Is Check</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isIsCheck() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean IS_CHECK_EDEFAULT = false; |
| |
| /** |
| * The cached value of the '{@link #isIsCheck() <em>Is Check</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isIsCheck() |
| * @generated |
| * @ordered |
| */ |
| protected boolean isCheck = IS_CHECK_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected LoopParameterBindingCSImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return QVTimperativeCSPackage.Literals.LOOP_PARAMETER_BINDING_CS; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public LoopVariable getValue() { |
| if (value != null && value.eIsProxy()) { |
| InternalEObject oldValue = (InternalEObject)value; |
| value = (LoopVariable)eResolveProxy(oldValue); |
| if (value != oldValue) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, ExpCSImpl.EXP_CS_FEATURE_COUNT + 1, oldValue, value)); |
| } |
| } |
| return value; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public LoopVariable basicGetValue() { |
| return value; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setValue(LoopVariable newValue) { |
| LoopVariable oldValue = value; |
| value = newValue; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ExpCSImpl.EXP_CS_FEATURE_COUNT + 1, oldValue, value)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public GuardParameter getReferredVariable() { |
| if (referredVariable != null && referredVariable.eIsProxy()) { |
| InternalEObject oldReferredVariable = (InternalEObject)referredVariable; |
| referredVariable = (GuardParameter)eResolveProxy(oldReferredVariable); |
| if (referredVariable != oldReferredVariable) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, ExpCSImpl.EXP_CS_FEATURE_COUNT + 2, oldReferredVariable, referredVariable)); |
| } |
| } |
| return referredVariable; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public GuardParameter basicGetReferredVariable() { |
| return referredVariable; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setReferredVariable(GuardParameter newReferredVariable) { |
| GuardParameter oldReferredVariable = referredVariable; |
| referredVariable = newReferredVariable; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ExpCSImpl.EXP_CS_FEATURE_COUNT + 2, oldReferredVariable, referredVariable)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean isIsCheck() { |
| return isCheck; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setIsCheck(boolean newIsCheck) { |
| boolean oldIsCheck = isCheck; |
| isCheck = newIsCheck; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ExpCSImpl.EXP_CS_FEATURE_COUNT + 3, oldIsCheck, isCheck)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated NOT |
| */ |
| @Override |
| public String toString() { |
| return super.toString(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case ExpCSImpl.EXP_CS_FEATURE_COUNT + 1: |
| if (resolve) return getValue(); |
| return basicGetValue(); |
| case ExpCSImpl.EXP_CS_FEATURE_COUNT + 2: |
| if (resolve) return getReferredVariable(); |
| return basicGetReferredVariable(); |
| case ExpCSImpl.EXP_CS_FEATURE_COUNT + 3: |
| return isIsCheck(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case ExpCSImpl.EXP_CS_FEATURE_COUNT + 1: |
| setValue((LoopVariable)newValue); |
| return; |
| case ExpCSImpl.EXP_CS_FEATURE_COUNT + 2: |
| setReferredVariable((GuardParameter)newValue); |
| return; |
| case ExpCSImpl.EXP_CS_FEATURE_COUNT + 3: |
| setIsCheck((Boolean)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case ExpCSImpl.EXP_CS_FEATURE_COUNT + 1: |
| setValue((LoopVariable)null); |
| return; |
| case ExpCSImpl.EXP_CS_FEATURE_COUNT + 2: |
| setReferredVariable((GuardParameter)null); |
| return; |
| case ExpCSImpl.EXP_CS_FEATURE_COUNT + 3: |
| setIsCheck(IS_CHECK_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case ExpCSImpl.EXP_CS_FEATURE_COUNT + 1: |
| return value != null; |
| case ExpCSImpl.EXP_CS_FEATURE_COUNT + 2: |
| return referredVariable != null; |
| case ExpCSImpl.EXP_CS_FEATURE_COUNT + 3: |
| return isCheck != IS_CHECK_EDEFAULT; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * {@inheritDoc} |
| * @generated |
| */ |
| @SuppressWarnings("unchecked") |
| @Override |
| public <R> R accept(@NonNull BaseCSVisitor<R> visitor) { |
| return (R) ((QVTimperativeCSVisitor<?>)visitor).visitLoopParameterBindingCS(this); |
| } |
| |
| } //LoopParameterBindingCSImpl |