| /** |
| */ |
| package org.eclipse.papyrus.designer.languages.cpp.profile.C_Cpp.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.emf.ecore.impl.MinimalEObjectImpl; |
| |
| import org.eclipse.papyrus.designer.languages.cpp.profile.C_Cpp.C_CppPackage; |
| import org.eclipse.papyrus.designer.languages.cpp.profile.C_Cpp.EnumStyle; |
| |
| import org.eclipse.uml2.uml.Enumeration; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Enum Style</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.papyrus.designer.languages.cpp.profile.C_Cpp.impl.EnumStyleImpl#getBase_Enumeration <em>Base Enumeration</em>}</li> |
| * <li>{@link org.eclipse.papyrus.designer.languages.cpp.profile.C_Cpp.impl.EnumStyleImpl#isClassEnum <em>Class Enum</em>}</li> |
| * <li>{@link org.eclipse.papyrus.designer.languages.cpp.profile.C_Cpp.impl.EnumStyleImpl#getBase_Package <em>Base Package</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class EnumStyleImpl extends MinimalEObjectImpl.Container implements EnumStyle { |
| /** |
| * The cached value of the '{@link #getBase_Enumeration() <em>Base Enumeration</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getBase_Enumeration() |
| * @generated |
| * @ordered |
| */ |
| protected Enumeration base_Enumeration; |
| |
| /** |
| * The default value of the '{@link #isClassEnum() <em>Class Enum</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isClassEnum() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean CLASS_ENUM_EDEFAULT = true; |
| |
| /** |
| * The cached value of the '{@link #isClassEnum() <em>Class Enum</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isClassEnum() |
| * @generated |
| * @ordered |
| */ |
| protected boolean classEnum = CLASS_ENUM_EDEFAULT; |
| |
| /** |
| * The cached value of the '{@link #getBase_Package() <em>Base Package</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getBase_Package() |
| * @generated |
| * @ordered |
| */ |
| protected org.eclipse.uml2.uml.Package base_Package; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected EnumStyleImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return C_CppPackage.Literals.ENUM_STYLE; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Enumeration getBase_Enumeration() { |
| if (base_Enumeration != null && base_Enumeration.eIsProxy()) { |
| InternalEObject oldBase_Enumeration = (InternalEObject)base_Enumeration; |
| base_Enumeration = (Enumeration)eResolveProxy(oldBase_Enumeration); |
| if (base_Enumeration != oldBase_Enumeration) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.ENUM_STYLE__BASE_ENUMERATION, oldBase_Enumeration, base_Enumeration)); |
| } |
| } |
| return base_Enumeration; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Enumeration basicGetBase_Enumeration() { |
| return base_Enumeration; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setBase_Enumeration(Enumeration newBase_Enumeration) { |
| Enumeration oldBase_Enumeration = base_Enumeration; |
| base_Enumeration = newBase_Enumeration; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.ENUM_STYLE__BASE_ENUMERATION, oldBase_Enumeration, base_Enumeration)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean isClassEnum() { |
| return classEnum; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setClassEnum(boolean newClassEnum) { |
| boolean oldClassEnum = classEnum; |
| classEnum = newClassEnum; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.ENUM_STYLE__CLASS_ENUM, oldClassEnum, classEnum)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public org.eclipse.uml2.uml.Package getBase_Package() { |
| if (base_Package != null && base_Package.eIsProxy()) { |
| InternalEObject oldBase_Package = (InternalEObject)base_Package; |
| base_Package = (org.eclipse.uml2.uml.Package)eResolveProxy(oldBase_Package); |
| if (base_Package != oldBase_Package) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.ENUM_STYLE__BASE_PACKAGE, oldBase_Package, base_Package)); |
| } |
| } |
| return base_Package; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public org.eclipse.uml2.uml.Package basicGetBase_Package() { |
| return base_Package; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setBase_Package(org.eclipse.uml2.uml.Package newBase_Package) { |
| org.eclipse.uml2.uml.Package oldBase_Package = base_Package; |
| base_Package = newBase_Package; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.ENUM_STYLE__BASE_PACKAGE, oldBase_Package, base_Package)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case C_CppPackage.ENUM_STYLE__BASE_ENUMERATION: |
| if (resolve) return getBase_Enumeration(); |
| return basicGetBase_Enumeration(); |
| case C_CppPackage.ENUM_STYLE__CLASS_ENUM: |
| return isClassEnum(); |
| case C_CppPackage.ENUM_STYLE__BASE_PACKAGE: |
| if (resolve) return getBase_Package(); |
| return basicGetBase_Package(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case C_CppPackage.ENUM_STYLE__BASE_ENUMERATION: |
| setBase_Enumeration((Enumeration)newValue); |
| return; |
| case C_CppPackage.ENUM_STYLE__CLASS_ENUM: |
| setClassEnum((Boolean)newValue); |
| return; |
| case C_CppPackage.ENUM_STYLE__BASE_PACKAGE: |
| setBase_Package((org.eclipse.uml2.uml.Package)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case C_CppPackage.ENUM_STYLE__BASE_ENUMERATION: |
| setBase_Enumeration((Enumeration)null); |
| return; |
| case C_CppPackage.ENUM_STYLE__CLASS_ENUM: |
| setClassEnum(CLASS_ENUM_EDEFAULT); |
| return; |
| case C_CppPackage.ENUM_STYLE__BASE_PACKAGE: |
| setBase_Package((org.eclipse.uml2.uml.Package)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case C_CppPackage.ENUM_STYLE__BASE_ENUMERATION: |
| return base_Enumeration != null; |
| case C_CppPackage.ENUM_STYLE__CLASS_ENUM: |
| return classEnum != CLASS_ENUM_EDEFAULT; |
| case C_CppPackage.ENUM_STYLE__BASE_PACKAGE: |
| return base_Package != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| if (eIsProxy()) return super.toString(); |
| |
| StringBuilder result = new StringBuilder(super.toString()); |
| result.append(" (classEnum: "); //$NON-NLS-1$ |
| result.append(classEnum); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //EnumStyleImpl |