Skip to content

Package: ContainerImpl

ContainerImpl

nameinstructionbranchcomplexitylinemethod
ContainerImpl()
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: 6 C: 5
45%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 1 C: 2
67%
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: 6 C: 11
65%
M: 3 C: 3
50%
M: 3 C: 1
25%
M: 1 C: 2
67%
M: 0 C: 1
100%
eSet(int, Object)
M: 17 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 6 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%
getContents()
M: 0 C: 14
100%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 0 C: 3
100%
M: 0 C: 1
100%

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: * Eugen Neufeld - initial API and implementation
13: *******************************************************************************/
14: package org.eclipse.emf.ecp.view.validation.test.model.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.EObjectImpl;
23: import org.eclipse.emf.ecore.util.EObjectContainmentEList;
24: import org.eclipse.emf.ecore.util.InternalEList;
25: import org.eclipse.emf.ecp.view.validation.test.model.Container;
26: import org.eclipse.emf.ecp.view.validation.test.model.Content;
27: import org.eclipse.emf.ecp.view.validation.test.model.TestPackage;
28:
29: /**
30: * <!-- begin-user-doc -->
31: * An implementation of the model object '<em><b>Container</b></em>'.
32: * <!-- end-user-doc -->
33: * <p>
34: * The following features are implemented:
35: * </p>
36: * <ul>
37: * <li>{@link org.eclipse.emf.ecp.view.validation.test.model.impl.ContainerImpl#getContents <em>Contents</em>}</li>
38: * </ul>
39: *
40: * @generated
41: */
42: public class ContainerImpl extends EObjectImpl implements Container {
43:         /**
44:          * The cached value of the '{@link #getContents() <em>Contents</em>}' containment reference list.
45:          * <!-- begin-user-doc -->
46:          * <!-- end-user-doc -->
47:          *
48:          * @see #getContents()
49:          * @generated
50:          * @ordered
51:          */
52:         protected EList<Content> contents;
53:
54:         /**
55:          * <!-- begin-user-doc -->
56:          * <!-- end-user-doc -->
57:          *
58:          * @generated
59:          */
60:         protected ContainerImpl() {
61:                 super();
62:         }
63:
64:         /**
65:          * <!-- begin-user-doc -->
66:          * <!-- end-user-doc -->
67:          *
68:          * @generated
69:          */
70:         @Override
71:         protected EClass eStaticClass() {
72:                 return TestPackage.Literals.CONTAINER;
73:         }
74:
75:         /**
76:          * <!-- begin-user-doc -->
77:          * <!-- end-user-doc -->
78:          *
79:          * @generated
80:          */
81:         @Override
82:         public EList<Content> getContents() {
83:•                if (contents == null) {
84:                         contents = new EObjectContainmentEList<Content>(Content.class, this, TestPackage.CONTAINER__CONTENTS);
85:                 }
86:                 return contents;
87:         }
88:
89:         /**
90:          * <!-- begin-user-doc -->
91:          * <!-- end-user-doc -->
92:          *
93:          * @generated
94:          */
95:         @Override
96:         public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
97:•                switch (featureID) {
98:                 case TestPackage.CONTAINER__CONTENTS:
99:                         return ((InternalEList<?>) getContents()).basicRemove(otherEnd, msgs);
100:                 }
101:                 return super.eInverseRemove(otherEnd, featureID, msgs);
102:         }
103:
104:         /**
105:          * <!-- begin-user-doc -->
106:          * <!-- end-user-doc -->
107:          *
108:          * @generated
109:          */
110:         @Override
111:         public Object eGet(int featureID, boolean resolve, boolean coreType) {
112:•                switch (featureID) {
113:                 case TestPackage.CONTAINER__CONTENTS:
114:                         return getContents();
115:                 }
116:                 return super.eGet(featureID, resolve, coreType);
117:         }
118:
119:         /**
120:          * <!-- begin-user-doc -->
121:          * <!-- end-user-doc -->
122:          *
123:          * @generated
124:          */
125:         @SuppressWarnings("unchecked")
126:         @Override
127:         public void eSet(int featureID, Object newValue) {
128:•                switch (featureID) {
129:                 case TestPackage.CONTAINER__CONTENTS:
130:                         getContents().clear();
131:                         getContents().addAll((Collection<? extends Content>) newValue);
132:                         return;
133:                 }
134:                 super.eSet(featureID, newValue);
135:         }
136:
137:         /**
138:          * <!-- begin-user-doc -->
139:          * <!-- end-user-doc -->
140:          *
141:          * @generated
142:          */
143:         @Override
144:         public void eUnset(int featureID) {
145:•                switch (featureID) {
146:                 case TestPackage.CONTAINER__CONTENTS:
147:                         getContents().clear();
148:                         return;
149:                 }
150:                 super.eUnset(featureID);
151:         }
152:
153:         /**
154:          * <!-- begin-user-doc -->
155:          * <!-- end-user-doc -->
156:          *
157:          * @generated
158:          */
159:         @Override
160:         public boolean eIsSet(int featureID) {
161:•                switch (featureID) {
162:                 case TestPackage.CONTAINER__CONTENTS:
163:•                        return contents != null && !contents.isEmpty();
164:                 }
165:                 return super.eIsSet(featureID);
166:         }
167:
168: } // ContainerImpl