EMMA Coverage Report (generated Sun Feb 05 10:43:15 CET 2012)
[all classes][de.uka.ipd.sdq.featureconfig.impl]

COVERAGE SUMMARY FOR SOURCE FILE [ConfigurationImpl.java]

nameclass, %method, %block, %line, %
ConfigurationImpl.java0%   (0/1)0%   (0/16)0%   (0/319)0%   (0/78)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ConfigurationImpl0%   (0/1)0%   (0/16)0%   (0/319)0%   (0/78)
<static initializer> 0%   (0/1)0%   (0/3)0%   (0/2)
ConfigurationImpl (): void 0%   (0/1)0%   (0/6)0%   (0/3)
basicSetDefaultConfig (FeatureConfig, NotificationChain): NotificationChain 0%   (0/1)0%   (0/29)0%   (0/6)
eGet (int, boolean, boolean): Object 0%   (0/1)0%   (0/17)0%   (0/5)
eInverseAdd (InternalEObject, int, NotificationChain): NotificationChain 0%   (0/1)0%   (0/33)0%   (0/6)
eInverseRemove (InternalEObject, int, NotificationChain): NotificationChain 0%   (0/1)0%   (0/20)0%   (0/4)
eIsSet (int): boolean 0%   (0/1)0%   (0/42)0%   (0/5)
eSet (int, Object): void 0%   (0/1)0%   (0/27)0%   (0/10)
eStaticClass (): EClass 0%   (0/1)0%   (0/2)0%   (0/1)
eUnset (int): void 0%   (0/1)0%   (0/18)0%   (0/9)
getConfigOverrides (): EList 0%   (0/1)0%   (0/15)0%   (0/3)
getDefaultConfig (): FeatureConfig 0%   (0/1)0%   (0/3)0%   (0/1)
getName (): String 0%   (0/1)0%   (0/3)0%   (0/1)
setDefaultConfig (FeatureConfig): void 0%   (0/1)0%   (0/52)0%   (0/11)
setName (String): void 0%   (0/1)0%   (0/21)0%   (0/5)
toString (): String 0%   (0/1)0%   (0/28)0%   (0/6)

