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.featuremodel.Feature; |
10 | |
11 | import de.uka.ipd.sdq.pcm.designdecision.FeatureSubset; |
12 | import de.uka.ipd.sdq.pcm.designdecision.designdecisionPackage; |
13 | |
14 | import java.util.Collection; |
15 | |
16 | import org.eclipse.emf.common.util.EList; |
17 | |
18 | import org.eclipse.emf.ecore.EClass; |
19 | |
20 | import org.eclipse.emf.ecore.impl.EObjectImpl; |
21 | |
22 | import org.eclipse.emf.ecore.util.EObjectResolvingEList; |
23 | |
24 | /** |
25 | * <!-- begin-user-doc --> |
26 | * An implementation of the model object '<em><b>Feature Subset</b></em>'. |
27 | * <!-- end-user-doc --> |
28 | * <p> |
29 | * The following features are implemented: |
30 | * <ul> |
31 | * <li>{@link de.uka.ipd.sdq.pcm.designdecision.impl.FeatureSubsetImpl#getFeature <em>Feature</em>}</li> |
32 | * </ul> |
33 | * </p> |
34 | * |
35 | * @generated |
36 | */ |
37 | public class FeatureSubsetImpl extends EObjectImpl implements FeatureSubset { |
38 | /** |
39 | * The cached value of the '{@link #getFeature() <em>Feature</em>}' reference list. |
40 | * <!-- begin-user-doc --> |
41 | * <!-- end-user-doc --> |
42 | * @see #getFeature() |
43 | * @generated |
44 | * @ordered |
45 | */ |
46 | protected EList<Feature> feature; |
47 | |
48 | /** |
49 | * <!-- begin-user-doc --> |
50 | * <!-- end-user-doc --> |
51 | * @generated |
52 | */ |
53 | protected FeatureSubsetImpl() { |
54 | super(); |
55 | } |
56 | |
57 | /** |
58 | * <!-- begin-user-doc --> |
59 | * <!-- end-user-doc --> |
60 | * @generated |
61 | */ |
62 | @Override |
63 | protected EClass eStaticClass() { |
64 | return designdecisionPackage.Literals.FEATURE_SUBSET; |
65 | } |
66 | |
67 | /** |
68 | * <!-- begin-user-doc --> |
69 | * <!-- end-user-doc --> |
70 | * @generated |
71 | */ |
72 | public EList<Feature> getFeature() { |
73 | if (feature == null) { |
74 | feature = new EObjectResolvingEList<Feature>(Feature.class, this, designdecisionPackage.FEATURE_SUBSET__FEATURE); |
75 | } |
76 | return feature; |
77 | } |
78 | |
79 | /** |
80 | * <!-- begin-user-doc --> |
81 | * <!-- end-user-doc --> |
82 | * @generated |
83 | */ |
84 | @Override |
85 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
86 | switch (featureID) { |
87 | case designdecisionPackage.FEATURE_SUBSET__FEATURE: |
88 | return getFeature(); |
89 | } |
90 | return super.eGet(featureID, resolve, coreType); |
91 | } |
92 | |
93 | /** |
94 | * <!-- begin-user-doc --> |
95 | * <!-- end-user-doc --> |
96 | * @generated |
97 | */ |
98 | @SuppressWarnings("unchecked") |
99 | @Override |
100 | public void eSet(int featureID, Object newValue) { |
101 | switch (featureID) { |
102 | case designdecisionPackage.FEATURE_SUBSET__FEATURE: |
103 | getFeature().clear(); |
104 | getFeature().addAll((Collection<? extends Feature>)newValue); |
105 | return; |
106 | } |
107 | super.eSet(featureID, newValue); |
108 | } |
109 | |
110 | /** |
111 | * <!-- begin-user-doc --> |
112 | * <!-- end-user-doc --> |
113 | * @generated |
114 | */ |
115 | @Override |
116 | public void eUnset(int featureID) { |
117 | switch (featureID) { |
118 | case designdecisionPackage.FEATURE_SUBSET__FEATURE: |
119 | getFeature().clear(); |
120 | return; |
121 | } |
122 | super.eUnset(featureID); |
123 | } |
124 | |
125 | /** |
126 | * <!-- begin-user-doc --> |
127 | * <!-- end-user-doc --> |
128 | * @generated |
129 | */ |
130 | @Override |
131 | public boolean eIsSet(int featureID) { |
132 | switch (featureID) { |
133 | case designdecisionPackage.FEATURE_SUBSET__FEATURE: |
134 | return feature != null && !feature.isEmpty(); |
135 | } |
136 | return super.eIsSet(featureID); |
137 | } |
138 | |
139 | } //FeatureSubsetImpl |