1 /*******************************************************************************
2 * Copyright (c) 2011, 2014 Obeo.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
9 * Obeo - initial API and implementation
10 *******************************************************************************/
11 package org
.eclipse
.emf
.compare
.uml2
.profile
.test
.uml2comparetestprofile
.util
;
13 import org
.eclipse
.emf
.compare
.uml2
.profile
.test
.uml2comparetestprofile
.ACliche
;
14 import org
.eclipse
.emf
.compare
.uml2
.profile
.test
.uml2comparetestprofile
.ACliche2
;
15 import org
.eclipse
.emf
.compare
.uml2
.profile
.test
.uml2comparetestprofile
.ACliche3
;
16 import org
.eclipse
.emf
.compare
.uml2
.profile
.test
.uml2comparetestprofile
.UML2CompareTestProfilePackage
;
17 import org
.eclipse
.emf
.ecore
.EObject
;
18 import org
.eclipse
.emf
.ecore
.EPackage
;
19 import org
.eclipse
.emf
.ecore
.util
.Switch
;
22 * <!-- begin-user-doc --> The <b>Switch</b> for the model's inheritance hierarchy. It supports the call
23 * {@link #doSwitch(EObject) doSwitch(object)} to invoke the <code>caseXXX</code> method for each class of the
24 * model, starting with the actual class of the object and proceeding up the inheritance hierarchy until a
25 * non-null result is returned, which is the result of the switch. <!-- end-user-doc -->
26 * @see org.eclipse.emf.compare.uml2.profile.test.uml2comparetestprofile.UML2CompareTestProfilePackage
29 public class UML2CompareTestProfileSwitch
<T
> extends Switch
<T
> {
31 * The cached model package
32 * <!-- begin-user-doc --> <!-- end-user-doc -->
35 protected static UML2CompareTestProfilePackage modelPackage
;
38 * Creates an instance of the switch.
39 * <!-- begin-user-doc --> <!-- end-user-doc -->
42 public UML2CompareTestProfileSwitch() {
43 if (modelPackage
== null) {
44 modelPackage
= UML2CompareTestProfilePackage
.eINSTANCE
;
49 * Checks whether this is a switch for the given package.
50 * <!-- begin-user-doc -->
51 * <!-- end-user-doc -->
52 * @parameter ePackage the package in question.
53 * @return whether this is a switch for the given package.
57 protected boolean isSwitchFor(EPackage ePackage
) {
58 return ePackage
== modelPackage
;
62 * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
63 * <!-- begin-user-doc --> <!-- end-user-doc -->
64 * @return the first non-null result returned by a <code>caseXXX</code> call.
68 protected T
doSwitch(int classifierID
, EObject theEObject
) {
69 switch (classifierID
) {
70 case UML2CompareTestProfilePackage
.ACLICHE
: {
71 ACliche aCliche
= (ACliche
)theEObject
;
72 T result
= caseACliche(aCliche
);
73 if (result
== null) result
= defaultCase(theEObject
);
76 case UML2CompareTestProfilePackage
.ACLICHE2
: {
77 ACliche2 aCliche2
= (ACliche2
)theEObject
;
78 T result
= caseACliche2(aCliche2
);
79 if (result
== null) result
= defaultCase(theEObject
);
82 case UML2CompareTestProfilePackage
.ACLICHE3
: {
83 ACliche3 aCliche3
= (ACliche3
)theEObject
;
84 T result
= caseACliche3(aCliche3
);
85 if (result
== null) result
= defaultCase(theEObject
);
88 default: return defaultCase(theEObject
);
93 * Returns the result of interpreting the object as an instance of '<em>ACliche</em>'.
95 * --> This implementation returns null; returning a non-null result will terminate the switch. <!--
97 * @param object the target of the switch.
98 * @return the result of interpreting the object as an instance of '<em>ACliche</em>'.
99 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
102 public T
caseACliche(ACliche object
) {
107 * Returns the result of interpreting the object as an instance of '<em>ACliche2</em>'.
108 * <!-- begin-user-doc -->
109 * This implementation returns null;
110 * returning a non-null result will terminate the switch.
111 * <!-- end-user-doc -->
112 * @param object the target of the switch.
113 * @return the result of interpreting the object as an instance of '<em>ACliche2</em>'.
114 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
117 public T
caseACliche2(ACliche2 object
) {
122 * Returns the result of interpreting the object as an instance of '<em>ACliche3</em>'.
123 * <!-- begin-user-doc -->
124 * This implementation returns null;
125 * returning a non-null result will terminate the switch.
126 * <!-- end-user-doc -->
127 * @param object the target of the switch.
128 * @return the result of interpreting the object as an instance of '<em>ACliche3</em>'.
129 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
132 public T
caseACliche3(ACliche3 object
) {
137 * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
138 * <!-- begin-user-doc
139 * --> This implementation returns null; returning a non-null result will terminate the switch, but this
140 * is the last case anyway. <!-- end-user-doc -->
141 * @param object the target of the switch.
142 * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
143 * @see #doSwitch(org.eclipse.emf.ecore.EObject)
147 public T
defaultCase(EObject object
) {
151 } // UML2CompareTestProfileSwitch