1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package de.uka.ipd.sdq.sensitivity.impl; |
8 | |
9 | import de.uka.ipd.sdq.pcm.reliability.SoftwareInducedFailureType; |
10 | |
11 | import de.uka.ipd.sdq.sensitivity.SensitivityPackage; |
12 | import de.uka.ipd.sdq.sensitivity.SoftwareFailureTypesParameter; |
13 | |
14 | import de.uka.ipd.sdq.sensitivity.util.SensitivityValidator; |
15 | |
16 | import java.util.Collection; |
17 | import java.util.Map; |
18 | |
19 | import org.eclipse.emf.common.util.BasicDiagnostic; |
20 | import org.eclipse.emf.common.util.Diagnostic; |
21 | import org.eclipse.emf.common.util.DiagnosticChain; |
22 | import org.eclipse.emf.common.util.EList; |
23 | |
24 | import org.eclipse.emf.ecore.EClass; |
25 | |
26 | import org.eclipse.emf.ecore.plugin.EcorePlugin; |
27 | |
28 | import org.eclipse.emf.ecore.util.EObjectResolvingEList; |
29 | import org.eclipse.emf.ecore.util.EObjectValidator; |
30 | |
31 | /** |
32 | * <!-- begin-user-doc --> |
33 | * An implementation of the model object '<em><b>Software Failure Types Parameter</b></em>'. |
34 | * <!-- end-user-doc --> |
35 | * <p> |
36 | * The following features are implemented: |
37 | * <ul> |
38 | * <li>{@link de.uka.ipd.sdq.sensitivity.impl.SoftwareFailureTypesParameterImpl#getSoftwareInducedFailureTypes__SoftwareFailureTypeReliabilityParameter <em>Software Induced Failure Types Software Failure Type Reliability Parameter</em>}</li> |
39 | * </ul> |
40 | * </p> |
41 | * |
42 | * @generated |
43 | */ |
44 | public class SoftwareFailureTypesParameterImpl extends SingleSensitivityParameterImpl implements SoftwareFailureTypesParameter { |
45 | /** |
46 | * The cached value of the '{@link #getSoftwareInducedFailureTypes__SoftwareFailureTypeReliabilityParameter() <em>Software Induced Failure Types Software Failure Type Reliability Parameter</em>}' reference list. |
47 | * <!-- begin-user-doc --> |
48 | * <!-- end-user-doc --> |
49 | * @see #getSoftwareInducedFailureTypes__SoftwareFailureTypeReliabilityParameter() |
50 | * @generated |
51 | * @ordered |
52 | */ |
53 | protected EList<SoftwareInducedFailureType> softwareInducedFailureTypes__SoftwareFailureTypeReliabilityParameter; |
54 | |
55 | /** |
56 | * <!-- begin-user-doc --> |
57 | * <!-- end-user-doc --> |
58 | * @generated |
59 | */ |
60 | protected SoftwareFailureTypesParameterImpl() { |
61 | super(); |
62 | } |
63 | |
64 | /** |
65 | * <!-- begin-user-doc --> |
66 | * <!-- end-user-doc --> |
67 | * @generated |
68 | */ |
69 | @Override |
70 | protected EClass eStaticClass() { |
71 | return SensitivityPackage.Literals.SOFTWARE_FAILURE_TYPES_PARAMETER; |
72 | } |
73 | |
74 | /** |
75 | * <!-- begin-user-doc --> |
76 | * <!-- end-user-doc --> |
77 | * @generated |
78 | */ |
79 | public EList<SoftwareInducedFailureType> getSoftwareInducedFailureTypes__SoftwareFailureTypeReliabilityParameter() { |
80 | if (softwareInducedFailureTypes__SoftwareFailureTypeReliabilityParameter == null) { |
81 | softwareInducedFailureTypes__SoftwareFailureTypeReliabilityParameter = new EObjectResolvingEList<SoftwareInducedFailureType>(SoftwareInducedFailureType.class, this, SensitivityPackage.SOFTWARE_FAILURE_TYPES_PARAMETER__SOFTWARE_INDUCED_FAILURE_TYPES_SOFTWARE_FAILURE_TYPE_RELIABILITY_PARAMETER); |
82 | } |
83 | return softwareInducedFailureTypes__SoftwareFailureTypeReliabilityParameter; |
84 | } |
85 | |
86 | /** |
87 | * <!-- begin-user-doc --> |
88 | * <!-- end-user-doc --> |
89 | * @generated |
90 | */ |
91 | public boolean SoftwareFailureTypeReliabilityParameterMustHaveDoubleVariation(DiagnosticChain diagnostics, Map<Object, Object> context) { |
92 | // TODO: implement this method |
93 | // -> specify the condition that violates the invariant |
94 | // -> verify the details of the diagnostic, including severity and message |
95 | // Ensure that you remove @generated or mark it @generated NOT |
96 | if (false) { |
97 | if (diagnostics != null) { |
98 | diagnostics.add |
99 | (new BasicDiagnostic |
100 | (Diagnostic.ERROR, |
101 | SensitivityValidator.DIAGNOSTIC_SOURCE, |
102 | SensitivityValidator.SOFTWARE_FAILURE_TYPES_PARAMETER__SOFTWARE_FAILURE_TYPE_RELIABILITY_PARAMETER_MUST_HAVE_DOUBLE_VARIATION, |
103 | EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "SoftwareFailureTypeReliabilityParameterMustHaveDoubleVariation", EObjectValidator.getObjectLabel(this, context) }), |
104 | new Object [] { this })); |
105 | } |
106 | return false; |
107 | } |
108 | return true; |
109 | } |
110 | |
111 | /** |
112 | * <!-- begin-user-doc --> |
113 | * <!-- end-user-doc --> |
114 | * @generated |
115 | */ |
116 | @Override |
117 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
118 | switch (featureID) { |
119 | case SensitivityPackage.SOFTWARE_FAILURE_TYPES_PARAMETER__SOFTWARE_INDUCED_FAILURE_TYPES_SOFTWARE_FAILURE_TYPE_RELIABILITY_PARAMETER: |
120 | return getSoftwareInducedFailureTypes__SoftwareFailureTypeReliabilityParameter(); |
121 | } |
122 | return super.eGet(featureID, resolve, coreType); |
123 | } |
124 | |
125 | /** |
126 | * <!-- begin-user-doc --> |
127 | * <!-- end-user-doc --> |
128 | * @generated |
129 | */ |
130 | @SuppressWarnings("unchecked") |
131 | @Override |
132 | public void eSet(int featureID, Object newValue) { |
133 | switch (featureID) { |
134 | case SensitivityPackage.SOFTWARE_FAILURE_TYPES_PARAMETER__SOFTWARE_INDUCED_FAILURE_TYPES_SOFTWARE_FAILURE_TYPE_RELIABILITY_PARAMETER: |
135 | getSoftwareInducedFailureTypes__SoftwareFailureTypeReliabilityParameter().clear(); |
136 | getSoftwareInducedFailureTypes__SoftwareFailureTypeReliabilityParameter().addAll((Collection<? extends SoftwareInducedFailureType>)newValue); |
137 | return; |
138 | } |
139 | super.eSet(featureID, newValue); |
140 | } |
141 | |
142 | /** |
143 | * <!-- begin-user-doc --> |
144 | * <!-- end-user-doc --> |
145 | * @generated |
146 | */ |
147 | @Override |
148 | public void eUnset(int featureID) { |
149 | switch (featureID) { |
150 | case SensitivityPackage.SOFTWARE_FAILURE_TYPES_PARAMETER__SOFTWARE_INDUCED_FAILURE_TYPES_SOFTWARE_FAILURE_TYPE_RELIABILITY_PARAMETER: |
151 | getSoftwareInducedFailureTypes__SoftwareFailureTypeReliabilityParameter().clear(); |
152 | return; |
153 | } |
154 | super.eUnset(featureID); |
155 | } |
156 | |
157 | /** |
158 | * <!-- begin-user-doc --> |
159 | * <!-- end-user-doc --> |
160 | * @generated |
161 | */ |
162 | @Override |
163 | public boolean eIsSet(int featureID) { |
164 | switch (featureID) { |
165 | case SensitivityPackage.SOFTWARE_FAILURE_TYPES_PARAMETER__SOFTWARE_INDUCED_FAILURE_TYPES_SOFTWARE_FAILURE_TYPE_RELIABILITY_PARAMETER: |
166 | return softwareInducedFailureTypes__SoftwareFailureTypeReliabilityParameter != null && !softwareInducedFailureTypes__SoftwareFailureTypeReliabilityParameter.isEmpty(); |
167 | } |
168 | return super.eIsSet(featureID); |
169 | } |
170 | |
171 | } //SoftwareFailureTypesParameterImpl |