1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package de.uka.ipd.sdq.pcm.designdecision.impl; |
8 | |
9 | import de.uka.ipd.sdq.pcm.designdecision.EnumDegree; |
10 | import de.uka.ipd.sdq.pcm.designdecision.designdecisionPackage; |
11 | |
12 | import org.eclipse.emf.common.notify.Notification; |
13 | import org.eclipse.emf.ecore.EClass; |
14 | import org.eclipse.emf.ecore.EEnum; |
15 | import org.eclipse.emf.ecore.InternalEObject; |
16 | import org.eclipse.emf.ecore.impl.ENotificationImpl; |
17 | |
18 | /** |
19 | * <!-- begin-user-doc --> |
20 | * An implementation of the model object '<em><b>Enum Degree</b></em>'. |
21 | * <!-- end-user-doc --> |
22 | * <p> |
23 | * The following features are implemented: |
24 | * <ul> |
25 | * <li>{@link de.uka.ipd.sdq.pcm.designdecision.impl.EnumDegreeImpl#getEnumeration <em>Enumeration</em>}</li> |
26 | * </ul> |
27 | * </p> |
28 | * |
29 | * @generated |
30 | */ |
31 | public abstract class EnumDegreeImpl extends UnorderedDegreeImpl implements EnumDegree { |
32 | /** |
33 | * The cached value of the '{@link #getEnumeration() <em>Enumeration</em>}' reference. |
34 | * <!-- begin-user-doc --> |
35 | * <!-- end-user-doc --> |
36 | * @see #getEnumeration() |
37 | * @generated |
38 | * @ordered |
39 | */ |
40 | protected EEnum enumeration; |
41 | |
42 | /** |
43 | * <!-- begin-user-doc --> |
44 | * <!-- end-user-doc --> |
45 | * @generated |
46 | */ |
47 | protected EnumDegreeImpl() { |
48 | super(); |
49 | } |
50 | |
51 | /** |
52 | * <!-- begin-user-doc --> |
53 | * <!-- end-user-doc --> |
54 | * @generated |
55 | */ |
56 | @Override |
57 | protected EClass eStaticClass() { |
58 | return designdecisionPackage.Literals.ENUM_DEGREE; |
59 | } |
60 | |
61 | /** |
62 | * <!-- begin-user-doc --> |
63 | * <!-- end-user-doc --> |
64 | * @generated |
65 | */ |
66 | public EEnum getEnumeration() { |
67 | if (enumeration != null && enumeration.eIsProxy()) { |
68 | InternalEObject oldEnumeration = (InternalEObject)enumeration; |
69 | enumeration = (EEnum)eResolveProxy(oldEnumeration); |
70 | if (enumeration != oldEnumeration) { |
71 | if (eNotificationRequired()) |
72 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, designdecisionPackage.ENUM_DEGREE__ENUMERATION, oldEnumeration, enumeration)); |
73 | } |
74 | } |
75 | return enumeration; |
76 | } |
77 | |
78 | /** |
79 | * <!-- begin-user-doc --> |
80 | * <!-- end-user-doc --> |
81 | * @generated |
82 | */ |
83 | public EEnum basicGetEnumeration() { |
84 | return enumeration; |
85 | } |
86 | |
87 | /** |
88 | * <!-- begin-user-doc --> |
89 | * <!-- end-user-doc --> |
90 | * @generated |
91 | */ |
92 | public void setEnumeration(EEnum newEnumeration) { |
93 | EEnum oldEnumeration = enumeration; |
94 | enumeration = newEnumeration; |
95 | if (eNotificationRequired()) |
96 | eNotify(new ENotificationImpl(this, Notification.SET, designdecisionPackage.ENUM_DEGREE__ENUMERATION, oldEnumeration, enumeration)); |
97 | } |
98 | |
99 | /** |
100 | * <!-- begin-user-doc --> |
101 | * <!-- end-user-doc --> |
102 | * @generated |
103 | */ |
104 | @Override |
105 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
106 | switch (featureID) { |
107 | case designdecisionPackage.ENUM_DEGREE__ENUMERATION: |
108 | if (resolve) return getEnumeration(); |
109 | return basicGetEnumeration(); |
110 | } |
111 | return super.eGet(featureID, resolve, coreType); |
112 | } |
113 | |
114 | /** |
115 | * <!-- begin-user-doc --> |
116 | * <!-- end-user-doc --> |
117 | * @generated |
118 | */ |
119 | @Override |
120 | public void eSet(int featureID, Object newValue) { |
121 | switch (featureID) { |
122 | case designdecisionPackage.ENUM_DEGREE__ENUMERATION: |
123 | setEnumeration((EEnum)newValue); |
124 | return; |
125 | } |
126 | super.eSet(featureID, newValue); |
127 | } |
128 | |
129 | /** |
130 | * <!-- begin-user-doc --> |
131 | * <!-- end-user-doc --> |
132 | * @generated |
133 | */ |
134 | @Override |
135 | public void eUnset(int featureID) { |
136 | switch (featureID) { |
137 | case designdecisionPackage.ENUM_DEGREE__ENUMERATION: |
138 | setEnumeration((EEnum)null); |
139 | return; |
140 | } |
141 | super.eUnset(featureID); |
142 | } |
143 | |
144 | /** |
145 | * <!-- begin-user-doc --> |
146 | * <!-- end-user-doc --> |
147 | * @generated |
148 | */ |
149 | @Override |
150 | public boolean eIsSet(int featureID) { |
151 | switch (featureID) { |
152 | case designdecisionPackage.ENUM_DEGREE__ENUMERATION: |
153 | return enumeration != null; |
154 | } |
155 | return super.eIsSet(featureID); |
156 | } |
157 | |
158 | } //EnumDegreeImpl |