1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package de.uka.ipd.sdq.dsexplore.qml.profile.QMLProfile.impl; |
8 | |
9 | import de.uka.ipd.sdq.dsexplore.qml.contract.QMLContract.GenericQMLContract; |
10 | |
11 | import de.uka.ipd.sdq.dsexplore.qml.profile.QMLProfile.QMLProfilePackage; |
12 | import de.uka.ipd.sdq.dsexplore.qml.profile.QMLProfile.Requirement; |
13 | |
14 | import de.uka.ipd.sdq.identifier.impl.IdentifierImpl; |
15 | |
16 | import java.util.Collection; |
17 | |
18 | import org.eclipse.emf.common.util.EList; |
19 | |
20 | import org.eclipse.emf.ecore.EClass; |
21 | |
22 | import org.eclipse.emf.ecore.util.EObjectResolvingEList; |
23 | |
24 | /** |
25 | * <!-- begin-user-doc --> |
26 | * An implementation of the model object '<em><b>Requirement</b></em>'. |
27 | * <!-- end-user-doc --> |
28 | * <p> |
29 | * The following features are implemented: |
30 | * <ul> |
31 | * <li>{@link de.uka.ipd.sdq.dsexplore.qml.profile.QMLProfile.impl.RequirementImpl#getRequireContract <em>Require Contract</em>}</li> |
32 | * </ul> |
33 | * </p> |
34 | * |
35 | * @generated |
36 | */ |
37 | public abstract class RequirementImpl extends IdentifierImpl implements Requirement { |
38 | /** |
39 | * The cached value of the '{@link #getRequireContract() <em>Require Contract</em>}' reference list. |
40 | * <!-- begin-user-doc --> |
41 | * <!-- end-user-doc --> |
42 | * @see #getRequireContract() |
43 | * @generated |
44 | * @ordered |
45 | */ |
46 | protected EList<GenericQMLContract> requireContract; |
47 | |
48 | /** |
49 | * <!-- begin-user-doc --> |
50 | * <!-- end-user-doc --> |
51 | * @generated |
52 | */ |
53 | protected RequirementImpl() { |
54 | super(); |
55 | } |
56 | |
57 | /** |
58 | * <!-- begin-user-doc --> |
59 | * <!-- end-user-doc --> |
60 | * @generated |
61 | */ |
62 | @Override |
63 | protected EClass eStaticClass() { |
64 | return QMLProfilePackage.Literals.REQUIREMENT; |
65 | } |
66 | |
67 | /** |
68 | * <!-- begin-user-doc --> |
69 | * <!-- end-user-doc --> |
70 | * @generated |
71 | */ |
72 | public EList<GenericQMLContract> getRequireContract() { |
73 | if (requireContract == null) { |
74 | requireContract = new EObjectResolvingEList<GenericQMLContract>(GenericQMLContract.class, this, QMLProfilePackage.REQUIREMENT__REQUIRE_CONTRACT); |
75 | } |
76 | return requireContract; |
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 QMLProfilePackage.REQUIREMENT__REQUIRE_CONTRACT: |
88 | return getRequireContract(); |
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 QMLProfilePackage.REQUIREMENT__REQUIRE_CONTRACT: |
103 | getRequireContract().clear(); |
104 | getRequireContract().addAll((Collection<? extends GenericQMLContract>)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 QMLProfilePackage.REQUIREMENT__REQUIRE_CONTRACT: |
119 | getRequireContract().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 QMLProfilePackage.REQUIREMENT__REQUIRE_CONTRACT: |
134 | return requireContract != null && !requireContract.isEmpty(); |
135 | } |
136 | return super.eIsSet(featureID); |
137 | } |
138 | |
139 | } //RequirementImpl |