1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package de.uka.ipd.sdq.sensitivity.impl; |
8 | |
9 | import de.uka.ipd.sdq.sensitivity.DoubleOffsetSequence; |
10 | import de.uka.ipd.sdq.sensitivity.DoubleOffsetType; |
11 | import de.uka.ipd.sdq.sensitivity.SensitivityPackage; |
12 | |
13 | import java.util.Collection; |
14 | |
15 | import org.eclipse.emf.common.notify.Notification; |
16 | |
17 | import org.eclipse.emf.common.util.EList; |
18 | |
19 | import org.eclipse.emf.ecore.EClass; |
20 | |
21 | import org.eclipse.emf.ecore.impl.ENotificationImpl; |
22 | |
23 | import org.eclipse.emf.ecore.util.EDataTypeEList; |
24 | import org.eclipse.emf.ecore.util.EDataTypeUniqueEList; |
25 | |
26 | /** |
27 | * <!-- begin-user-doc --> |
28 | * An implementation of the model object '<em><b>Double Offset Sequence</b></em>'. |
29 | * <!-- end-user-doc --> |
30 | * <p> |
31 | * The following features are implemented: |
32 | * <ul> |
33 | * <li>{@link de.uka.ipd.sdq.sensitivity.impl.DoubleOffsetSequenceImpl#getOffsetValues <em>Offset Values</em>}</li> |
34 | * <li>{@link de.uka.ipd.sdq.sensitivity.impl.DoubleOffsetSequenceImpl#getDoubleOffsetType__DoubleOffsetSequence <em>Double Offset Type Double Offset Sequence</em>}</li> |
35 | * </ul> |
36 | * </p> |
37 | * |
38 | * @generated |
39 | */ |
40 | public class DoubleOffsetSequenceImpl extends DoubleParameterVariationImpl implements DoubleOffsetSequence { |
41 | /** |
42 | * The cached value of the '{@link #getOffsetValues() <em>Offset Values</em>}' attribute list. |
43 | * <!-- begin-user-doc --> |
44 | * <!-- end-user-doc --> |
45 | * @see #getOffsetValues() |
46 | * @generated |
47 | * @ordered |
48 | */ |
49 | protected EList<Double> offsetValues; |
50 | |
51 | /** |
52 | * The default value of the '{@link #getDoubleOffsetType__DoubleOffsetSequence() <em>Double Offset Type Double Offset Sequence</em>}' attribute. |
53 | * <!-- begin-user-doc --> |
54 | * <!-- end-user-doc --> |
55 | * @see #getDoubleOffsetType__DoubleOffsetSequence() |
56 | * @generated |
57 | * @ordered |
58 | */ |
59 | protected static final DoubleOffsetType DOUBLE_OFFSET_TYPE_DOUBLE_OFFSET_SEQUENCE_EDEFAULT = DoubleOffsetType.ADD; |
60 | |
61 | /** |
62 | * The cached value of the '{@link #getDoubleOffsetType__DoubleOffsetSequence() <em>Double Offset Type Double Offset Sequence</em>}' attribute. |
63 | * <!-- begin-user-doc --> |
64 | * <!-- end-user-doc --> |
65 | * @see #getDoubleOffsetType__DoubleOffsetSequence() |
66 | * @generated |
67 | * @ordered |
68 | */ |
69 | protected DoubleOffsetType doubleOffsetType__DoubleOffsetSequence = DOUBLE_OFFSET_TYPE_DOUBLE_OFFSET_SEQUENCE_EDEFAULT; |
70 | |
71 | /** |
72 | * <!-- begin-user-doc --> |
73 | * <!-- end-user-doc --> |
74 | * @generated |
75 | */ |
76 | protected DoubleOffsetSequenceImpl() { |
77 | super(); |
78 | } |
79 | |
80 | /** |
81 | * <!-- begin-user-doc --> |
82 | * <!-- end-user-doc --> |
83 | * @generated |
84 | */ |
85 | @Override |
86 | protected EClass eStaticClass() { |
87 | return SensitivityPackage.Literals.DOUBLE_OFFSET_SEQUENCE; |
88 | } |
89 | |
90 | /** |
91 | * <!-- begin-user-doc --> |
92 | * <!-- end-user-doc --> |
93 | * @generated |
94 | */ |
95 | public EList<Double> getOffsetValues() { |
96 | if (offsetValues == null) { |
97 | offsetValues = new EDataTypeEList<Double>(Double.class, this, SensitivityPackage.DOUBLE_OFFSET_SEQUENCE__OFFSET_VALUES); |
98 | } |
99 | return offsetValues; |
100 | } |
101 | |
102 | /** |
103 | * <!-- begin-user-doc --> |
104 | * <!-- end-user-doc --> |
105 | * @generated |
106 | */ |
107 | public DoubleOffsetType getDoubleOffsetType__DoubleOffsetSequence() { |
108 | return doubleOffsetType__DoubleOffsetSequence; |
109 | } |
110 | |
111 | /** |
112 | * <!-- begin-user-doc --> |
113 | * <!-- end-user-doc --> |
114 | * @generated |
115 | */ |
116 | public void setDoubleOffsetType__DoubleOffsetSequence(DoubleOffsetType newDoubleOffsetType__DoubleOffsetSequence) { |
117 | DoubleOffsetType oldDoubleOffsetType__DoubleOffsetSequence = doubleOffsetType__DoubleOffsetSequence; |
118 | doubleOffsetType__DoubleOffsetSequence = newDoubleOffsetType__DoubleOffsetSequence == null ? DOUBLE_OFFSET_TYPE_DOUBLE_OFFSET_SEQUENCE_EDEFAULT : newDoubleOffsetType__DoubleOffsetSequence; |
119 | if (eNotificationRequired()) |
120 | eNotify(new ENotificationImpl(this, Notification.SET, SensitivityPackage.DOUBLE_OFFSET_SEQUENCE__DOUBLE_OFFSET_TYPE_DOUBLE_OFFSET_SEQUENCE, oldDoubleOffsetType__DoubleOffsetSequence, doubleOffsetType__DoubleOffsetSequence)); |
121 | } |
122 | |
123 | /** |
124 | * <!-- begin-user-doc --> |
125 | * <!-- end-user-doc --> |
126 | * @generated |
127 | */ |
128 | @Override |
129 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
130 | switch (featureID) { |
131 | case SensitivityPackage.DOUBLE_OFFSET_SEQUENCE__OFFSET_VALUES: |
132 | return getOffsetValues(); |
133 | case SensitivityPackage.DOUBLE_OFFSET_SEQUENCE__DOUBLE_OFFSET_TYPE_DOUBLE_OFFSET_SEQUENCE: |
134 | return getDoubleOffsetType__DoubleOffsetSequence(); |
135 | } |
136 | return super.eGet(featureID, resolve, coreType); |
137 | } |
138 | |
139 | /** |
140 | * <!-- begin-user-doc --> |
141 | * <!-- end-user-doc --> |
142 | * @generated |
143 | */ |
144 | @SuppressWarnings("unchecked") |
145 | @Override |
146 | public void eSet(int featureID, Object newValue) { |
147 | switch (featureID) { |
148 | case SensitivityPackage.DOUBLE_OFFSET_SEQUENCE__OFFSET_VALUES: |
149 | getOffsetValues().clear(); |
150 | getOffsetValues().addAll((Collection<? extends Double>)newValue); |
151 | return; |
152 | case SensitivityPackage.DOUBLE_OFFSET_SEQUENCE__DOUBLE_OFFSET_TYPE_DOUBLE_OFFSET_SEQUENCE: |
153 | setDoubleOffsetType__DoubleOffsetSequence((DoubleOffsetType)newValue); |
154 | return; |
155 | } |
156 | super.eSet(featureID, newValue); |
157 | } |
158 | |
159 | /** |
160 | * <!-- begin-user-doc --> |
161 | * <!-- end-user-doc --> |
162 | * @generated |
163 | */ |
164 | @Override |
165 | public void eUnset(int featureID) { |
166 | switch (featureID) { |
167 | case SensitivityPackage.DOUBLE_OFFSET_SEQUENCE__OFFSET_VALUES: |
168 | getOffsetValues().clear(); |
169 | return; |
170 | case SensitivityPackage.DOUBLE_OFFSET_SEQUENCE__DOUBLE_OFFSET_TYPE_DOUBLE_OFFSET_SEQUENCE: |
171 | setDoubleOffsetType__DoubleOffsetSequence(DOUBLE_OFFSET_TYPE_DOUBLE_OFFSET_SEQUENCE_EDEFAULT); |
172 | return; |
173 | } |
174 | super.eUnset(featureID); |
175 | } |
176 | |
177 | /** |
178 | * <!-- begin-user-doc --> |
179 | * <!-- end-user-doc --> |
180 | * @generated |
181 | */ |
182 | @Override |
183 | public boolean eIsSet(int featureID) { |
184 | switch (featureID) { |
185 | case SensitivityPackage.DOUBLE_OFFSET_SEQUENCE__OFFSET_VALUES: |
186 | return offsetValues != null && !offsetValues.isEmpty(); |
187 | case SensitivityPackage.DOUBLE_OFFSET_SEQUENCE__DOUBLE_OFFSET_TYPE_DOUBLE_OFFSET_SEQUENCE: |
188 | return doubleOffsetType__DoubleOffsetSequence != DOUBLE_OFFSET_TYPE_DOUBLE_OFFSET_SEQUENCE_EDEFAULT; |
189 | } |
190 | return super.eIsSet(featureID); |
191 | } |
192 | |
193 | /** |
194 | * <!-- begin-user-doc --> |
195 | * <!-- end-user-doc --> |
196 | * @generated |
197 | */ |
198 | @Override |
199 | public String toString() { |
200 | if (eIsProxy()) return super.toString(); |
201 | |
202 | StringBuffer result = new StringBuffer(super.toString()); |
203 | result.append(" (offsetValues: "); |
204 | result.append(offsetValues); |
205 | result.append(", doubleOffsetType__DoubleOffsetSequence: "); |
206 | result.append(doubleOffsetType__DoubleOffsetSequence); |
207 | result.append(')'); |
208 | return result.toString(); |
209 | } |
210 | |
211 | } //DoubleOffsetSequenceImpl |