Skip to content

Package: CrossReferenceContentImpl

CrossReferenceContentImpl

nameinstructionbranchcomplexitylinemethod
CrossReferenceContentImpl()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
basicSetParent(CrossReferenceContainer, NotificationChain)
M: 0 C: 9
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
basicSetSingleParent(CrossReferenceContainer, NotificationChain)
M: 0 C: 9
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
eBasicRemoveFromContainerFeature(NotificationChain)
M: 4 C: 19
83%
M: 1 C: 2
67%
M: 1 C: 2
67%
M: 1 C: 5
83%
M: 0 C: 1
100%
eGet(int, boolean, boolean)
M: 14 C: 0
0%
M: 3 C: 0
0%
M: 3 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%
eInverseAdd(InternalEObject, int, NotificationChain)
M: 6 C: 28
82%
M: 1 C: 6
86%
M: 1 C: 4
80%
M: 1 C: 7
88%
M: 0 C: 1
100%
eInverseRemove(InternalEObject, int, NotificationChain)
M: 6 C: 12
67%
M: 1 C: 2
67%
M: 1 C: 2
67%
M: 1 C: 3
75%
M: 0 C: 1
100%
eIsSet(int)
M: 20 C: 0
0%
M: 7 C: 0
0%
M: 5 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%
eSet(int, Object)
M: 17 C: 0
0%
M: 3 C: 0
0%
M: 3 C: 0
0%
M: 7 C: 0
0%
M: 1 C: 0
0%
eStaticClass()
M: 0 C: 2
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
eUnset(int)
M: 14 C: 0
0%
M: 3 C: 0
0%
M: 3 C: 0
0%
M: 7 C: 0
0%
M: 1 C: 0
0%
getParent()
M: 9 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
getSingleParent()
M: 10 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
setParent(CrossReferenceContainer)
M: 68 C: 0
0%
M: 16 C: 0
0%
M: 9 C: 0
0%
M: 17 C: 0
0%
M: 1 C: 0
0%
setSingleParent(CrossReferenceContainer)
M: 69 C: 0
0%
M: 16 C: 0
0%
M: 9 C: 0
0%
M: 17 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /**
2: * Copyright (c) 2011-2014 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * Eugen Neufeld - initial API and implementation
13: */
14: package org.eclipse.emf.ecp.view.validation.test.model.impl;
15:
16: import org.eclipse.emf.common.notify.Notification;
17: import org.eclipse.emf.common.notify.NotificationChain;
18: import org.eclipse.emf.ecore.EClass;
19: import org.eclipse.emf.ecore.InternalEObject;
20: import org.eclipse.emf.ecore.impl.ENotificationImpl;
21: import org.eclipse.emf.ecore.impl.EObjectImpl;
22: import org.eclipse.emf.ecore.util.EcoreUtil;
23: import org.eclipse.emf.ecp.view.validation.test.model.CrossReferenceContainer;
24: import org.eclipse.emf.ecp.view.validation.test.model.CrossReferenceContent;
25: import org.eclipse.emf.ecp.view.validation.test.model.TestPackage;
26:
27: /**
28: * <!-- begin-user-doc -->
29: * An implementation of the model object '<em><b>Cross Reference Content</b></em>'.
30: * <!-- end-user-doc -->
31: * <p>
32: * The following features are implemented:
33: * </p>
34: * <ul>
35: * <li>{@link org.eclipse.emf.ecp.view.validation.test.model.impl.CrossReferenceContentImpl#getParent <em>Parent</em>}
36: * </li>
37: * <li>{@link org.eclipse.emf.ecp.view.validation.test.model.impl.CrossReferenceContentImpl#getSingleParent
38: * <em>Single Parent</em>}</li>
39: * </ul>
40: *
41: * @generated
42: */
43: public class CrossReferenceContentImpl extends EObjectImpl implements CrossReferenceContent {
44:         /**
45:          * <!-- begin-user-doc -->
46:          * <!-- end-user-doc -->
47:          *
48:          * @generated
49:          */
50:         protected CrossReferenceContentImpl() {
51:                 super();
52:         }
53:
54:         /**
55:          * <!-- begin-user-doc -->
56:          * <!-- end-user-doc -->
57:          *
58:          * @generated
59:          */
60:         @Override
61:         protected EClass eStaticClass() {
62:                 return TestPackage.Literals.CROSS_REFERENCE_CONTENT;
63:         }
64:
65:         /**
66:          * <!-- begin-user-doc -->
67:          * <!-- end-user-doc -->
68:          *
69:          * @generated
70:          */
71:         @Override
72:         public CrossReferenceContainer getParent() {
73:•                if (eContainerFeatureID() != TestPackage.CROSS_REFERENCE_CONTENT__PARENT) {
74:                         return null;
75:                 }
76:                 return (CrossReferenceContainer) eInternalContainer();
77:         }
78:
79:         /**
80:          * <!-- begin-user-doc -->
81:          * <!-- end-user-doc -->
82:          *
83:          * @generated
84:          */
85:         public NotificationChain basicSetParent(CrossReferenceContainer newParent, NotificationChain msgs) {
86:                 msgs = eBasicSetContainer((InternalEObject) newParent, TestPackage.CROSS_REFERENCE_CONTENT__PARENT, msgs);
87:                 return msgs;
88:         }
89:
90:         /**
91:          * <!-- begin-user-doc -->
92:          * <!-- end-user-doc -->
93:          *
94:          * @generated
95:          */
96:         @Override
97:         public void setParent(CrossReferenceContainer newParent) {
98:•                if (newParent != eInternalContainer()
99:•                        || eContainerFeatureID() != TestPackage.CROSS_REFERENCE_CONTENT__PARENT && newParent != null) {
100:•                        if (EcoreUtil.isAncestor(this, newParent)) {
101:                                 throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
102:                         }
103:                         NotificationChain msgs = null;
104:•                        if (eInternalContainer() != null) {
105:                                 msgs = eBasicRemoveFromContainer(msgs);
106:                         }
107:•                        if (newParent != null) {
108:                                 msgs = ((InternalEObject) newParent).eInverseAdd(this, TestPackage.CROSS_REFERENCE_CONTAINER__CONTENTS,
109:                                         CrossReferenceContainer.class, msgs);
110:                         }
111:                         msgs = basicSetParent(newParent, msgs);
112:•                        if (msgs != null) {
113:                                 msgs.dispatch();
114:                         }
115:•                } else if (eNotificationRequired()) {
116:                         eNotify(new ENotificationImpl(this, Notification.SET, TestPackage.CROSS_REFERENCE_CONTENT__PARENT,
117:                                 newParent, newParent));
118:                 }
119:         }
120:
121:         /**
122:          * <!-- begin-user-doc -->
123:          * <!-- end-user-doc -->
124:          *
125:          * @generated
126:          */
127:         @Override
128:         public CrossReferenceContainer getSingleParent() {
129:•                if (eContainerFeatureID() != TestPackage.CROSS_REFERENCE_CONTENT__SINGLE_PARENT) {
130:                         return null;
131:                 }
132:                 return (CrossReferenceContainer) eInternalContainer();
133:         }
134:
135:         /**
136:          * <!-- begin-user-doc -->
137:          * <!-- end-user-doc -->
138:          *
139:          * @generated
140:          */
141:         public NotificationChain basicSetSingleParent(CrossReferenceContainer newSingleParent, NotificationChain msgs) {
142:                 msgs = eBasicSetContainer((InternalEObject) newSingleParent, TestPackage.CROSS_REFERENCE_CONTENT__SINGLE_PARENT,
143:                         msgs);
144:                 return msgs;
145:         }
146:
147:         /**
148:          * <!-- begin-user-doc -->
149:          * <!-- end-user-doc -->
150:          *
151:          * @generated
152:          */
153:         @Override
154:         public void setSingleParent(CrossReferenceContainer newSingleParent) {
155:•                if (newSingleParent != eInternalContainer()
156:•                        || eContainerFeatureID() != TestPackage.CROSS_REFERENCE_CONTENT__SINGLE_PARENT && newSingleParent != null) {
157:•                        if (EcoreUtil.isAncestor(this, newSingleParent)) {
158:                                 throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
159:                         }
160:                         NotificationChain msgs = null;
161:•                        if (eInternalContainer() != null) {
162:                                 msgs = eBasicRemoveFromContainer(msgs);
163:                         }
164:•                        if (newSingleParent != null) {
165:                                 msgs = ((InternalEObject) newSingleParent).eInverseAdd(this,
166:                                         TestPackage.CROSS_REFERENCE_CONTAINER__SINGLE_CONTENT, CrossReferenceContainer.class, msgs);
167:                         }
168:                         msgs = basicSetSingleParent(newSingleParent, msgs);
169:•                        if (msgs != null) {
170:                                 msgs.dispatch();
171:                         }
172:•                } else if (eNotificationRequired()) {
173:                         eNotify(new ENotificationImpl(this, Notification.SET, TestPackage.CROSS_REFERENCE_CONTENT__SINGLE_PARENT,
174:                                 newSingleParent, newSingleParent));
175:                 }
176:         }
177:
178:         /**
179:          * <!-- begin-user-doc -->
180:          * <!-- end-user-doc -->
181:          *
182:          * @generated
183:          */
184:         @Override
185:         public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
186:•                switch (featureID) {
187:                 case TestPackage.CROSS_REFERENCE_CONTENT__PARENT:
188:•                        if (eInternalContainer() != null) {
189:                                 msgs = eBasicRemoveFromContainer(msgs);
190:                         }
191:                         return basicSetParent((CrossReferenceContainer) otherEnd, msgs);
192:                 case TestPackage.CROSS_REFERENCE_CONTENT__SINGLE_PARENT:
193:•                        if (eInternalContainer() != null) {
194:                                 msgs = eBasicRemoveFromContainer(msgs);
195:                         }
196:                         return basicSetSingleParent((CrossReferenceContainer) otherEnd, msgs);
197:                 }
198:                 return super.eInverseAdd(otherEnd, featureID, msgs);
199:         }
200:
201:         /**
202:          * <!-- begin-user-doc -->
203:          * <!-- end-user-doc -->
204:          *
205:          * @generated
206:          */
207:         @Override
208:         public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
209:•                switch (featureID) {
210:                 case TestPackage.CROSS_REFERENCE_CONTENT__PARENT:
211:                         return basicSetParent(null, msgs);
212:                 case TestPackage.CROSS_REFERENCE_CONTENT__SINGLE_PARENT:
213:                         return basicSetSingleParent(null, msgs);
214:                 }
215:                 return super.eInverseRemove(otherEnd, featureID, msgs);
216:         }
217:
218:         /**
219:          * <!-- begin-user-doc -->
220:          * <!-- end-user-doc -->
221:          *
222:          * @generated
223:          */
224:         @Override
225:         public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) {
226:•                switch (eContainerFeatureID()) {
227:                 case TestPackage.CROSS_REFERENCE_CONTENT__PARENT:
228:                         return eInternalContainer().eInverseRemove(this, TestPackage.CROSS_REFERENCE_CONTAINER__CONTENTS,
229:                                 CrossReferenceContainer.class, msgs);
230:                 case TestPackage.CROSS_REFERENCE_CONTENT__SINGLE_PARENT:
231:                         return eInternalContainer().eInverseRemove(this, TestPackage.CROSS_REFERENCE_CONTAINER__SINGLE_CONTENT,
232:                                 CrossReferenceContainer.class, msgs);
233:                 }
234:                 return super.eBasicRemoveFromContainerFeature(msgs);
235:         }
236:
237:         /**
238:          * <!-- begin-user-doc -->
239:          * <!-- end-user-doc -->
240:          *
241:          * @generated
242:          */
243:         @Override
244:         public Object eGet(int featureID, boolean resolve, boolean coreType) {
245:•                switch (featureID) {
246:                 case TestPackage.CROSS_REFERENCE_CONTENT__PARENT:
247:                         return getParent();
248:                 case TestPackage.CROSS_REFERENCE_CONTENT__SINGLE_PARENT:
249:                         return getSingleParent();
250:                 }
251:                 return super.eGet(featureID, resolve, coreType);
252:         }
253:
254:         /**
255:          * <!-- begin-user-doc -->
256:          * <!-- end-user-doc -->
257:          *
258:          * @generated
259:          */
260:         @Override
261:         public void eSet(int featureID, Object newValue) {
262:•                switch (featureID) {
263:                 case TestPackage.CROSS_REFERENCE_CONTENT__PARENT:
264:                         setParent((CrossReferenceContainer) newValue);
265:                         return;
266:                 case TestPackage.CROSS_REFERENCE_CONTENT__SINGLE_PARENT:
267:                         setSingleParent((CrossReferenceContainer) newValue);
268:                         return;
269:                 }
270:                 super.eSet(featureID, newValue);
271:         }
272:
273:         /**
274:          * <!-- begin-user-doc -->
275:          * <!-- end-user-doc -->
276:          *
277:          * @generated
278:          */
279:         @Override
280:         public void eUnset(int featureID) {
281:•                switch (featureID) {
282:                 case TestPackage.CROSS_REFERENCE_CONTENT__PARENT:
283:                         setParent((CrossReferenceContainer) null);
284:                         return;
285:                 case TestPackage.CROSS_REFERENCE_CONTENT__SINGLE_PARENT:
286:                         setSingleParent((CrossReferenceContainer) null);
287:                         return;
288:                 }
289:                 super.eUnset(featureID);
290:         }
291:
292:         /**
293:          * <!-- begin-user-doc -->
294:          * <!-- end-user-doc -->
295:          *
296:          * @generated
297:          */
298:         @Override
299:         public boolean eIsSet(int featureID) {
300:•                switch (featureID) {
301:                 case TestPackage.CROSS_REFERENCE_CONTENT__PARENT:
302:•                        return getParent() != null;
303:                 case TestPackage.CROSS_REFERENCE_CONTENT__SINGLE_PARENT:
304:•                        return getSingleParent() != null;
305:                 }
306:                 return super.eIsSet(featureID);
307:         }
308:
309: } // CrossReferenceContentImpl