1/**
2 * <copyright>
3 * </copyright>
4 *
5 * $Id$
6 */
7package de.uka.ipd.sdq.featureconfig.impl;
8 
9import java.util.Collection;
10 
11import org.eclipse.emf.common.notify.Notification;
12import org.eclipse.emf.common.notify.NotificationChain;
13import org.eclipse.emf.common.util.EList;
14import org.eclipse.emf.ecore.EClass;
15import org.eclipse.emf.ecore.InternalEObject;
16import org.eclipse.emf.ecore.impl.ENotificationImpl;
17import org.eclipse.emf.ecore.impl.EObjectImpl;
18import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
19import org.eclipse.emf.ecore.util.InternalEList;
20 
21import de.uka.ipd.sdq.featureconfig.Configuration;
22import de.uka.ipd.sdq.featureconfig.FeatureConfig;
23import de.uka.ipd.sdq.featureconfig.featureconfigPackage;
24 
25/**
26 * <!-- begin-user-doc -->
27 * An implementation of the model object '<em><b>Configuration</b></em>'.
28 * <!-- end-user-doc -->
29 * <p>
30 * The following features are implemented:
31 * <ul>
32 *   <li>{@link de.uka.ipd.sdq.featureconfig.impl.ConfigurationImpl#getDefaultConfig <em>Default Config</em>}</li>
33 *   <li>{@link de.uka.ipd.sdq.featureconfig.impl.ConfigurationImpl#getName <em>Name</em>}</li>
34 *   <li>{@link de.uka.ipd.sdq.featureconfig.impl.ConfigurationImpl#getConfigOverrides <em>Config Overrides</em>}</li>
35 * </ul>
36 * </p>
37 *
38 * @generated
39 */
40public class ConfigurationImpl extends EObjectImpl implements Configuration {
41        /**
42         * The cached value of the '{@link #getDefaultConfig() <em>Default Config</em>}' containment reference.
43         * <!-- begin-user-doc -->
44         * <!-- end-user-doc -->
45         * @see #getDefaultConfig()
46         * @generated
47         * @ordered
48         */
49        protected FeatureConfig defaultConfig;
50 
51        /**
52         * The default value of the '{@link #getName() <em>Name</em>}' attribute.
53         * <!-- begin-user-doc -->
54         * <!-- end-user-doc -->
55         * @see #getName()
56         * @generated
57         * @ordered
58         */
59        protected static final String NAME_EDEFAULT = null;
60 
61        /**
62         * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
63         * <!-- begin-user-doc -->
64         * <!-- end-user-doc -->
65         * @see #getName()
66         * @generated
67         * @ordered
68         */
69        protected String name = NAME_EDEFAULT;
70 
71        /**
72         * The cached value of the '{@link #getConfigOverrides() <em>Config Overrides</em>}' containment reference list.
73         * <!-- begin-user-doc -->
74         * <!-- end-user-doc -->
75         * @see #getConfigOverrides()
76         * @generated
77         * @ordered
78         */
79        protected EList<FeatureConfig> configOverrides;
80 
81        /**
82         * <!-- begin-user-doc -->
83         * <!-- end-user-doc -->
84         * @generated
85         */
86        protected ConfigurationImpl() {
87                super();
88        }
89 
90        /**
91         * <!-- begin-user-doc -->
92         * <!-- end-user-doc -->
93         * @generated
94         */
95        @Override
96        protected EClass eStaticClass() {
97                return featureconfigPackage.Literals.CONFIGURATION;
98        }
99 
100        /**
101         * <!-- begin-user-doc -->
102         * <!-- end-user-doc -->
103         * @generated
104         */
105        public EList<FeatureConfig> getConfigOverrides() {
106                if (configOverrides == null) {
107                        configOverrides = new EObjectContainmentWithInverseEList<FeatureConfig>(FeatureConfig.class, this, featureconfigPackage.CONFIGURATION__CONFIG_OVERRIDES, featureconfigPackage.FEATURE_CONFIG__CONFIGURATION_OVERRIDES);
108                }
109                return configOverrides;
110        }
111 
112        /**
113         * <!-- begin-user-doc -->
114         * <!-- end-user-doc -->
115         * @generated
116         */
117        @SuppressWarnings("unchecked")
118        @Override
119        public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
120                switch (featureID) {
121                        case featureconfigPackage.CONFIGURATION__DEFAULT_CONFIG:
122                                if (defaultConfig != null)
123                                        msgs = ((InternalEObject)defaultConfig).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - featureconfigPackage.CONFIGURATION__DEFAULT_CONFIG, null, msgs);
124                                return basicSetDefaultConfig((FeatureConfig)otherEnd, msgs);
125                        case featureconfigPackage.CONFIGURATION__CONFIG_OVERRIDES:
126                                return ((InternalEList<InternalEObject>)(InternalEList<?>)getConfigOverrides()).basicAdd(otherEnd, msgs);
127                }
128                return super.eInverseAdd(otherEnd, featureID, msgs);
129        }
130 
131        /**
132         * <!-- begin-user-doc -->
133         * <!-- end-user-doc -->
134         * @generated
135         */
136        public FeatureConfig getDefaultConfig() {
137                return defaultConfig;
138        }
139 
140        /**
141         * <!-- begin-user-doc -->
142         * <!-- end-user-doc -->
143         * @generated
144         */
145        public NotificationChain basicSetDefaultConfig(FeatureConfig newDefaultConfig, NotificationChain msgs) {
146                FeatureConfig oldDefaultConfig = defaultConfig;
147                defaultConfig = newDefaultConfig;
148                if (eNotificationRequired()) {
149                        ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, featureconfigPackage.CONFIGURATION__DEFAULT_CONFIG, oldDefaultConfig, newDefaultConfig);
150                        if (msgs == null) msgs = notification; else msgs.add(notification);
151                }
152                return msgs;
153        }
154 
155        /**
156         * <!-- begin-user-doc -->
157         * <!-- end-user-doc -->
158         * @generated
159         */
160        public void setDefaultConfig(FeatureConfig newDefaultConfig) {
161                if (newDefaultConfig != defaultConfig) {
162                        NotificationChain msgs = null;
163                        if (defaultConfig != null)
164                                msgs = ((InternalEObject)defaultConfig).eInverseRemove(this, featureconfigPackage.FEATURE_CONFIG__CONFIGURATION_DEFAULT, FeatureConfig.class, msgs);
165                        if (newDefaultConfig != null)
166                                msgs = ((InternalEObject)newDefaultConfig).eInverseAdd(this, featureconfigPackage.FEATURE_CONFIG__CONFIGURATION_DEFAULT, FeatureConfig.class, msgs);
167                        msgs = basicSetDefaultConfig(newDefaultConfig, msgs);
168                        if (msgs != null) msgs.dispatch();
169                }
170                else if (eNotificationRequired())
171                        eNotify(new ENotificationImpl(this, Notification.SET, featureconfigPackage.CONFIGURATION__DEFAULT_CONFIG, newDefaultConfig, newDefaultConfig));
172        }
173 
174        /**
175         * <!-- begin-user-doc -->
176         * <!-- end-user-doc -->
177         * @generated
178         */
179        public String getName() {
180                return name;
181        }
182 
183        /**
184         * <!-- begin-user-doc -->
185         * <!-- end-user-doc -->
186         * @generated
187         */
188        public void setName(String newName) {
189                String oldName = name;
190                name = newName;
191                if (eNotificationRequired())
192                        eNotify(new ENotificationImpl(this, Notification.SET, featureconfigPackage.CONFIGURATION__NAME, oldName, name));
193        }
194 
195        /**
196         * <!-- begin-user-doc -->
197         * <!-- end-user-doc -->
198         * @generated
199         */
200        @Override
201        public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
202                switch (featureID) {
203                        case featureconfigPackage.CONFIGURATION__DEFAULT_CONFIG:
204                                return basicSetDefaultConfig(null, msgs);
205                        case featureconfigPackage.CONFIGURATION__CONFIG_OVERRIDES:
206                                return ((InternalEList<?>)getConfigOverrides()).basicRemove(otherEnd, msgs);
207                }
208                return super.eInverseRemove(otherEnd, featureID, msgs);
209        }
210 
211        /**
212         * <!-- begin-user-doc -->
213         * <!-- end-user-doc -->
214         * @generated
215         */
216        @Override
217        public Object eGet(int featureID, boolean resolve, boolean coreType) {
218                switch (featureID) {
219                        case featureconfigPackage.CONFIGURATION__DEFAULT_CONFIG:
220                                return getDefaultConfig();
221                        case featureconfigPackage.CONFIGURATION__NAME:
222                                return getName();
223                        case featureconfigPackage.CONFIGURATION__CONFIG_OVERRIDES:
224                                return getConfigOverrides();
225                }
226                return super.eGet(featureID, resolve, coreType);
227        }
228 
229        /**
230         * <!-- begin-user-doc -->
231         * <!-- end-user-doc -->
232         * @generated
233         */
234        @SuppressWarnings("unchecked")
235        @Override
236        public void eSet(int featureID, Object newValue) {
237                switch (featureID) {
238                        case featureconfigPackage.CONFIGURATION__DEFAULT_CONFIG:
239                                setDefaultConfig((FeatureConfig)newValue);
240                                return;
241                        case featureconfigPackage.CONFIGURATION__NAME:
242                                setName((String)newValue);
243                                return;
244                        case featureconfigPackage.CONFIGURATION__CONFIG_OVERRIDES:
245                                getConfigOverrides().clear();
246                                getConfigOverrides().addAll((Collection<? extends FeatureConfig>)newValue);
247                                return;
248                }
249                super.eSet(featureID, newValue);
250        }
251 
252        /**
253         * <!-- begin-user-doc -->
254         * <!-- end-user-doc -->
255         * @generated
256         */
257        @Override
258        public void eUnset(int featureID) {
259                switch (featureID) {
260                        case featureconfigPackage.CONFIGURATION__DEFAULT_CONFIG:
261                                setDefaultConfig((FeatureConfig)null);
262                                return;
263                        case featureconfigPackage.CONFIGURATION__NAME:
264                                setName(NAME_EDEFAULT);
265                                return;
266                        case featureconfigPackage.CONFIGURATION__CONFIG_OVERRIDES:
267                                getConfigOverrides().clear();
268                                return;
269                }
270                super.eUnset(featureID);
271        }
272 
273        /**
274         * <!-- begin-user-doc -->
275         * <!-- end-user-doc -->
276         * @generated
277         */
278        @Override
279        public boolean eIsSet(int featureID) {
280                switch (featureID) {
281                        case featureconfigPackage.CONFIGURATION__DEFAULT_CONFIG:
282                                return defaultConfig != null;
283                        case featureconfigPackage.CONFIGURATION__NAME:
284                                return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
285                        case featureconfigPackage.CONFIGURATION__CONFIG_OVERRIDES:
286                                return configOverrides != null && !configOverrides.isEmpty();
287                }
288                return super.eIsSet(featureID);
289        }
290 
291        /**
292         * <!-- begin-user-doc -->
293         * <!-- end-user-doc -->
294         * @generated
295         */
296        @Override
297        public String toString() {
298                if (eIsProxy()) return super.toString();
299 
300                StringBuffer result = new StringBuffer(super.toString());
301                result.append(" (name: ");
302                result.append(name);
303                result.append(')');
304                return result.toString();
305        }
306 
307} //ConfigurationImpl

[all classes][de.uka.ipd.sdq.featureconfig.impl]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov