Skip to content

Package: VIndexDomainModelReferenceSegmentImpl

VIndexDomainModelReferenceSegmentImpl

nameinstructionbranchcomplexitylinemethod
VIndexDomainModelReferenceSegmentImpl()
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: 12 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: 13 C: 0
0%
M: 4 C: 0
0%
M: 3 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
eSet(int, Object)
M: 13 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 5 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: 10 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
getIndex()
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%
setIndex(int)
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%
toString()
M: 3 C: 25
89%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 1 C: 6
86%
M: 0 C: 1
100%

Coverage

1: /**
2: * Copyright (c) 2011-2018 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: * Lucas Koehler - initial API and implementation
13: */
14: package org.eclipse.emfforms.spi.view.indexsegment.model.impl;
15:
16: import org.eclipse.emf.common.notify.Notification;
17: import org.eclipse.emf.ecore.EClass;
18: import org.eclipse.emf.ecore.impl.ENotificationImpl;
19: import org.eclipse.emf.ecp.view.spi.model.impl.VFeatureDomainModelReferenceSegmentImpl;
20: import org.eclipse.emfforms.spi.view.indexsegment.model.VIndexDomainModelReferenceSegment;
21: import org.eclipse.emfforms.spi.view.indexsegment.model.VIndexsegmentPackage;
22:
23: /**
24: * <!-- begin-user-doc --> An implementation of the model object '<em><b>Index
25: * Domain Model Reference Segment</b></em>'. <!-- end-user-doc -->
26: * <p>
27: * The following features are implemented:
28: * </p>
29: * <ul>
30: * <li>{@link org.eclipse.emfforms.spi.view.indexsegment.model.impl.VIndexDomainModelReferenceSegmentImpl#getIndex
31: * <em>Index</em>}</li>
32: * </ul>
33: *
34: * @generated
35: */
36: public class VIndexDomainModelReferenceSegmentImpl extends VFeatureDomainModelReferenceSegmentImpl
37:         implements VIndexDomainModelReferenceSegment {
38:         /**
39:          * The default value of the '{@link #getIndex() <em>Index</em>}' attribute. <!--
40:          * begin-user-doc --> <!-- end-user-doc -->
41:          *
42:          * @see #getIndex()
43:          * @generated
44:          * @ordered
45:          */
46:         protected static final int INDEX_EDEFAULT = 0;
47:
48:         /**
49:          * The cached value of the '{@link #getIndex() <em>Index</em>}' attribute. <!--
50:          * begin-user-doc --> <!-- end-user-doc -->
51:          *
52:          * @see #getIndex()
53:          * @generated
54:          * @ordered
55:          */
56:         protected int index = INDEX_EDEFAULT;
57:
58:         /**
59:          * <!-- begin-user-doc --> <!-- end-user-doc -->
60:          *
61:          * @generated
62:          */
63:         protected VIndexDomainModelReferenceSegmentImpl() {
64:                 super();
65:         }
66:
67:         /**
68:          * <!-- begin-user-doc --> <!-- end-user-doc -->
69:          *
70:          * @generated
71:          */
72:         @Override
73:         protected EClass eStaticClass() {
74:                 return VIndexsegmentPackage.Literals.INDEX_DOMAIN_MODEL_REFERENCE_SEGMENT;
75:         }
76:
77:         /**
78:          * <!-- begin-user-doc --> <!-- end-user-doc -->
79:          *
80:          * @generated
81:          */
82:         @Override
83:         public int getIndex() {
84:                 return index;
85:         }
86:
87:         /**
88:          * <!-- begin-user-doc --> <!-- end-user-doc -->
89:          *
90:          * @generated
91:          */
92:         @Override
93:         public void setIndex(int newIndex) {
94:                 final int oldIndex = index;
95:                 index = newIndex;
96:•                if (eNotificationRequired()) {
97:                         eNotify(new ENotificationImpl(this, Notification.SET,
98:                                 VIndexsegmentPackage.INDEX_DOMAIN_MODEL_REFERENCE_SEGMENT__INDEX, oldIndex, index));
99:                 }
100:         }
101:
102:         /**
103:          * <!-- begin-user-doc --> <!-- end-user-doc -->
104:          *
105:          * @generated
106:          */
107:         @Override
108:         public Object eGet(int featureID, boolean resolve, boolean coreType) {
109:•                switch (featureID) {
110:                 case VIndexsegmentPackage.INDEX_DOMAIN_MODEL_REFERENCE_SEGMENT__INDEX:
111:                         return getIndex();
112:                 }
113:                 return super.eGet(featureID, resolve, coreType);
114:         }
115:
116:         /**
117:          * <!-- begin-user-doc --> <!-- end-user-doc -->
118:          *
119:          * @generated
120:          */
121:         @Override
122:         public void eSet(int featureID, Object newValue) {
123:•                switch (featureID) {
124:                 case VIndexsegmentPackage.INDEX_DOMAIN_MODEL_REFERENCE_SEGMENT__INDEX:
125:                         setIndex((Integer) newValue);
126:                         return;
127:                 }
128:                 super.eSet(featureID, newValue);
129:         }
130:
131:         /**
132:          * <!-- begin-user-doc --> <!-- end-user-doc -->
133:          *
134:          * @generated
135:          */
136:         @Override
137:         public void eUnset(int featureID) {
138:•                switch (featureID) {
139:                 case VIndexsegmentPackage.INDEX_DOMAIN_MODEL_REFERENCE_SEGMENT__INDEX:
140:                         setIndex(INDEX_EDEFAULT);
141:                         return;
142:                 }
143:                 super.eUnset(featureID);
144:         }
145:
146:         /**
147:          * <!-- begin-user-doc --> <!-- end-user-doc -->
148:          *
149:          * @generated
150:          */
151:         @Override
152:         public boolean eIsSet(int featureID) {
153:•                switch (featureID) {
154:                 case VIndexsegmentPackage.INDEX_DOMAIN_MODEL_REFERENCE_SEGMENT__INDEX:
155:•                        return index != INDEX_EDEFAULT;
156:                 }
157:                 return super.eIsSet(featureID);
158:         }
159:
160:         /**
161:          * <!-- begin-user-doc --> <!-- end-user-doc -->
162:          *
163:          * @generated
164:          */
165:         @Override
166:         public String toString() {
167:•                if (eIsProxy()) {
168:                         return super.toString();
169:                 }
170:
171:                 final StringBuilder result = new StringBuilder(super.toString());
172:                 result.append(" (index: "); //$NON-NLS-1$
173:                 result.append(index);
174:                 result.append(')');
175:                 return result.toString();
176:         }
177:
178: } // VIndexDomainModelReferenceSegmentImpl