Skip to content

Package: StaffImpl

StaffImpl

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