diff options
Diffstat (limited to 'Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/linkedList/util/LinkedListSwitch.java')
-rw-r--r-- | Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/linkedList/util/LinkedListSwitch.java | 154 |
1 files changed, 154 insertions, 0 deletions
diff --git a/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/linkedList/util/LinkedListSwitch.java b/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/linkedList/util/LinkedListSwitch.java new file mode 100644 index 00000000..f5dcf560 --- /dev/null +++ b/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/linkedList/util/LinkedListSwitch.java | |||
@@ -0,0 +1,154 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package linkedList.util; | ||
4 | |||
5 | import linkedList.Element; | ||
6 | import linkedList.LinkedListPackage; | ||
7 | import linkedList.List; | ||
8 | |||
9 | import org.eclipse.emf.ecore.EObject; | ||
10 | import org.eclipse.emf.ecore.EPackage; | ||
11 | |||
12 | import org.eclipse.emf.ecore.util.Switch; | ||
13 | |||
14 | /** | ||
15 | * <!-- begin-user-doc --> | ||
16 | * The <b>Switch</b> for the model's inheritance hierarchy. | ||
17 | * It supports the call {@link #doSwitch(EObject) doSwitch(object)} | ||
18 | * to invoke the <code>caseXXX</code> method for each class of the model, | ||
19 | * starting with the actual class of the object | ||
20 | * and proceeding up the inheritance hierarchy | ||
21 | * until a non-null result is returned, | ||
22 | * which is the result of the switch. | ||
23 | * <!-- end-user-doc --> | ||
24 | * @see linkedList.LinkedListPackage | ||
25 | * @generated | ||
26 | */ | ||
27 | public class LinkedListSwitch<T> extends Switch<T> { | ||
28 | /** | ||
29 | * The cached model package | ||
30 | * <!-- begin-user-doc --> | ||
31 | * <!-- end-user-doc --> | ||
32 | * @generated | ||
33 | */ | ||
34 | protected static LinkedListPackage modelPackage; | ||
35 | |||
36 | /** | ||
37 | * Creates an instance of the switch. | ||
38 | * <!-- begin-user-doc --> | ||
39 | * <!-- end-user-doc --> | ||
40 | * @generated | ||
41 | */ | ||
42 | public LinkedListSwitch() { | ||
43 | if (modelPackage == null) { | ||
44 | modelPackage = LinkedListPackage.eINSTANCE; | ||
45 | } | ||
46 | } | ||
47 | |||
48 | /** | ||
49 | * Checks whether this is a switch for the given package. | ||
50 | * <!-- begin-user-doc --> | ||
51 | * <!-- end-user-doc --> | ||
52 | * @param ePackage the package in question. | ||
53 | * @return whether this is a switch for the given package. | ||
54 | * @generated | ||
55 | */ | ||
56 | @Override | ||
57 | protected boolean isSwitchFor(EPackage ePackage) { | ||
58 | return ePackage == modelPackage; | ||
59 | } | ||
60 | |||
61 | /** | ||
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 --> | ||
64 | * <!-- end-user-doc --> | ||
65 | * @return the first non-null result returned by a <code>caseXXX</code> call. | ||
66 | * @generated | ||
67 | */ | ||
68 | @Override | ||
69 | protected T doSwitch(int classifierID, EObject theEObject) { | ||
70 | switch (classifierID) { | ||
71 | case LinkedListPackage.LIST: { | ||
72 | List list = (List)theEObject; | ||
73 | T result = caseList(list); | ||
74 | if (result == null) result = defaultCase(theEObject); | ||
75 | return result; | ||
76 | } | ||
77 | case LinkedListPackage.ELEMENT: { | ||
78 | Element element = (Element)theEObject; | ||
79 | T result = caseElement(element); | ||
80 | if (result == null) result = defaultCase(theEObject); | ||
81 | return result; | ||
82 | } | ||
83 | case LinkedListPackage.OBJECT: { | ||
84 | linkedList.Object object = (linkedList.Object)theEObject; | ||
85 | T result = caseObject(object); | ||
86 | if (result == null) result = defaultCase(theEObject); | ||
87 | return result; | ||
88 | } | ||
89 | default: return defaultCase(theEObject); | ||
90 | } | ||
91 | } | ||
92 | |||
93 | /** | ||
94 | * Returns the result of interpreting the object as an instance of '<em>List</em>'. | ||
95 | * <!-- begin-user-doc --> | ||
96 | * This implementation returns null; | ||
97 | * returning a non-null result will terminate the switch. | ||
98 | * <!-- end-user-doc --> | ||
99 | * @param object the target of the switch. | ||
100 | * @return the result of interpreting the object as an instance of '<em>List</em>'. | ||
101 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | ||
102 | * @generated | ||
103 | */ | ||
104 | public T caseList(List object) { | ||
105 | return null; | ||
106 | } | ||
107 | |||
108 | /** | ||
109 | * Returns the result of interpreting the object as an instance of '<em>Element</em>'. | ||
110 | * <!-- begin-user-doc --> | ||
111 | * This implementation returns null; | ||
112 | * returning a non-null result will terminate the switch. | ||
113 | * <!-- end-user-doc --> | ||
114 | * @param object the target of the switch. | ||
115 | * @return the result of interpreting the object as an instance of '<em>Element</em>'. | ||
116 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | ||
117 | * @generated | ||
118 | */ | ||
119 | public T caseElement(Element object) { | ||
120 | return null; | ||
121 | } | ||
122 | |||
123 | /** | ||
124 | * Returns the result of interpreting the object as an instance of '<em>Object</em>'. | ||
125 | * <!-- begin-user-doc --> | ||
126 | * This implementation returns null; | ||
127 | * returning a non-null result will terminate the switch. | ||
128 | * <!-- end-user-doc --> | ||
129 | * @param object the target of the switch. | ||
130 | * @return the result of interpreting the object as an instance of '<em>Object</em>'. | ||
131 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | ||
132 | * @generated | ||
133 | */ | ||
134 | public T caseObject(linkedList.Object object) { | ||
135 | return null; | ||
136 | } | ||
137 | |||
138 | /** | ||
139 | * Returns the result of interpreting the object as an instance of '<em>EObject</em>'. | ||
140 | * <!-- begin-user-doc --> | ||
141 | * This implementation returns null; | ||
142 | * returning a non-null result will terminate the switch, but this is the last case anyway. | ||
143 | * <!-- end-user-doc --> | ||
144 | * @param object the target of the switch. | ||
145 | * @return the result of interpreting the object as an instance of '<em>EObject</em>'. | ||
146 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) | ||
147 | * @generated | ||
148 | */ | ||
149 | @Override | ||
150 | public T defaultCase(EObject object) { | ||
151 | return null; | ||
152 | } | ||
153 | |||
154 | } //LinkedListSwitch | ||