KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > dods > editor > Doml > util > DomlSwitch


1 /**
2  * <copyright>
3  * </copyright>
4  *
5  * $Id$
6  */

7 package org.enhydra.dods.editor.Doml.util;
8
9 import java.util.List JavaDoc;
10
11 import org.eclipse.emf.ecore.EClass;
12 import org.eclipse.emf.ecore.EObject;
13
14 import org.enhydra.dods.editor.Doml.*;
15
16 /**
17  * <!-- begin-user-doc -->
18  * The <b>Switch</b> for the model's inheritance hierarchy.
19  * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
20  * to invoke the <code>caseXXX</code> method for each class of the model,
21  * starting with the actual class of the object
22  * and proceeding up the inheritance hierarchy
23  * until a non-null result is returned,
24  * which is the result of the switch.
25  * <!-- end-user-doc -->
26  * @see org.enhydra.dods.editor.Doml.DomlPackage
27  * @generated
28  */

29 public class DomlSwitch {
30     /**
31      * The cached model package
32      * <!-- begin-user-doc -->
33      * <!-- end-user-doc -->
34      * @generated
35      */

36     protected static DomlPackage modelPackage;
37
38     /**
39      * Creates an instance of the switch.
40      * <!-- begin-user-doc -->
41      * <!-- end-user-doc -->
42      * @generated
43      */

44     public DomlSwitch() {
45         if (modelPackage == null) {
46             modelPackage = DomlPackage.eINSTANCE;
47         }
48     }
49
50     /**
51      * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
52      * <!-- begin-user-doc -->
53      * <!-- end-user-doc -->
54      * @return the first non-null result returned by a <code>caseXXX</code> call.
55      * @generated
56      */

57     public Object JavaDoc doSwitch(EObject theEObject) {
58         return doSwitch(theEObject.eClass(), theEObject);
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     protected Object JavaDoc doSwitch(EClass theEClass, EObject theEObject) {
69         if (theEClass.eContainer() == modelPackage) {
70             return doSwitch(theEClass.getClassifierID(), theEObject);
71         }
72         else {
73             List JavaDoc eSuperTypes = theEClass.getESuperTypes();
74             return
75                 eSuperTypes.isEmpty() ?
76                     defaultCase(theEObject) :
77                     doSwitch((EClass)eSuperTypes.get(0), theEObject);
78         }
79     }
80
81     /**
82      * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
83      * <!-- begin-user-doc -->
84      * <!-- end-user-doc -->
85      * @return the first non-null result returned by a <code>caseXXX</code> call.
86      * @generated
87      */

88     protected Object JavaDoc doSwitch(int classifierID, EObject theEObject) {
89         switch (classifierID) {
90             case DomlPackage.COLUMN_TYPE: {
91                 ColumnType columnType = (ColumnType)theEObject;
92                 Object JavaDoc result = caseColumnType(columnType);
93                 if (result == null) result = defaultCase(theEObject);
94                 return result;
95             }
96             case DomlPackage.DATABASE_TYPE: {
97                 DatabaseType databaseType = (DatabaseType)theEObject;
98                 Object JavaDoc result = caseDatabaseType(databaseType);
99                 if (result == null) result = defaultCase(theEObject);
100                 return result;
101             }
102             case DomlPackage.DOCUMENT_ROOT: {
103                 DocumentRoot documentRoot = (DocumentRoot)theEObject;
104                 Object JavaDoc result = caseDocumentRoot(documentRoot);
105                 if (result == null) result = defaultCase(theEObject);
106                 return result;
107             }
108             case DomlPackage.DOML_TYPE: {
109                 DomlType domlType = (DomlType)theEObject;
110                 Object JavaDoc result = caseDomlType(domlType);
111                 if (result == null) result = defaultCase(theEObject);
112                 return result;
113             }
114             case DomlPackage.INDEX_COLUMN_TYPE: {
115                 IndexColumnType indexColumnType = (IndexColumnType)theEObject;
116                 Object JavaDoc result = caseIndexColumnType(indexColumnType);
117                 if (result == null) result = defaultCase(theEObject);
118                 return result;
119             }
120             case DomlPackage.INDEX_TYPE: {
121                 IndexType indexType = (IndexType)theEObject;
122                 Object JavaDoc result = caseIndexType(indexType);
123                 if (result == null) result = defaultCase(theEObject);
124                 return result;
125             }
126             case DomlPackage.PACKAGE_TYPE: {
127                 PackageType packageType = (PackageType)theEObject;
128                 Object JavaDoc result = casePackageType(packageType);
129                 if (result == null) result = defaultCase(theEObject);
130                 return result;
131             }
132             case DomlPackage.REFERENCE_OBJECT_TYPE: {
133                 ReferenceObjectType referenceObjectType = (ReferenceObjectType)theEObject;
134                 Object JavaDoc result = caseReferenceObjectType(referenceObjectType);
135                 if (result == null) result = defaultCase(theEObject);
136                 return result;
137             }
138             case DomlPackage.TABLE_TYPE: {
139                 TableType tableType = (TableType)theEObject;
140                 Object JavaDoc result = caseTableType(tableType);
141                 if (result == null) result = defaultCase(theEObject);
142                 return result;
143             }
144             case DomlPackage.TYPE_TYPE: {
145                 TypeType typeType = (TypeType)theEObject;
146                 Object JavaDoc result = caseTypeType(typeType);
147                 if (result == null) result = defaultCase(theEObject);
148                 return result;
149             }
150             default: return defaultCase(theEObject);
151         }
152     }
153
154     /**
155      * Returns the result of interpretting the object as an instance of '<em>Column Type</em>'.
156      * <!-- begin-user-doc -->
157      * This implementation returns null;
158      * returning a non-null result will terminate the switch.
159      * <!-- end-user-doc -->
160      * @param object the target of the switch.
161      * @return the result of interpretting the object as an instance of '<em>Column Type</em>'.
162      * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
163      * @generated
164      */

165     public Object JavaDoc caseColumnType(ColumnType object) {
166         return null;
167     }
168
169     /**
170      * Returns the result of interpretting the object as an instance of '<em>Database Type</em>'.
171      * <!-- begin-user-doc -->
172      * This implementation returns null;
173      * returning a non-null result will terminate the switch.
174      * <!-- end-user-doc -->
175      * @param object the target of the switch.
176      * @return the result of interpretting the object as an instance of '<em>Database Type</em>'.
177      * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
178      * @generated
179      */

180     public Object JavaDoc caseDatabaseType(DatabaseType object) {
181         return null;
182     }
183
184     /**
185      * Returns the result of interpretting the object as an instance of '<em>Document Root</em>'.
186      * <!-- begin-user-doc -->
187      * This implementation returns null;
188      * returning a non-null result will terminate the switch.
189      * <!-- end-user-doc -->
190      * @param object the target of the switch.
191      * @return the result of interpretting the object as an instance of '<em>Document Root</em>'.
192      * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
193      * @generated
194      */

195     public Object JavaDoc caseDocumentRoot(DocumentRoot object) {
196         return null;
197     }
198
199     /**
200      * Returns the result of interpretting the object as an instance of '<em>Type</em>'.
201      * <!-- begin-user-doc -->
202      * This implementation returns null;
203      * returning a non-null result will terminate the switch.
204      * <!-- end-user-doc -->
205      * @param object the target of the switch.
206      * @return the result of interpretting the object as an instance of '<em>Type</em>'.
207      * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
208      * @generated
209      */

210     public Object JavaDoc caseDomlType(DomlType object) {
211         return null;
212     }
213
214     /**
215      * Returns the result of interpretting the object as an instance of '<em>Index Column Type</em>'.
216      * <!-- begin-user-doc -->
217      * This implementation returns null;
218      * returning a non-null result will terminate the switch.
219      * <!-- end-user-doc -->
220      * @param object the target of the switch.
221      * @return the result of interpretting the object as an instance of '<em>Index Column Type</em>'.
222      * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
223      * @generated
224      */

225     public Object JavaDoc caseIndexColumnType(IndexColumnType object) {
226         return null;
227     }
228
229     /**
230      * Returns the result of interpretting the object as an instance of '<em>Index Type</em>'.
231      * <!-- begin-user-doc -->
232      * This implementation returns null;
233      * returning a non-null result will terminate the switch.
234      * <!-- end-user-doc -->
235      * @param object the target of the switch.
236      * @return the result of interpretting the object as an instance of '<em>Index Type</em>'.
237      * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
238      * @generated
239      */

240     public Object JavaDoc caseIndexType(IndexType object) {
241         return null;
242     }
243
244     /**
245      * Returns the result of interpretting the object as an instance of '<em>Package Type</em>'.
246      * <!-- begin-user-doc -->
247      * This implementation returns null;
248      * returning a non-null result will terminate the switch.
249      * <!-- end-user-doc -->
250      * @param object the target of the switch.
251      * @return the result of interpretting the object as an instance of '<em>Package Type</em>'.
252      * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
253      * @generated
254      */

255     public Object JavaDoc casePackageType(PackageType object) {
256         return null;
257     }
258
259     /**
260      * Returns the result of interpretting the object as an instance of '<em>Reference Object Type</em>'.
261      * <!-- begin-user-doc -->
262      * This implementation returns null;
263      * returning a non-null result will terminate the switch.
264      * <!-- end-user-doc -->
265      * @param object the target of the switch.
266      * @return the result of interpretting the object as an instance of '<em>Reference Object Type</em>'.
267      * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
268      * @generated
269      */

270     public Object JavaDoc caseReferenceObjectType(ReferenceObjectType object) {
271         return null;
272     }
273
274     /**
275      * Returns the result of interpretting the object as an instance of '<em>Table Type</em>'.
276      * <!-- begin-user-doc -->
277      * This implementation returns null;
278      * returning a non-null result will terminate the switch.
279      * <!-- end-user-doc -->
280      * @param object the target of the switch.
281      * @return the result of interpretting the object as an instance of '<em>Table Type</em>'.
282      * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
283      * @generated
284      */

285     public Object JavaDoc caseTableType(TableType object) {
286         return null;
287     }
288
289     /**
290      * Returns the result of interpretting the object as an instance of '<em>Type Type</em>'.
291      * <!-- begin-user-doc -->
292      * This implementation returns null;
293      * returning a non-null result will terminate the switch.
294      * <!-- end-user-doc -->
295      * @param object the target of the switch.
296      * @return the result of interpretting the object as an instance of '<em>Type Type</em>'.
297      * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
298      * @generated
299      */

300     public Object JavaDoc caseTypeType(TypeType object) {
301         return null;
302     }
303
304     /**
305      * Returns the result of interpretting the object as an instance of '<em>EObject</em>'.
306      * <!-- begin-user-doc -->
307      * This implementation returns null;
308      * returning a non-null result will terminate the switch, but this is the last case anyway.
309      * <!-- end-user-doc -->
310      * @param object the target of the switch.
311      * @return the result of interpretting the object as an instance of '<em>EObject</em>'.
312      * @see #doSwitch(org.eclipse.emf.ecore.EObject)
313      * @generated
314      */

315     public Object JavaDoc defaultCase(EObject object) {
316         return null;
317     }
318
319 } //DomlSwitch
320
Popular Tags