Skip to content

Package: VGroupImpl

VGroupImpl

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