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.SchedulingPolicyChoice; |
10 | import de.uka.ipd.sdq.pcm.designdecision.designdecisionPackage; |
11 | |
12 | import de.uka.ipd.sdq.pcm.resourceenvironment.SchedulingPolicy; |
13 | |
14 | import org.eclipse.emf.common.notify.Notification; |
15 | |
16 | import org.eclipse.emf.ecore.EClass; |
17 | |
18 | import org.eclipse.emf.ecore.impl.ENotificationImpl; |
19 | |
20 | /** |
21 | * <!-- begin-user-doc --> |
22 | * An implementation of the model object '<em><b>Scheduling Policy Choice</b></em>'. |
23 | * <!-- end-user-doc --> |
24 | * <p> |
25 | * The following features are implemented: |
26 | * <ul> |
27 | * <li>{@link de.uka.ipd.sdq.pcm.designdecision.impl.SchedulingPolicyChoiceImpl#getChosenValue <em>Chosen Value</em>}</li> |
28 | * </ul> |
29 | * </p> |
30 | * |
31 | * @generated |
32 | */ |
33 | public class SchedulingPolicyChoiceImpl extends ChoiceImpl implements SchedulingPolicyChoice { |
34 | /** |
35 | * The default value of the '{@link #getChosenValue() <em>Chosen Value</em>}' attribute. |
36 | * <!-- begin-user-doc --> |
37 | * <!-- end-user-doc --> |
38 | * @see #getChosenValue() |
39 | * @generated |
40 | * @ordered |
41 | */ |
42 | protected static final SchedulingPolicy CHOSEN_VALUE_EDEFAULT = SchedulingPolicy.EXACT; |
43 | |
44 | /** |
45 | * The cached value of the '{@link #getChosenValue() <em>Chosen Value</em>}' attribute. |
46 | * <!-- begin-user-doc --> |
47 | * <!-- end-user-doc --> |
48 | * @see #getChosenValue() |
49 | * @generated |
50 | * @ordered |
51 | */ |
52 | protected SchedulingPolicy chosenValue = CHOSEN_VALUE_EDEFAULT; |
53 | |
54 | /** |
55 | * <!-- begin-user-doc --> |
56 | * <!-- end-user-doc --> |
57 | * @generated |
58 | */ |
59 | protected SchedulingPolicyChoiceImpl() { |
60 | super(); |
61 | } |
62 | |
63 | /** |
64 | * <!-- begin-user-doc --> |
65 | * <!-- end-user-doc --> |
66 | * @generated |
67 | */ |
68 | @Override |
69 | protected EClass eStaticClass() { |
70 | return designdecisionPackage.Literals.SCHEDULING_POLICY_CHOICE; |
71 | } |
72 | |
73 | /** |
74 | * <!-- begin-user-doc --> |
75 | * <!-- end-user-doc --> |
76 | * @generated |
77 | */ |
78 | public SchedulingPolicy getChosenValue() { |
79 | return chosenValue; |
80 | } |
81 | |
82 | /** |
83 | * <!-- begin-user-doc --> |
84 | * <!-- end-user-doc --> |
85 | * @generated |
86 | */ |
87 | public void setChosenValue(SchedulingPolicy newChosenValue) { |
88 | SchedulingPolicy oldChosenValue = chosenValue; |
89 | chosenValue = newChosenValue == null ? CHOSEN_VALUE_EDEFAULT : newChosenValue; |
90 | if (eNotificationRequired()) |
91 | eNotify(new ENotificationImpl(this, Notification.SET, designdecisionPackage.SCHEDULING_POLICY_CHOICE__CHOSEN_VALUE, oldChosenValue, chosenValue)); |
92 | } |
93 | |
94 | /** |
95 | * <!-- begin-user-doc --> |
96 | * <!-- end-user-doc --> |
97 | * @generated |
98 | */ |
99 | @Override |
100 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
101 | switch (featureID) { |
102 | case designdecisionPackage.SCHEDULING_POLICY_CHOICE__CHOSEN_VALUE: |
103 | return getChosenValue(); |
104 | } |
105 | return super.eGet(featureID, resolve, coreType); |
106 | } |
107 | |
108 | /** |
109 | * <!-- begin-user-doc --> |
110 | * <!-- end-user-doc --> |
111 | * @generated |
112 | */ |
113 | @Override |
114 | public void eSet(int featureID, Object newValue) { |
115 | switch (featureID) { |
116 | case designdecisionPackage.SCHEDULING_POLICY_CHOICE__CHOSEN_VALUE: |
117 | setChosenValue((SchedulingPolicy)newValue); |
118 | return; |
119 | } |
120 | super.eSet(featureID, newValue); |
121 | } |
122 | |
123 | /** |
124 | * <!-- begin-user-doc --> |
125 | * <!-- end-user-doc --> |
126 | * @generated |
127 | */ |
128 | @Override |
129 | public void eUnset(int featureID) { |
130 | switch (featureID) { |
131 | case designdecisionPackage.SCHEDULING_POLICY_CHOICE__CHOSEN_VALUE: |
132 | setChosenValue(CHOSEN_VALUE_EDEFAULT); |
133 | return; |
134 | } |
135 | super.eUnset(featureID); |
136 | } |
137 | |
138 | /** |
139 | * <!-- begin-user-doc --> |
140 | * <!-- end-user-doc --> |
141 | * @generated |
142 | */ |
143 | @Override |
144 | public boolean eIsSet(int featureID) { |
145 | switch (featureID) { |
146 | case designdecisionPackage.SCHEDULING_POLICY_CHOICE__CHOSEN_VALUE: |
147 | return chosenValue != CHOSEN_VALUE_EDEFAULT; |
148 | } |
149 | return super.eIsSet(featureID); |
150 | } |
151 | |
152 | /** |
153 | * <!-- begin-user-doc --> |
154 | * <!-- end-user-doc --> |
155 | * @generated |
156 | */ |
157 | @Override |
158 | public String toString() { |
159 | if (eIsProxy()) return super.toString(); |
160 | |
161 | StringBuffer result = new StringBuffer(super.toString()); |
162 | result.append(" (chosenValue: "); |
163 | result.append(chosenValue); |
164 | result.append(')'); |
165 | return result.toString(); |
166 | } |
167 | |
168 | } //SchedulingPolicyChoiceImpl |