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