| /******************************************************************************* |
| * Copyright (c) 2013, 2015 Willink Transformations and others. |
| * 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: |
| * E.D.Willink - Initial API and implementation |
| *******************************************************************************/ |
| package org.eclipse.qvtd.codegen.qvticgmodel.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.jdt.annotation.NonNull; |
| import org.eclipse.jdt.annotation.Nullable; |
| import org.eclipse.ocl.examples.codegen.cgmodel.CGExecutorType; |
| import org.eclipse.ocl.examples.codegen.cgmodel.impl.CGVariableImpl; |
| import org.eclipse.ocl.examples.codegen.cgmodel.util.CGModelVisitor; |
| import org.eclipse.qvtd.codegen.qvticgmodel.CGRealizedVariable; |
| import org.eclipse.qvtd.codegen.qvticgmodel.CGTypedModel; |
| import org.eclipse.qvtd.codegen.qvticgmodel.QVTiCGModelPackage; |
| import org.eclipse.qvtd.codegen.qvticgmodel.util.QVTiCGModelVisitor; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>CG Realized Variable</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.qvtd.codegen.qvticgmodel.impl.CGRealizedVariableImpl#getExecutorType <em>Executor Type</em>}</li> |
| * <li>{@link org.eclipse.qvtd.codegen.qvticgmodel.impl.CGRealizedVariableImpl#getTypedModel <em>Typed Model</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class CGRealizedVariableImpl extends CGVariableImpl implements CGRealizedVariable { |
| /** |
| * The cached value of the '{@link #getExecutorType() <em>Executor Type</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getExecutorType() |
| * @generated |
| * @ordered |
| */ |
| protected CGExecutorType executorType; |
| |
| /** |
| * The cached value of the '{@link #getTypedModel() <em>Typed Model</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getTypedModel() |
| * @generated |
| * @ordered |
| */ |
| protected CGTypedModel typedModel; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected CGRealizedVariableImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return QVTiCGModelPackage.Literals.CG_REALIZED_VARIABLE; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public CGTypedModel getTypedModel() { |
| return typedModel; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setTypedModel(CGTypedModel newTypedModel) { |
| CGTypedModel oldTypedModel = typedModel; |
| typedModel = newTypedModel; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, QVTiCGModelPackage.CG_REALIZED_VARIABLE__TYPED_MODEL, oldTypedModel, typedModel)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public CGExecutorType getExecutorType() { |
| return executorType; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setExecutorType(CGExecutorType newExecutorType) { |
| CGExecutorType oldExecutorType = executorType; |
| executorType = newExecutorType; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, QVTiCGModelPackage.CG_REALIZED_VARIABLE__EXECUTOR_TYPE, oldExecutorType, executorType)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case QVTiCGModelPackage.CG_REALIZED_VARIABLE__EXECUTOR_TYPE: |
| return getExecutorType(); |
| case QVTiCGModelPackage.CG_REALIZED_VARIABLE__TYPED_MODEL: |
| return getTypedModel(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case QVTiCGModelPackage.CG_REALIZED_VARIABLE__EXECUTOR_TYPE: |
| setExecutorType((CGExecutorType)newValue); |
| return; |
| case QVTiCGModelPackage.CG_REALIZED_VARIABLE__TYPED_MODEL: |
| setTypedModel((CGTypedModel)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case QVTiCGModelPackage.CG_REALIZED_VARIABLE__EXECUTOR_TYPE: |
| setExecutorType((CGExecutorType)null); |
| return; |
| case QVTiCGModelPackage.CG_REALIZED_VARIABLE__TYPED_MODEL: |
| setTypedModel((CGTypedModel)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case QVTiCGModelPackage.CG_REALIZED_VARIABLE__EXECUTOR_TYPE: |
| return executorType != null; |
| case QVTiCGModelPackage.CG_REALIZED_VARIABLE__TYPED_MODEL: |
| return typedModel != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * {@inheritDoc} |
| * @generated |
| */ |
| @SuppressWarnings("unchecked") |
| @Override |
| public @Nullable <R> R accept(@NonNull CGModelVisitor<R> visitor) { |
| return (R) ((QVTiCGModelVisitor<?>)visitor).visitCGRealizedVariable(this); |
| } |
| |
| /** |
| * {@inheritDoc} |
| * @generated |
| */ |
| @Override |
| public boolean isAssertedNonNull() { |
| return false; |
| } |
| |
| /** |
| * {@inheritDoc} |
| * @generated |
| */ |
| @Override |
| public boolean isBoxed() { |
| return false; |
| } |
| |
| /** |
| * {@inheritDoc} |
| * @generated |
| */ |
| @Override |
| public boolean isGlobal() { |
| return false; |
| } |
| |
| /** |
| * {@inheritDoc} |
| * @generated |
| */ |
| @Override |
| public boolean isNonNull() { |
| return true; |
| } |
| |
| /** |
| * {@inheritDoc} |
| * @generated |
| */ |
| @Override |
| public boolean isNull() { |
| return false; |
| } |
| |
| /** |
| * {@inheritDoc} |
| * @generated |
| */ |
| @Override |
| public boolean isUnboxed() { |
| return true; |
| } |
| |
| } //CGRealizedVariableImpl |