Skip to content

Package: PersonImpl

PersonImpl

nameinstructionbranchcomplexitylinemethod
PersonImpl()
M: 0 C: 9
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 4
100%
M: 0 C: 1
100%
eGet(int, boolean, boolean)
M: 17 C: 0
0%
M: 4 C: 0
0%
M: 4 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
eInverseRemove(InternalEObject, int, NotificationChain)
M: 15 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%
eIsSet(int)
M: 53 C: 0
0%
M: 20 C: 0
0%
M: 12 C: 0
0%
M: 8 C: 0
0%
M: 1 C: 0
0%
eSet(int, Object)
M: 27 C: 0
0%
M: 4 C: 0
0%
M: 4 C: 0
0%
M: 10 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: 18 C: 0
0%
M: 4 C: 0
0%
M: 4 C: 0
0%
M: 9 C: 0
0%
M: 1 C: 0
0%
getBirthPlace()
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%
getChildren()
M: 14 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%
getName()
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%
setBirthPlace(String)
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%
setName(String)
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%
static {...}
M: 0 C: 5
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
toString()
M: 37 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 9 C: 0
0%
M: 1 C: 0
0%

Coverage

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