Skip to content

Package: DiffmergeSwitch

DiffmergeSwitch

nameinstructionbranchcomplexitylinemethod
DiffmergeSwitch()
M: 7 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%
caseAttachment(VAttachment)
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%
caseDiffAttachment(VDiffAttachment)
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%
defaultCase(EObject)
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%
doSwitch(int, EObject)
M: 27 C: 0
0%
M: 6 C: 0
0%
M: 4 C: 0
0%
M: 9 C: 0
0%
M: 1 C: 0
0%
isSwitchFor(EPackage)
M: 7 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 1 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.util;
15:
16: import org.eclipse.emf.ecore.EObject;
17: import org.eclipse.emf.ecore.EPackage;
18: import org.eclipse.emf.ecore.util.Switch;
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.VAttachment;
22:
23: /**
24: * <!-- begin-user-doc --> The <b>Switch</b> for the model's inheritance
25: * hierarchy. It supports the call {@link #doSwitch(EObject) doSwitch(object)} to invoke the <code>caseXXX</code> method
26: * for each class of the model,
27: * starting with the actual class of the object and proceeding up the
28: * inheritance hierarchy until a non-null result is returned, which is the
29: * result of the switch. <!-- end-user-doc -->
30: *
31: * @see org.eclipse.emf.ecp.spi.diffmerge.model.VDiffmergePackage
32: * @generated
33: */
34: public class DiffmergeSwitch<T> extends Switch<T> {
35:         /**
36:          * The cached model package
37:          * <!-- begin-user-doc --> <!-- end-user-doc -->
38:          *
39:          * @generated
40:          */
41:         protected static VDiffmergePackage modelPackage;
42:
43:         /**
44:          * Creates an instance of the switch.
45:          * <!-- begin-user-doc --> <!--
46:          * end-user-doc -->
47:          *
48:          * @generated
49:          */
50:         public DiffmergeSwitch() {
51:•                if (modelPackage == null) {
52:                         modelPackage = VDiffmergePackage.eINSTANCE;
53:                 }
54:         }
55:
56:         /**
57:          * Checks whether this is a switch for the given package. <!--
58:          * begin-user-doc --> <!-- end-user-doc -->
59:          *
60:          * @parameter ePackage the package in question.
61:          * @return whether this is a switch for the given package.
62:          * @generated
63:          */
64:         @Override
65:         protected boolean isSwitchFor(EPackage ePackage) {
66:•                return ePackage == modelPackage;
67:         }
68:
69:         /**
70:          * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that
71:          * result.
72:          * <!-- begin-user-doc --> <!--
73:          * end-user-doc -->
74:          *
75:          * @return the first non-null result returned by a <code>caseXXX</code> call.
76:          * @generated
77:          */
78:         @Override
79:         protected T doSwitch(int classifierID, EObject theEObject) {
80:•                switch (classifierID) {
81:                 case VDiffmergePackage.DIFF_ATTACHMENT: {
82:                         final VDiffAttachment diffAttachment = (VDiffAttachment) theEObject;
83:                         T result = caseDiffAttachment(diffAttachment);
84:•                        if (result == null) {
85:                                 result = caseAttachment(diffAttachment);
86:                         }
87:•                        if (result == null) {
88:                                 result = defaultCase(theEObject);
89:                         }
90:                         return result;
91:                 }
92:                 default:
93:                         return defaultCase(theEObject);
94:                 }
95:         }
96:
97:         /**
98:          * Returns the result of interpreting the object as an instance of '<em>Diff Attachment</em>'.
99:          * <!-- begin-user-doc --> This implementation
100:          * returns null; returning a non-null result will terminate the switch. <!--
101:          * end-user-doc -->
102:          *
103:          * @param object the target of the switch.
104:          * @return the result of interpreting the object as an instance of '<em>Diff Attachment</em>'.
105:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
106:          * @generated
107:          */
108:         public T caseDiffAttachment(VDiffAttachment object) {
109:                 return null;
110:         }
111:
112:         /**
113:          * Returns the result of interpreting the object as an instance of '<em>Attachment</em>'.
114:          * <!-- begin-user-doc --> This implementation returns
115:          * null; returning a non-null result will terminate the switch. <!--
116:          * end-user-doc -->
117:          *
118:          * @param object the target of the switch.
119:          * @return the result of interpreting the object as an instance of '<em>Attachment</em>'.
120:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
121:          * @generated
122:          */
123:         public T caseAttachment(VAttachment object) {
124:                 return null;
125:         }
126:
127:         /**
128:          * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
129:          * <!-- begin-user-doc --> This implementation returns
130:          * null; returning a non-null result will terminate the switch, but this is
131:          * the last case anyway. <!-- end-user-doc -->
132:          *
133:          * @param object the target of the switch.
134:          * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
135:          * @see #doSwitch(org.eclipse.emf.ecore.EObject)
136:          * @generated
137:          */
138:         @Override
139:         public T defaultCase(EObject object) {
140:                 return null;
141:         }
142:
143: } // DiffmergeSwitch