Skip to content

Package: ProfessorImpl

ProfessorImpl

nameinstructionbranchcomplexitylinemethod
ProfessorImpl()
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
eGet(int, boolean, boolean)
M: 6 C: 8
57%
M: 1 C: 2
67%
M: 1 C: 2
67%
M: 1 C: 3
75%
M: 0 C: 1
100%
eInverseRemove(InternalEObject, int, NotificationChain)
M: 15 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: 12 C: 23
66%
M: 5 C: 8
62%
M: 4 C: 4
50%
M: 1 C: 3
75%
M: 0 C: 1
100%
eSet(int, Object)
M: 22 C: 0
0%
M: 3 C: 0
0%
M: 3 C: 0
0%
M: 8 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%
getAddresses()
M: 0 C: 14
100%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 0 C: 4
100%
M: 0 C: 1
100%
getName()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
setName(String)
M: 0 C: 21
100%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 0 C: 5
100%
M: 0 C: 1
100%
static {...}
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
toString()
M: 28 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 7 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: * EclipseSource - Generated code
13: */
14: package org.eclipse.emf.ecp.test.university.impl;
15:
16: import java.util.Collection;
17:
18: import org.eclipse.emf.common.notify.Notification;
19: import org.eclipse.emf.common.notify.NotificationChain;
20: import org.eclipse.emf.common.util.EList;
21: import org.eclipse.emf.ecore.EClass;
22: import org.eclipse.emf.ecore.InternalEObject;
23: import org.eclipse.emf.ecore.impl.ENotificationImpl;
24: import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
25: import org.eclipse.emf.ecore.util.EObjectContainmentEList;
26: import org.eclipse.emf.ecore.util.InternalEList;
27: import org.eclipse.emf.ecp.test.university.Address;
28: import org.eclipse.emf.ecp.test.university.Professor;
29: import org.eclipse.emf.ecp.test.university.UniversityPackage;
30:
31: /**
32: * <!-- begin-user-doc -->
33: * An implementation of the model object '<em><b>Professor</b></em>'.
34: * <!-- end-user-doc -->
35: * <p>
36: * The following features are implemented:
37: * </p>
38: * <ul>
39: * <li>{@link org.eclipse.emf.ecp.test.university.impl.ProfessorImpl#getName <em>Name</em>}</li>
40: * <li>{@link org.eclipse.emf.ecp.test.university.impl.ProfessorImpl#getAddresses <em>Addresses</em>}</li>
41: * </ul>
42: *
43: * @generated
44: */
45: public class ProfessorImpl extends MinimalEObjectImpl.Container implements Professor {
46:         /**
47:          * The default value of the '{@link #getName() <em>Name</em>}' attribute.
48:          * <!-- begin-user-doc -->
49:          * <!-- end-user-doc -->
50:          *
51:          * @see #getName()
52:          * @generated
53:          * @ordered
54:          */
55:         protected static final String NAME_EDEFAULT = null;
56:         /**
57:          * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
58:          * <!-- begin-user-doc -->
59:          * <!-- end-user-doc -->
60:          *
61:          * @see #getName()
62:          * @generated
63:          * @ordered
64:          */
65:         protected String name = NAME_EDEFAULT;
66:
67:         /**
68:          * The cached value of the '{@link #getAddresses() <em>Addresses</em>}' containment reference list.
69:          * <!-- begin-user-doc -->
70:          * <!-- end-user-doc -->
71:          *
72:          * @see #getAddresses()
73:          * @generated
74:          * @ordered
75:          */
76:         protected EList<Address> addresses;
77:
78:         /**
79:          * <!-- begin-user-doc -->
80:          * <!-- end-user-doc -->
81:          *
82:          * @generated
83:          */
84:         protected ProfessorImpl() {
85:                 super();
86:         }
87:
88:         /**
89:          * <!-- begin-user-doc -->
90:          * <!-- end-user-doc -->
91:          *
92:          * @generated
93:          */
94:         @Override
95:         protected EClass eStaticClass() {
96:                 return UniversityPackage.Literals.PROFESSOR;
97:         }
98:
99:         /**
100:          * <!-- begin-user-doc -->
101:          * <!-- end-user-doc -->
102:          *
103:          * @generated
104:          */
105:         @Override
106:         public String getName() {
107:                 return name;
108:         }
109:
110:         /**
111:          * <!-- begin-user-doc -->
112:          * <!-- end-user-doc -->
113:          *
114:          * @generated
115:          */
116:         @Override
117:         public void setName(String newName) {
118:                 final String oldName = name;
119:                 name = newName;
120:•                if (eNotificationRequired()) {
121:                         eNotify(new ENotificationImpl(this, Notification.SET, UniversityPackage.PROFESSOR__NAME, oldName, name));
122:                 }
123:         }
124:
125:         /**
126:          * <!-- begin-user-doc -->
127:          * <!-- end-user-doc -->
128:          *
129:          * @generated
130:          */
131:         @Override
132:         public EList<Address> getAddresses() {
133:•                if (addresses == null) {
134:                         addresses = new EObjectContainmentEList<>(Address.class, this,
135:                                 UniversityPackage.PROFESSOR__ADDRESSES);
136:                 }
137:                 return addresses;
138:         }
139:
140:         /**
141:          * <!-- begin-user-doc -->
142:          * <!-- end-user-doc -->
143:          *
144:          * @generated
145:          */
146:         @Override
147:         public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
148:•                switch (featureID) {
149:                 case UniversityPackage.PROFESSOR__ADDRESSES:
150:                         return ((InternalEList<?>) getAddresses()).basicRemove(otherEnd, msgs);
151:                 }
152:                 return super.eInverseRemove(otherEnd, featureID, msgs);
153:         }
154:
155:         /**
156:          * <!-- begin-user-doc -->
157:          * <!-- end-user-doc -->
158:          *
159:          * @generated
160:          */
161:         @Override
162:         public Object eGet(int featureID, boolean resolve, boolean coreType) {
163:•                switch (featureID) {
164:                 case UniversityPackage.PROFESSOR__NAME:
165:                         return getName();
166:                 case UniversityPackage.PROFESSOR__ADDRESSES:
167:                         return getAddresses();
168:                 }
169:                 return super.eGet(featureID, resolve, coreType);
170:         }
171:
172:         /**
173:          * <!-- begin-user-doc -->
174:          * <!-- end-user-doc -->
175:          *
176:          * @generated
177:          */
178:         @SuppressWarnings("unchecked")
179:         @Override
180:         public void eSet(int featureID, Object newValue) {
181:•                switch (featureID) {
182:                 case UniversityPackage.PROFESSOR__NAME:
183:                         setName((String) newValue);
184:                         return;
185:                 case UniversityPackage.PROFESSOR__ADDRESSES:
186:                         getAddresses().clear();
187:                         getAddresses().addAll((Collection<? extends Address>) newValue);
188:                         return;
189:                 }
190:                 super.eSet(featureID, newValue);
191:         }
192:
193:         /**
194:          * <!-- begin-user-doc -->
195:          * <!-- end-user-doc -->
196:          *
197:          * @generated
198:          */
199:         @Override
200:         public void eUnset(int featureID) {
201:•                switch (featureID) {
202:                 case UniversityPackage.PROFESSOR__NAME:
203:                         setName(NAME_EDEFAULT);
204:                         return;
205:                 case UniversityPackage.PROFESSOR__ADDRESSES:
206:                         getAddresses().clear();
207:                         return;
208:                 }
209:                 super.eUnset(featureID);
210:         }
211:
212:         /**
213:          * <!-- begin-user-doc -->
214:          * <!-- end-user-doc -->
215:          *
216:          * @generated
217:          */
218:         @Override
219:         public boolean eIsSet(int featureID) {
220:•                switch (featureID) {
221:                 case UniversityPackage.PROFESSOR__NAME:
222:•                        return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
223:                 case UniversityPackage.PROFESSOR__ADDRESSES:
224:•                        return addresses != null && !addresses.isEmpty();
225:                 }
226:                 return super.eIsSet(featureID);
227:         }
228:
229:         /**
230:          * <!-- begin-user-doc -->
231:          * <!-- end-user-doc -->
232:          *
233:          * @generated
234:          */
235:         @Override
236:         public String toString() {
237:•                if (eIsProxy()) {
238:                         return super.toString();
239:                 }
240:
241:                 final StringBuffer result = new StringBuffer(super.toString());
242:                 result.append(" (name: "); //$NON-NLS-1$
243:                 result.append(name);
244:                 result.append(')');
245:                 return result.toString();
246:         }
247:
248: } // ProfessorImpl