| /** |
| * Copyright (c) 2015, 2016 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.xtext.qvtcore.tests.uml2rdbms.simpleuml2rdbms.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.qvtd.xtext.qvtcore.tests.uml2rdbms.simplerdbms.Column; |
| |
| import org.eclipse.qvtd.xtext.qvtcore.tests.uml2rdbms.simpleuml2rdbms.AttributeToColumn; |
| import org.eclipse.qvtd.xtext.qvtcore.tests.uml2rdbms.simpleuml2rdbms.PrimitiveToName; |
| import org.eclipse.qvtd.xtext.qvtcore.tests.uml2rdbms.simpleuml2rdbms.Simpleuml2rdbmsPackage; |
| import org.eclipse.qvtd.xtext.qvtcore.tests.uml2rdbms.simpleuml2rdbms.ToColumn; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Attribute To Column</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.qvtd.xtext.qvtcore.tests.uml2rdbms.simpleuml2rdbms.impl.AttributeToColumnImpl#getColumn <em>Column</em>}</li> |
| * <li>{@link org.eclipse.qvtd.xtext.qvtcore.tests.uml2rdbms.simpleuml2rdbms.impl.AttributeToColumnImpl#getType <em>Type</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class AttributeToColumnImpl extends FromAttributeImpl implements AttributeToColumn { |
| /** |
| * The cached value of the '{@link #getColumn() <em>Column</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getColumn() |
| * @generated |
| * @ordered |
| */ |
| protected Column column; |
| |
| /** |
| * The cached value of the '{@link #getType() <em>Type</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getType() |
| * @generated |
| * @ordered |
| */ |
| protected PrimitiveToName type; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected AttributeToColumnImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return Simpleuml2rdbmsPackage.Literals.ATTRIBUTE_TO_COLUMN; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Column getColumn() { |
| if (column != null && column.eIsProxy()) { |
| InternalEObject oldColumn = (InternalEObject)column; |
| column = (Column)eResolveProxy(oldColumn); |
| if (column != oldColumn) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, Simpleuml2rdbmsPackage.ATTRIBUTE_TO_COLUMN__COLUMN, oldColumn, column)); |
| } |
| } |
| return column; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Column basicGetColumn() { |
| return column; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setColumn(Column newColumn) { |
| Column oldColumn = column; |
| column = newColumn; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, Simpleuml2rdbmsPackage.ATTRIBUTE_TO_COLUMN__COLUMN, oldColumn, column)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public PrimitiveToName getType() { |
| if (type != null && type.eIsProxy()) { |
| InternalEObject oldType = (InternalEObject)type; |
| type = (PrimitiveToName)eResolveProxy(oldType); |
| if (type != oldType) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, Simpleuml2rdbmsPackage.ATTRIBUTE_TO_COLUMN__TYPE, oldType, type)); |
| } |
| } |
| return type; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public PrimitiveToName basicGetType() { |
| return type; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setType(PrimitiveToName newType) { |
| PrimitiveToName oldType = type; |
| type = newType; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, Simpleuml2rdbmsPackage.ATTRIBUTE_TO_COLUMN__TYPE, oldType, type)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case Simpleuml2rdbmsPackage.ATTRIBUTE_TO_COLUMN__COLUMN: |
| if (resolve) return getColumn(); |
| return basicGetColumn(); |
| case Simpleuml2rdbmsPackage.ATTRIBUTE_TO_COLUMN__TYPE: |
| if (resolve) return getType(); |
| return basicGetType(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case Simpleuml2rdbmsPackage.ATTRIBUTE_TO_COLUMN__COLUMN: |
| setColumn((Column)newValue); |
| return; |
| case Simpleuml2rdbmsPackage.ATTRIBUTE_TO_COLUMN__TYPE: |
| setType((PrimitiveToName)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case Simpleuml2rdbmsPackage.ATTRIBUTE_TO_COLUMN__COLUMN: |
| setColumn((Column)null); |
| return; |
| case Simpleuml2rdbmsPackage.ATTRIBUTE_TO_COLUMN__TYPE: |
| setType((PrimitiveToName)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case Simpleuml2rdbmsPackage.ATTRIBUTE_TO_COLUMN__COLUMN: |
| return column != null; |
| case Simpleuml2rdbmsPackage.ATTRIBUTE_TO_COLUMN__TYPE: |
| return type != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) { |
| if (baseClass == ToColumn.class) { |
| switch (derivedFeatureID) { |
| case Simpleuml2rdbmsPackage.ATTRIBUTE_TO_COLUMN__COLUMN: return Simpleuml2rdbmsPackage.TO_COLUMN__COLUMN; |
| default: return -1; |
| } |
| } |
| return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) { |
| if (baseClass == ToColumn.class) { |
| switch (baseFeatureID) { |
| case Simpleuml2rdbmsPackage.TO_COLUMN__COLUMN: return Simpleuml2rdbmsPackage.ATTRIBUTE_TO_COLUMN__COLUMN; |
| default: return -1; |
| } |
| } |
| return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); |
| } |
| |
| |
| } //AttributeToColumnImpl |