1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package de.fzi.se.quality.qualityannotation.impl; |
8 | |
9 | import de.fzi.se.quality.qualityannotation.CharacterisedPCMParameterPartitionRange; |
10 | import de.fzi.se.quality.qualityannotation.QualityAnnotationPackage; |
11 | |
12 | import de.uka.ipd.sdq.pcm.core.PCMRandomVariable; |
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.util.EObjectContainmentEList; |
24 | import org.eclipse.emf.ecore.util.InternalEList; |
25 | |
26 | /** |
27 | * <!-- begin-user-doc --> |
28 | * An implementation of the model object '<em><b>Characterised PCM Parameter Partition Range</b></em>'. |
29 | * <!-- end-user-doc --> |
30 | * <p> |
31 | * The following features are implemented: |
32 | * <ul> |
33 | * <li>{@link de.fzi.se.quality.qualityannotation.impl.CharacterisedPCMParameterPartitionRangeImpl#getValues <em>Values</em>}</li> |
34 | * </ul> |
35 | * </p> |
36 | * |
37 | * @generated |
38 | */ |
39 | public class CharacterisedPCMParameterPartitionRangeImpl extends CharacterisedPCMParameterPartitionImpl implements CharacterisedPCMParameterPartitionRange { |
40 | /** |
41 | * The cached value of the '{@link #getValues() <em>Values</em>}' containment reference list. |
42 | * <!-- begin-user-doc --> |
43 | * <!-- end-user-doc --> |
44 | * @see #getValues() |
45 | * @generated |
46 | * @ordered |
47 | */ |
48 | protected EList<PCMRandomVariable> values; |
49 | |
50 | /** |
51 | * <!-- begin-user-doc --> |
52 | * <!-- end-user-doc --> |
53 | * @generated |
54 | */ |
55 | protected CharacterisedPCMParameterPartitionRangeImpl() { |
56 | super(); |
57 | } |
58 | |
59 | /** |
60 | * <!-- begin-user-doc --> |
61 | * <!-- end-user-doc --> |
62 | * @generated |
63 | */ |
64 | @Override |
65 | protected EClass eStaticClass() { |
66 | return QualityAnnotationPackage.Literals.CHARACTERISED_PCM_PARAMETER_PARTITION_RANGE; |
67 | } |
68 | |
69 | /** |
70 | * <!-- begin-user-doc --> |
71 | * <!-- end-user-doc --> |
72 | * @generated |
73 | */ |
74 | public EList<PCMRandomVariable> getValues() { |
75 | if (values == null) { |
76 | values = new EObjectContainmentEList<PCMRandomVariable>(PCMRandomVariable.class, this, QualityAnnotationPackage.CHARACTERISED_PCM_PARAMETER_PARTITION_RANGE__VALUES); |
77 | } |
78 | return values; |
79 | } |
80 | |
81 | /** |
82 | * <!-- begin-user-doc --> |
83 | * <!-- end-user-doc --> |
84 | * @generated |
85 | */ |
86 | @Override |
87 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
88 | switch (featureID) { |
89 | case QualityAnnotationPackage.CHARACTERISED_PCM_PARAMETER_PARTITION_RANGE__VALUES: |
90 | return ((InternalEList<?>)getValues()).basicRemove(otherEnd, msgs); |
91 | } |
92 | return super.eInverseRemove(otherEnd, featureID, msgs); |
93 | } |
94 | |
95 | /** |
96 | * <!-- begin-user-doc --> |
97 | * <!-- end-user-doc --> |
98 | * @generated |
99 | */ |
100 | @Override |
101 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
102 | switch (featureID) { |
103 | case QualityAnnotationPackage.CHARACTERISED_PCM_PARAMETER_PARTITION_RANGE__VALUES: |
104 | return getValues(); |
105 | } |
106 | return super.eGet(featureID, resolve, coreType); |
107 | } |
108 | |
109 | /** |
110 | * <!-- begin-user-doc --> |
111 | * <!-- end-user-doc --> |
112 | * @generated |
113 | */ |
114 | @SuppressWarnings("unchecked") |
115 | @Override |
116 | public void eSet(int featureID, Object newValue) { |
117 | switch (featureID) { |
118 | case QualityAnnotationPackage.CHARACTERISED_PCM_PARAMETER_PARTITION_RANGE__VALUES: |
119 | getValues().clear(); |
120 | getValues().addAll((Collection<? extends PCMRandomVariable>)newValue); |
121 | return; |
122 | } |
123 | super.eSet(featureID, newValue); |
124 | } |
125 | |
126 | /** |
127 | * <!-- begin-user-doc --> |
128 | * <!-- end-user-doc --> |
129 | * @generated |
130 | */ |
131 | @Override |
132 | public void eUnset(int featureID) { |
133 | switch (featureID) { |
134 | case QualityAnnotationPackage.CHARACTERISED_PCM_PARAMETER_PARTITION_RANGE__VALUES: |
135 | getValues().clear(); |
136 | return; |
137 | } |
138 | super.eUnset(featureID); |
139 | } |
140 | |
141 | /** |
142 | * <!-- begin-user-doc --> |
143 | * <!-- end-user-doc --> |
144 | * @generated |
145 | */ |
146 | @Override |
147 | public boolean eIsSet(int featureID) { |
148 | switch (featureID) { |
149 | case QualityAnnotationPackage.CHARACTERISED_PCM_PARAMETER_PARTITION_RANGE__VALUES: |
150 | return values != null && !values.isEmpty(); |
151 | } |
152 | return super.eIsSet(featureID); |
153 | } |
154 | |
155 | } //CharacterisedPCMParameterPartitionRangeImpl |