Skip to content

Package: VDiffAttachmentImpl

VDiffAttachmentImpl

nameinstructionbranchcomplexitylinemethod
VDiffAttachmentImpl()
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: 6 C: 10
63%
M: 1 C: 2
67%
M: 1 C: 2
67%
M: 1 C: 3
75%
M: 0 C: 1
100%
eIsSet(int)
M: 4 C: 16
80%
M: 1 C: 6
86%
M: 1 C: 4
80%
M: 1 C: 3
75%
M: 0 C: 1
100%
eSet(int, Object)
M: 5 C: 14
74%
M: 1 C: 2
67%
M: 1 C: 2
67%
M: 2 C: 5
71%
M: 0 C: 1
100%
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%
getMergedDiffs()
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%
getTotalNumberOfDiffs()
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%
setMergedDiffs(int)
M: 0 C: 21
100%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 0 C: 6
100%
M: 0 C: 1
100%
setTotalNumberOfDiffs(int)
M: 0 C: 21
100%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 0 C: 6
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: * 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 Munich - initial API and implementation
13: */
14: package org.eclipse.emf.ecp.spi.diffmerge.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.spi.diffmerge.model.VDiffAttachment;
20: import org.eclipse.emf.ecp.spi.diffmerge.model.VDiffmergePackage;
21: import org.eclipse.emf.ecp.view.spi.model.impl.VAttachmentImpl;
22:
23: /**
24: * <!-- begin-user-doc --> An implementation of the model object ' <em><b>Diff Attachment</b></em>'. <!-- end-user-doc
25: * -->
26: * <p>
27: * The following features are implemented:
28: * <ul>
29: * <li>{@link org.eclipse.emf.ecp.spi.diffmerge.model.impl.VDiffAttachmentImpl#getTotalNumberOfDiffs <em>Total Number Of
30: * Diffs</em>}</li>
31: * <li>{@link org.eclipse.emf.ecp.spi.diffmerge.model.impl.VDiffAttachmentImpl#getMergedDiffs <em>Merged
32: * Diffs</em>}</li>
33: * </ul>
34: * </p>
35: *
36: * @generated
37: */
38: public class VDiffAttachmentImpl extends VAttachmentImpl implements
39:         VDiffAttachment {
40:         /**
41:          * The default value of the '{@link #getTotalNumberOfDiffs() <em>Total Number Of Diffs</em>}' attribute.
42:          * <!-- begin-user-doc -->
43:          * <!-- end-user-doc -->
44:          *
45:          * @see #getTotalNumberOfDiffs()
46:          * @generated
47:          * @ordered
48:          */
49:         protected static final int TOTAL_NUMBER_OF_DIFFS_EDEFAULT = 0;
50:         /**
51:          * The cached value of the '{@link #getTotalNumberOfDiffs() <em>Total Number Of Diffs</em>}' attribute.
52:          * <!-- begin-user-doc -->
53:          * <!-- end-user-doc -->
54:          *
55:          * @see #getTotalNumberOfDiffs()
56:          * @generated
57:          * @ordered
58:          */
59:         protected int totalNumberOfDiffs = TOTAL_NUMBER_OF_DIFFS_EDEFAULT;
60:         /**
61:          * The default value of the '{@link #getMergedDiffs() <em>Merged Diffs</em>}' attribute.
62:          * <!-- begin-user-doc -->
63:          * <!-- end-user-doc -->
64:          *
65:          * @see #getMergedDiffs()
66:          * @generated
67:          * @ordered
68:          */
69:         protected static final int MERGED_DIFFS_EDEFAULT = 0;
70:         /**
71:          * The cached value of the '{@link #getMergedDiffs() <em>Merged Diffs</em>}' attribute.
72:          * <!-- begin-user-doc -->
73:          * <!-- end-user-doc -->
74:          *
75:          * @see #getMergedDiffs()
76:          * @generated
77:          * @ordered
78:          */
79:         protected int mergedDiffs = MERGED_DIFFS_EDEFAULT;
80:
81:         /**
82:          * <!-- begin-user-doc --> <!-- end-user-doc -->
83:          *
84:          * @generated
85:          */
86:         protected VDiffAttachmentImpl() {
87:                 super();
88:         }
89:
90:         /**
91:          * <!-- begin-user-doc --> <!-- end-user-doc -->
92:          *
93:          * @generated
94:          */
95:         @Override
96:         protected EClass eStaticClass() {
97:                 return VDiffmergePackage.Literals.DIFF_ATTACHMENT;
98:         }
99:
100:         /**
101:          * <!-- begin-user-doc -->
102:          * <!-- end-user-doc -->
103:          *
104:          * @generated
105:          */
106:         @Override
107:         public int getTotalNumberOfDiffs() {
108:                 return totalNumberOfDiffs;
109:         }
110:
111:         /**
112:          * <!-- begin-user-doc -->
113:          * <!-- end-user-doc -->
114:          *
115:          * @generated
116:          */
117:         @Override
118:         public void setTotalNumberOfDiffs(int newTotalNumberOfDiffs) {
119:                 final int oldTotalNumberOfDiffs = totalNumberOfDiffs;
120:                 totalNumberOfDiffs = newTotalNumberOfDiffs;
121:•                if (eNotificationRequired()) {
122:                         eNotify(new ENotificationImpl(this, Notification.SET,
123:                                 VDiffmergePackage.DIFF_ATTACHMENT__TOTAL_NUMBER_OF_DIFFS, oldTotalNumberOfDiffs, totalNumberOfDiffs));
124:                 }
125:         }
126:
127:         /**
128:          * <!-- begin-user-doc -->
129:          * <!-- end-user-doc -->
130:          *
131:          * @generated
132:          */
133:         @Override
134:         public int getMergedDiffs() {
135:                 return mergedDiffs;
136:         }
137:
138:         /**
139:          * <!-- begin-user-doc -->
140:          * <!-- end-user-doc -->
141:          *
142:          * @generated
143:          */
144:         @Override
145:         public void setMergedDiffs(int newMergedDiffs) {
146:                 final int oldMergedDiffs = mergedDiffs;
147:                 mergedDiffs = newMergedDiffs;
148:•                if (eNotificationRequired()) {
149:                         eNotify(new ENotificationImpl(this, Notification.SET, VDiffmergePackage.DIFF_ATTACHMENT__MERGED_DIFFS,
150:                                 oldMergedDiffs, mergedDiffs));
151:                 }
152:         }
153:
154:         /**
155:          * <!-- begin-user-doc -->
156:          * <!-- end-user-doc -->
157:          *
158:          * @generated
159:          */
160:         @Override
161:         public Object eGet(int featureID, boolean resolve, boolean coreType) {
162:•                switch (featureID) {
163:                 case VDiffmergePackage.DIFF_ATTACHMENT__TOTAL_NUMBER_OF_DIFFS:
164:                         return getTotalNumberOfDiffs();
165:                 case VDiffmergePackage.DIFF_ATTACHMENT__MERGED_DIFFS:
166:                         return getMergedDiffs();
167:                 }
168:                 return super.eGet(featureID, resolve, coreType);
169:         }
170:
171:         /**
172:          * <!-- begin-user-doc -->
173:          * <!-- end-user-doc -->
174:          *
175:          * @generated
176:          */
177:         @Override
178:         public void eSet(int featureID, Object newValue) {
179:•                switch (featureID) {
180:                 case VDiffmergePackage.DIFF_ATTACHMENT__TOTAL_NUMBER_OF_DIFFS:
181:                         setTotalNumberOfDiffs((Integer) newValue);
182:                         return;
183:                 case VDiffmergePackage.DIFF_ATTACHMENT__MERGED_DIFFS:
184:                         setMergedDiffs((Integer) newValue);
185:                         return;
186:                 }
187:                 super.eSet(featureID, newValue);
188:         }
189:
190:         /**
191:          * <!-- begin-user-doc -->
192:          * <!-- end-user-doc -->
193:          *
194:          * @generated
195:          */
196:         @Override
197:         public void eUnset(int featureID) {
198:•                switch (featureID) {
199:                 case VDiffmergePackage.DIFF_ATTACHMENT__TOTAL_NUMBER_OF_DIFFS:
200:                         setTotalNumberOfDiffs(TOTAL_NUMBER_OF_DIFFS_EDEFAULT);
201:                         return;
202:                 case VDiffmergePackage.DIFF_ATTACHMENT__MERGED_DIFFS:
203:                         setMergedDiffs(MERGED_DIFFS_EDEFAULT);
204:                         return;
205:                 }
206:                 super.eUnset(featureID);
207:         }
208:
209:         /**
210:          * <!-- begin-user-doc -->
211:          * <!-- end-user-doc -->
212:          *
213:          * @generated
214:          */
215:         @Override
216:         public boolean eIsSet(int featureID) {
217:•                switch (featureID) {
218:                 case VDiffmergePackage.DIFF_ATTACHMENT__TOTAL_NUMBER_OF_DIFFS:
219:•                        return totalNumberOfDiffs != TOTAL_NUMBER_OF_DIFFS_EDEFAULT;
220:                 case VDiffmergePackage.DIFF_ATTACHMENT__MERGED_DIFFS:
221:•                        return mergedDiffs != MERGED_DIFFS_EDEFAULT;
222:                 }
223:                 return super.eIsSet(featureID);
224:         }
225:
226:         /**
227:          * <!-- begin-user-doc -->
228:          * <!-- end-user-doc -->
229:          *
230:          * @generated
231:          */
232:         @Override
233:         public String toString() {
234:•                if (eIsProxy()) {
235:                         return super.toString();
236:                 }
237:
238:                 final StringBuffer result = new StringBuffer(super.toString());
239:                 result.append(" (totalNumberOfDiffs: "); //$NON-NLS-1$
240:                 result.append(totalNumberOfDiffs);
241:                 result.append(", mergedDiffs: "); //$NON-NLS-1$
242:                 result.append(mergedDiffs);
243:                 result.append(')');
244:                 return result.toString();
245:         }
246:
247: } // VDiffAttachmentImpl