| /** |
| * <copyright> |
| * |
| * Copyright (c) 2013, 2019 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.pivot.qvtschedule.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.pivot.internal.NamedElementImpl; |
| |
| import org.eclipse.ocl.pivot.util.Visitor; |
| |
| import org.eclipse.qvtd.pivot.qvtschedule.ClassDatum; |
| import org.eclipse.qvtd.pivot.qvtschedule.CollectionClassDatum; |
| import org.eclipse.qvtd.pivot.qvtschedule.QVTschedulePackage; |
| |
| import org.eclipse.qvtd.pivot.qvtschedule.util.QVTscheduleVisitor; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Collection Class Datum</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.qvtd.pivot.qvtschedule.impl.CollectionClassDatumImpl#getElementalClassDatum <em>Elemental Class Datum</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class CollectionClassDatumImpl extends ClassDatumImpl implements CollectionClassDatum { |
| /** |
| * The number of structural features of the '<em>Collection Class Datum</em>' class. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| * @ordered |
| */ |
| public static final int COLLECTION_CLASS_DATUM_FEATURE_COUNT = ClassDatumImpl.CLASS_DATUM_FEATURE_COUNT + 1; |
| |
| /** |
| * The number of operations of the '<em>Collection Class Datum</em>' class. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| * @ordered |
| */ |
| public static final int COLLECTION_CLASS_DATUM_OPERATION_COUNT = ClassDatumImpl.CLASS_DATUM_OPERATION_COUNT + 0; |
| |
| |
| /** |
| * The cached value of the '{@link #getElementalClassDatum() <em>Elemental Class Datum</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getElementalClassDatum() |
| * @generated |
| * @ordered |
| */ |
| protected ClassDatum elementalClassDatum; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected CollectionClassDatumImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return QVTschedulePackage.Literals.COLLECTION_CLASS_DATUM; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public ClassDatum getElementalClassDatum() { |
| if (elementalClassDatum != null && elementalClassDatum.eIsProxy()) { |
| InternalEObject oldElementalClassDatum = (InternalEObject)elementalClassDatum; |
| elementalClassDatum = (ClassDatum)eResolveProxy(oldElementalClassDatum); |
| if (elementalClassDatum != oldElementalClassDatum) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, NamedElementImpl.NAMED_ELEMENT_FEATURE_COUNT + 6, oldElementalClassDatum, elementalClassDatum)); |
| } |
| } |
| return elementalClassDatum; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ClassDatum basicGetElementalClassDatum() { |
| return elementalClassDatum; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setElementalClassDatum(ClassDatum newElementalClassDatum) { |
| ClassDatum oldElementalClassDatum = elementalClassDatum; |
| elementalClassDatum = newElementalClassDatum; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, NamedElementImpl.NAMED_ELEMENT_FEATURE_COUNT + 6, oldElementalClassDatum, elementalClassDatum)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case NamedElementImpl.NAMED_ELEMENT_FEATURE_COUNT + 6: |
| if (resolve) return getElementalClassDatum(); |
| return basicGetElementalClassDatum(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case NamedElementImpl.NAMED_ELEMENT_FEATURE_COUNT + 6: |
| setElementalClassDatum((ClassDatum)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case NamedElementImpl.NAMED_ELEMENT_FEATURE_COUNT + 6: |
| setElementalClassDatum((ClassDatum)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case NamedElementImpl.NAMED_ELEMENT_FEATURE_COUNT + 6: |
| return elementalClassDatum != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * {@inheritDoc} |
| * @generated |
| */ |
| @SuppressWarnings("unchecked") |
| @Override |
| public <R> R accept(@NonNull Visitor<R> visitor) { |
| if (visitor instanceof QVTscheduleVisitor) { |
| return (R) ((QVTscheduleVisitor<?>)visitor).visitCollectionClassDatum(this); |
| } |
| else { |
| return super.accept(visitor); |
| } |
| } |
| |
| } //CollectionClassDatumImpl |