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.Candidate; |
10 | import de.uka.ipd.sdq.pcm.designdecision.Choice; |
11 | import de.uka.ipd.sdq.pcm.designdecision.QualityProperties.QualityProperty; |
12 | import de.uka.ipd.sdq.pcm.designdecision.designdecisionPackage; |
13 | |
14 | import java.util.Collection; |
15 | |
16 | import org.eclipse.emf.common.notify.NotificationChain; |
17 | |
18 | import org.eclipse.emf.common.util.EList; |
19 | |
20 | import org.eclipse.emf.ecore.EClass; |
21 | import org.eclipse.emf.ecore.InternalEObject; |
22 | |
23 | import org.eclipse.emf.ecore.impl.EObjectImpl; |
24 | |
25 | import org.eclipse.emf.ecore.util.EObjectContainmentEList; |
26 | import org.eclipse.emf.ecore.util.InternalEList; |
27 | |
28 | /** |
29 | * <!-- begin-user-doc --> |
30 | * An implementation of the model object '<em><b>Candidate</b></em>'. |
31 | * <!-- end-user-doc --> |
32 | * <p> |
33 | * The following features are implemented: |
34 | * <ul> |
35 | * <li>{@link de.uka.ipd.sdq.pcm.designdecision.impl.CandidateImpl#getChoices <em>Choices</em>}</li> |
36 | * <li>{@link de.uka.ipd.sdq.pcm.designdecision.impl.CandidateImpl#getQualityProperty <em>Quality Property</em>}</li> |
37 | * </ul> |
38 | * </p> |
39 | * |
40 | * @generated |
41 | */ |
42 | public class CandidateImpl extends EObjectImpl implements Candidate { |
43 | /** |
44 | * The cached value of the '{@link #getChoices() <em>Choices</em>}' containment reference list. |
45 | * <!-- begin-user-doc --> |
46 | * <!-- end-user-doc --> |
47 | * @see #getChoices() |
48 | * @generated |
49 | * @ordered |
50 | */ |
51 | protected EList<Choice> choices; |
52 | /** |
53 | * The cached value of the '{@link #getQualityProperty() <em>Quality Property</em>}' containment reference list. |
54 | * <!-- begin-user-doc --> |
55 | * <!-- end-user-doc --> |
56 | * @see #getQualityProperty() |
57 | * @generated |
58 | * @ordered |
59 | */ |
60 | protected EList<QualityProperty> qualityProperty; |
61 | /** |
62 | * <!-- begin-user-doc --> |
63 | * <!-- end-user-doc --> |
64 | * @generated |
65 | */ |
66 | protected CandidateImpl() { |
67 | super(); |
68 | } |
69 | |
70 | /** |
71 | * <!-- begin-user-doc --> |
72 | * <!-- end-user-doc --> |
73 | * @generated |
74 | */ |
75 | @Override |
76 | protected EClass eStaticClass() { |
77 | return designdecisionPackage.Literals.CANDIDATE; |
78 | } |
79 | |
80 | /** |
81 | * <!-- begin-user-doc --> |
82 | * <!-- end-user-doc --> |
83 | * @generated |
84 | */ |
85 | public EList<Choice> getChoices() { |
86 | if (choices == null) { |
87 | choices = new EObjectContainmentEList<Choice>(Choice.class, this, designdecisionPackage.CANDIDATE__CHOICES); |
88 | } |
89 | return choices; |
90 | } |
91 | |
92 | /** |
93 | * <!-- begin-user-doc --> |
94 | * <!-- end-user-doc --> |
95 | * @generated |
96 | */ |
97 | public EList<QualityProperty> getQualityProperty() { |
98 | if (qualityProperty == null) { |
99 | qualityProperty = new EObjectContainmentEList<QualityProperty>(QualityProperty.class, this, designdecisionPackage.CANDIDATE__QUALITY_PROPERTY); |
100 | } |
101 | return qualityProperty; |
102 | } |
103 | |
104 | /** |
105 | * <!-- begin-user-doc --> |
106 | * <!-- end-user-doc --> |
107 | * @generated |
108 | */ |
109 | @Override |
110 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
111 | switch (featureID) { |
112 | case designdecisionPackage.CANDIDATE__CHOICES: |
113 | return ((InternalEList<?>)getChoices()).basicRemove(otherEnd, msgs); |
114 | case designdecisionPackage.CANDIDATE__QUALITY_PROPERTY: |
115 | return ((InternalEList<?>)getQualityProperty()).basicRemove(otherEnd, msgs); |
116 | } |
117 | return super.eInverseRemove(otherEnd, featureID, msgs); |
118 | } |
119 | |
120 | /** |
121 | * <!-- begin-user-doc --> |
122 | * <!-- end-user-doc --> |
123 | * @generated |
124 | */ |
125 | @Override |
126 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
127 | switch (featureID) { |
128 | case designdecisionPackage.CANDIDATE__CHOICES: |
129 | return getChoices(); |
130 | case designdecisionPackage.CANDIDATE__QUALITY_PROPERTY: |
131 | return getQualityProperty(); |
132 | } |
133 | return super.eGet(featureID, resolve, coreType); |
134 | } |
135 | |
136 | /** |
137 | * <!-- begin-user-doc --> |
138 | * <!-- end-user-doc --> |
139 | * @generated |
140 | */ |
141 | @SuppressWarnings("unchecked") |
142 | @Override |
143 | public void eSet(int featureID, Object newValue) { |
144 | switch (featureID) { |
145 | case designdecisionPackage.CANDIDATE__CHOICES: |
146 | getChoices().clear(); |
147 | getChoices().addAll((Collection<? extends Choice>)newValue); |
148 | return; |
149 | case designdecisionPackage.CANDIDATE__QUALITY_PROPERTY: |
150 | getQualityProperty().clear(); |
151 | getQualityProperty().addAll((Collection<? extends QualityProperty>)newValue); |
152 | return; |
153 | } |
154 | super.eSet(featureID, newValue); |
155 | } |
156 | |
157 | /** |
158 | * <!-- begin-user-doc --> |
159 | * <!-- end-user-doc --> |
160 | * @generated |
161 | */ |
162 | @Override |
163 | public void eUnset(int featureID) { |
164 | switch (featureID) { |
165 | case designdecisionPackage.CANDIDATE__CHOICES: |
166 | getChoices().clear(); |
167 | return; |
168 | case designdecisionPackage.CANDIDATE__QUALITY_PROPERTY: |
169 | getQualityProperty().clear(); |
170 | return; |
171 | } |
172 | super.eUnset(featureID); |
173 | } |
174 | |
175 | /** |
176 | * <!-- begin-user-doc --> |
177 | * <!-- end-user-doc --> |
178 | * @generated |
179 | */ |
180 | @Override |
181 | public boolean eIsSet(int featureID) { |
182 | switch (featureID) { |
183 | case designdecisionPackage.CANDIDATE__CHOICES: |
184 | return choices != null && !choices.isEmpty(); |
185 | case designdecisionPackage.CANDIDATE__QUALITY_PROPERTY: |
186 | return qualityProperty != null && !qualityProperty.isEmpty(); |
187 | } |
188 | return super.eIsSet(featureID); |
189 | } |
190 | |
191 | } //CandidateImpl |