Skip to content

Package: ReferencerImpl

ReferencerImpl

nameinstructionbranchcomplexitylinemethod
ReferencerImpl()
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%
basicGetReferencedContent()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
eGet(int, boolean, boolean)
M: 9 C: 7
44%
M: 2 C: 2
50%
M: 2 C: 1
33%
M: 2 C: 3
60%
M: 0 C: 1
100%
eIsSet(int)
M: 13 C: 0
0%
M: 4 C: 0
0%
M: 3 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
eSet(int, Object)
M: 12 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 5 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: 10 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
getReferencedContent()
M: 28 C: 10
26%
M: 6 C: 2
25%
M: 4 C: 1
20%
M: 6 C: 2
25%
M: 0 C: 1
100%
setReferencedContent(Computer)
M: 11 C: 10
48%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 2 C: 4
67%
M: 0 C: 1
100%

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.ecore.EClass;
18: import org.eclipse.emf.ecore.InternalEObject;
19: import org.eclipse.emf.ecore.impl.ENotificationImpl;
20: import org.eclipse.emf.ecore.impl.EObjectImpl;
21: import org.eclipse.emf.ecp.view.validation.test.model.Computer;
22: import org.eclipse.emf.ecp.view.validation.test.model.Referencer;
23: import org.eclipse.emf.ecp.view.validation.test.model.TestPackage;
24:
25: /**
26: * <!-- begin-user-doc -->
27: * An implementation of the model object '<em><b>Referencer</b></em>'.
28: * <!-- end-user-doc -->
29: * <p>
30: * The following features are implemented:
31: * </p>
32: * <ul>
33: * <li>{@link org.eclipse.emf.ecp.view.validation.test.model.impl.ReferencerImpl#getReferencedContent
34: * <em>Referenced Content</em>}</li>
35: * </ul>
36: *
37: * @generated
38: */
39: public class ReferencerImpl extends EObjectImpl implements Referencer {
40:         /**
41:          * The cached value of the '{@link #getReferencedContent() <em>Referenced Content</em>}' reference.
42:          * <!-- begin-user-doc -->
43:          * <!-- end-user-doc -->
44:          *
45:          * @see #getReferencedContent()
46:          * @generated
47:          * @ordered
48:          */
49:         protected Computer referencedContent;
50:
51:         /**
52:          * <!-- begin-user-doc -->
53:          * <!-- end-user-doc -->
54:          *
55:          * @generated
56:          */
57:         protected ReferencerImpl() {
58:                 super();
59:         }
60:
61:         /**
62:          * <!-- begin-user-doc -->
63:          * <!-- end-user-doc -->
64:          *
65:          * @generated
66:          */
67:         @Override
68:         protected EClass eStaticClass() {
69:                 return TestPackage.Literals.REFERENCER;
70:         }
71:
72:         /**
73:          * <!-- begin-user-doc -->
74:          * <!-- end-user-doc -->
75:          *
76:          * @generated
77:          */
78:         @Override
79:         public Computer getReferencedContent() {
80:•                if (referencedContent != null && referencedContent.eIsProxy()) {
81:                         final InternalEObject oldReferencedContent = (InternalEObject) referencedContent;
82:                         referencedContent = (Computer) eResolveProxy(oldReferencedContent);
83:•                        if (referencedContent != oldReferencedContent) {
84:•                                if (eNotificationRequired()) {
85:                                         eNotify(new ENotificationImpl(this, Notification.RESOLVE,
86:                                                 TestPackage.REFERENCER__REFERENCED_CONTENT, oldReferencedContent, referencedContent));
87:                                 }
88:                         }
89:                 }
90:                 return referencedContent;
91:         }
92:
93:         /**
94:          * <!-- begin-user-doc -->
95:          * <!-- end-user-doc -->
96:          *
97:          * @generated
98:          */
99:         public Computer basicGetReferencedContent() {
100:                 return referencedContent;
101:         }
102:
103:         /**
104:          * <!-- begin-user-doc -->
105:          * <!-- end-user-doc -->
106:          *
107:          * @generated
108:          */
109:         @Override
110:         public void setReferencedContent(Computer newReferencedContent) {
111:                 final Computer oldReferencedContent = referencedContent;
112:                 referencedContent = newReferencedContent;
113:•                if (eNotificationRequired()) {
114:                         eNotify(new ENotificationImpl(this, Notification.SET, TestPackage.REFERENCER__REFERENCED_CONTENT,
115:                                 oldReferencedContent, referencedContent));
116:                 }
117:         }
118:
119:         /**
120:          * <!-- begin-user-doc -->
121:          * <!-- end-user-doc -->
122:          *
123:          * @generated
124:          */
125:         @Override
126:         public Object eGet(int featureID, boolean resolve, boolean coreType) {
127:•                switch (featureID) {
128:                 case TestPackage.REFERENCER__REFERENCED_CONTENT:
129:•                        if (resolve) {
130:                                 return getReferencedContent();
131:                         }
132:                         return basicGetReferencedContent();
133:                 }
134:                 return super.eGet(featureID, resolve, coreType);
135:         }
136:
137:         /**
138:          * <!-- begin-user-doc -->
139:          * <!-- end-user-doc -->
140:          *
141:          * @generated
142:          */
143:         @Override
144:         public void eSet(int featureID, Object newValue) {
145:•                switch (featureID) {
146:                 case TestPackage.REFERENCER__REFERENCED_CONTENT:
147:                         setReferencedContent((Computer) newValue);
148:                         return;
149:                 }
150:                 super.eSet(featureID, newValue);
151:         }
152:
153:         /**
154:          * <!-- begin-user-doc -->
155:          * <!-- end-user-doc -->
156:          *
157:          * @generated
158:          */
159:         @Override
160:         public void eUnset(int featureID) {
161:•                switch (featureID) {
162:                 case TestPackage.REFERENCER__REFERENCED_CONTENT:
163:                         setReferencedContent((Computer) null);
164:                         return;
165:                 }
166:                 super.eUnset(featureID);
167:         }
168:
169:         /**
170:          * <!-- begin-user-doc -->
171:          * <!-- end-user-doc -->
172:          *
173:          * @generated
174:          */
175:         @Override
176:         public boolean eIsSet(int featureID) {
177:•                switch (featureID) {
178:                 case TestPackage.REFERENCER__REFERENCED_CONTENT:
179:•                        return referencedContent != null;
180:                 }
181:                 return super.eIsSet(featureID);
182:         }
183:
184: } // ReferencerImpl