1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package scheduler.configuration.impl; |
8 | |
9 | import org.eclipse.emf.common.notify.Notification; |
10 | import org.eclipse.emf.common.notify.NotificationChain; |
11 | |
12 | import org.eclipse.emf.ecore.EClass; |
13 | import org.eclipse.emf.ecore.InternalEObject; |
14 | |
15 | import org.eclipse.emf.ecore.impl.ENotificationImpl; |
16 | import org.eclipse.emf.ecore.impl.EObjectImpl; |
17 | |
18 | import scheduler.configuration.ConfigurationPackage; |
19 | import scheduler.configuration.PreemptionConfiguration; |
20 | import scheduler.configuration.TimeSliceConfiguration; |
21 | |
22 | /** |
23 | * <!-- begin-user-doc --> |
24 | * An implementation of the model object '<em><b>Preemption Configuration</b></em>'. |
25 | * <!-- end-user-doc --> |
26 | * <p> |
27 | * The following features are implemented: |
28 | * <ul> |
29 | * <li>{@link scheduler.configuration.impl.PreemptionConfigurationImpl#getTimesliceConfiguration <em>Timeslice Configuration</em>}</li> |
30 | * </ul> |
31 | * </p> |
32 | * |
33 | * @generated |
34 | */ |
35 | public class PreemptionConfigurationImpl extends EObjectImpl implements PreemptionConfiguration { |
36 | /** |
37 | * The cached value of the '{@link #getTimesliceConfiguration() <em>Timeslice Configuration</em>}' containment reference. |
38 | * <!-- begin-user-doc --> |
39 | * <!-- end-user-doc --> |
40 | * @see #getTimesliceConfiguration() |
41 | * @generated |
42 | * @ordered |
43 | */ |
44 | protected TimeSliceConfiguration timesliceConfiguration; |
45 | |
46 | /** |
47 | * <!-- begin-user-doc --> |
48 | * <!-- end-user-doc --> |
49 | * @generated |
50 | */ |
51 | protected PreemptionConfigurationImpl() { |
52 | super(); |
53 | } |
54 | |
55 | /** |
56 | * <!-- begin-user-doc --> |
57 | * <!-- end-user-doc --> |
58 | * @generated |
59 | */ |
60 | @Override |
61 | protected EClass eStaticClass() { |
62 | return ConfigurationPackage.Literals.PREEMPTION_CONFIGURATION; |
63 | } |
64 | |
65 | /** |
66 | * <!-- begin-user-doc --> |
67 | * <!-- end-user-doc --> |
68 | * @generated |
69 | */ |
70 | public TimeSliceConfiguration getTimesliceConfiguration() { |
71 | return timesliceConfiguration; |
72 | } |
73 | |
74 | /** |
75 | * <!-- begin-user-doc --> |
76 | * <!-- end-user-doc --> |
77 | * @generated |
78 | */ |
79 | public NotificationChain basicSetTimesliceConfiguration(TimeSliceConfiguration newTimesliceConfiguration, NotificationChain msgs) { |
80 | TimeSliceConfiguration oldTimesliceConfiguration = timesliceConfiguration; |
81 | timesliceConfiguration = newTimesliceConfiguration; |
82 | if (eNotificationRequired()) { |
83 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ConfigurationPackage.PREEMPTION_CONFIGURATION__TIMESLICE_CONFIGURATION, oldTimesliceConfiguration, newTimesliceConfiguration); |
84 | if (msgs == null) msgs = notification; else msgs.add(notification); |
85 | } |
86 | return msgs; |
87 | } |
88 | |
89 | /** |
90 | * <!-- begin-user-doc --> |
91 | * <!-- end-user-doc --> |
92 | * @generated |
93 | */ |
94 | public void setTimesliceConfiguration(TimeSliceConfiguration newTimesliceConfiguration) { |
95 | if (newTimesliceConfiguration != timesliceConfiguration) { |
96 | NotificationChain msgs = null; |
97 | if (timesliceConfiguration != null) |
98 | msgs = ((InternalEObject)timesliceConfiguration).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ConfigurationPackage.PREEMPTION_CONFIGURATION__TIMESLICE_CONFIGURATION, null, msgs); |
99 | if (newTimesliceConfiguration != null) |
100 | msgs = ((InternalEObject)newTimesliceConfiguration).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ConfigurationPackage.PREEMPTION_CONFIGURATION__TIMESLICE_CONFIGURATION, null, msgs); |
101 | msgs = basicSetTimesliceConfiguration(newTimesliceConfiguration, msgs); |
102 | if (msgs != null) msgs.dispatch(); |
103 | } |
104 | else if (eNotificationRequired()) |
105 | eNotify(new ENotificationImpl(this, Notification.SET, ConfigurationPackage.PREEMPTION_CONFIGURATION__TIMESLICE_CONFIGURATION, newTimesliceConfiguration, newTimesliceConfiguration)); |
106 | } |
107 | |
108 | /** |
109 | * <!-- begin-user-doc --> |
110 | * <!-- end-user-doc --> |
111 | * @generated |
112 | */ |
113 | @Override |
114 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
115 | switch (featureID) { |
116 | case ConfigurationPackage.PREEMPTION_CONFIGURATION__TIMESLICE_CONFIGURATION: |
117 | return basicSetTimesliceConfiguration(null, msgs); |
118 | } |
119 | return super.eInverseRemove(otherEnd, featureID, msgs); |
120 | } |
121 | |
122 | /** |
123 | * <!-- begin-user-doc --> |
124 | * <!-- end-user-doc --> |
125 | * @generated |
126 | */ |
127 | @Override |
128 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
129 | switch (featureID) { |
130 | case ConfigurationPackage.PREEMPTION_CONFIGURATION__TIMESLICE_CONFIGURATION: |
131 | return getTimesliceConfiguration(); |
132 | } |
133 | return super.eGet(featureID, resolve, coreType); |
134 | } |
135 | |
136 | /** |
137 | * <!-- begin-user-doc --> |
138 | * <!-- end-user-doc --> |
139 | * @generated |
140 | */ |
141 | @Override |
142 | public void eSet(int featureID, Object newValue) { |
143 | switch (featureID) { |
144 | case ConfigurationPackage.PREEMPTION_CONFIGURATION__TIMESLICE_CONFIGURATION: |
145 | setTimesliceConfiguration((TimeSliceConfiguration)newValue); |
146 | return; |
147 | } |
148 | super.eSet(featureID, newValue); |
149 | } |
150 | |
151 | /** |
152 | * <!-- begin-user-doc --> |
153 | * <!-- end-user-doc --> |
154 | * @generated |
155 | */ |
156 | @Override |
157 | public void eUnset(int featureID) { |
158 | switch (featureID) { |
159 | case ConfigurationPackage.PREEMPTION_CONFIGURATION__TIMESLICE_CONFIGURATION: |
160 | setTimesliceConfiguration((TimeSliceConfiguration)null); |
161 | return; |
162 | } |
163 | super.eUnset(featureID); |
164 | } |
165 | |
166 | /** |
167 | * <!-- begin-user-doc --> |
168 | * <!-- end-user-doc --> |
169 | * @generated |
170 | */ |
171 | @Override |
172 | public boolean eIsSet(int featureID) { |
173 | switch (featureID) { |
174 | case ConfigurationPackage.PREEMPTION_CONFIGURATION__TIMESLICE_CONFIGURATION: |
175 | return timesliceConfiguration != null; |
176 | } |
177 | return super.eIsSet(featureID); |
178 | } |
179 | |
180 | } //PreemptionConfigurationImpl |