Skip to content

Package: ComponentImpl

ComponentImpl

nameinstructionbranchcomplexitylinemethod
ComponentImpl()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
basicSetComponent(Component2, NotificationChain)
M: 29 C: 0
0%
M: 4 C: 0
0%
M: 3 C: 0
0%
M: 10 C: 0
0%
M: 1 C: 0
0%
eGet(int, boolean, boolean)
M: 11 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
eInverseRemove(InternalEObject, int, NotificationChain)
M: 13 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
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: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
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%
getComponent()
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%
setComponent(Component2)
M: 52 C: 0
0%
M: 10 C: 0
0%
M: 6 C: 0
0%
M: 15 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2013 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: * EclipseSource Muenchen GmbH - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.ui.view.editor.test.model.test.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.MinimalEObjectImpl;
22: import org.eclipse.emf.ecp.ui.view.editor.test.model.test.Component;
23: import org.eclipse.emf.ecp.ui.view.editor.test.model.test.Component2;
24: import org.eclipse.emf.ecp.ui.view.editor.test.model.test.TestPackage;
25:
26: /**
27: * <!-- begin-user-doc -->
28: * An implementation of the model object '<em><b>Component</b></em>'.
29: * <!-- end-user-doc -->
30: * <p>
31: * The following features are implemented:
32: * <ul>
33: * <li>{@link org.eclipse.emf.ecp.ui.view.editor.test.model.test.impl.ComponentImpl#getComponent
34: * <em>Component</em>}</li>
35: * </ul>
36: * </p>
37: *
38: * @generated
39: */
40: public class ComponentImpl extends MinimalEObjectImpl.Container implements Component {
41:         /**
42:          * The cached value of the '{@link #getComponent() <em>Component</em>}' containment reference.
43:          * <!-- begin-user-doc -->
44:          * <!-- end-user-doc -->
45:          *
46:          * @see #getComponent()
47:          * @generated
48:          * @ordered
49:          */
50:         protected Component2 component;
51:
52:         /**
53:          * <!-- begin-user-doc -->
54:          * <!-- end-user-doc -->
55:          *
56:          * @generated
57:          */
58:         protected ComponentImpl() {
59:                 super();
60:         }
61:
62:         /**
63:          * <!-- begin-user-doc -->
64:          * <!-- end-user-doc -->
65:          *
66:          * @generated
67:          */
68:         @Override
69:         protected EClass eStaticClass() {
70:                 return TestPackage.Literals.COMPONENT;
71:         }
72:
73:         /**
74:          * <!-- begin-user-doc -->
75:          * <!-- end-user-doc -->
76:          *
77:          * @generated
78:          */
79:         @Override
80:         public Component2 getComponent() {
81:                 return component;
82:         }
83:
84:         /**
85:          * <!-- begin-user-doc -->
86:          * <!-- end-user-doc -->
87:          *
88:          * @generated
89:          */
90:         public NotificationChain basicSetComponent(Component2 newComponent, NotificationChain msgs) {
91:                 final Component2 oldComponent = component;
92:                 component = newComponent;
93:•                if (eNotificationRequired()) {
94:                         final ENotificationImpl notification = new ENotificationImpl(this, Notification.SET,
95:                                 TestPackage.COMPONENT__COMPONENT, oldComponent, newComponent);
96:•                        if (msgs == null) {
97:                                 msgs = notification;
98:                         } else {
99:                                 msgs.add(notification);
100:                         }
101:                 }
102:                 return msgs;
103:         }
104:
105:         /**
106:          * <!-- begin-user-doc -->
107:          * <!-- end-user-doc -->
108:          *
109:          * @generated
110:          */
111:         @Override
112:         public void setComponent(Component2 newComponent) {
113:•                if (newComponent != component) {
114:                         NotificationChain msgs = null;
115:•                        if (component != null) {
116:                                 msgs = ((InternalEObject) component).eInverseRemove(this, EOPPOSITE_FEATURE_BASE
117:                                         - TestPackage.COMPONENT__COMPONENT, null, msgs);
118:                         }
119:•                        if (newComponent != null) {
120:                                 msgs = ((InternalEObject) newComponent).eInverseAdd(this, EOPPOSITE_FEATURE_BASE
121:                                         - TestPackage.COMPONENT__COMPONENT, null, msgs);
122:                         }
123:                         msgs = basicSetComponent(newComponent, msgs);
124:•                        if (msgs != null) {
125:                                 msgs.dispatch();
126:                         }
127:•                } else if (eNotificationRequired()) {
128:                         eNotify(new ENotificationImpl(this, Notification.SET, TestPackage.COMPONENT__COMPONENT, newComponent,
129:                                 newComponent));
130:                 }
131:         }
132:
133:         /**
134:          * <!-- begin-user-doc -->
135:          * <!-- end-user-doc -->
136:          *
137:          * @generated
138:          */
139:         @Override
140:         public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
141:•                switch (featureID) {
142:                 case TestPackage.COMPONENT__COMPONENT:
143:                         return basicSetComponent(null, msgs);
144:                 }
145:                 return super.eInverseRemove(otherEnd, featureID, msgs);
146:         }
147:
148:         /**
149:          * <!-- begin-user-doc -->
150:          * <!-- end-user-doc -->
151:          *
152:          * @generated
153:          */
154:         @Override
155:         public Object eGet(int featureID, boolean resolve, boolean coreType) {
156:•                switch (featureID) {
157:                 case TestPackage.COMPONENT__COMPONENT:
158:                         return getComponent();
159:                 }
160:                 return super.eGet(featureID, resolve, coreType);
161:         }
162:
163:         /**
164:          * <!-- begin-user-doc -->
165:          * <!-- end-user-doc -->
166:          *
167:          * @generated
168:          */
169:         @Override
170:         public void eSet(int featureID, Object newValue) {
171:•                switch (featureID) {
172:                 case TestPackage.COMPONENT__COMPONENT:
173:                         setComponent((Component2) newValue);
174:                         return;
175:                 }
176:                 super.eSet(featureID, newValue);
177:         }
178:
179:         /**
180:          * <!-- begin-user-doc -->
181:          * <!-- end-user-doc -->
182:          *
183:          * @generated
184:          */
185:         @Override
186:         public void eUnset(int featureID) {
187:•                switch (featureID) {
188:                 case TestPackage.COMPONENT__COMPONENT:
189:                         setComponent((Component2) null);
190:                         return;
191:                 }
192:                 super.eUnset(featureID);
193:         }
194:
195:         /**
196:          * <!-- begin-user-doc -->
197:          * <!-- end-user-doc -->
198:          *
199:          * @generated
200:          */
201:         @Override
202:         public boolean eIsSet(int featureID) {
203:•                switch (featureID) {
204:                 case TestPackage.COMPONENT__COMPONENT:
205:•                        return component != null;
206:                 }
207:                 return super.eIsSet(featureID);
208:         }
209:
210: } // ComponentImpl