001: /**
002: * <copyright>
003: * </copyright>
004: *
005: * $Id$
006: */package newprocess.util;
007:
008: import java.util.List;
009:
010: import newprocess.Actor;
011: import newprocess.AndOperator;
012: import newprocess.AsyncActivity;
013: import newprocess.Conclusion;
014: import newprocess.Condition;
015: import newprocess.ConditionProxy;
016: import newprocess.ConditionTerm;
017: import newprocess.Element;
018: import newprocess.EnvEntry;
019: import newprocess.Event;
020: import newprocess.Expansion;
021: import newprocess.Expression;
022: import newprocess.Globals;
023: import newprocess.Listener;
024: import newprocess.Loader;
025: import newprocess.Message;
026: import newprocess.NewprocessPackage;
027: import newprocess.OperatorTerm;
028: import newprocess.OrOperator;
029: import newprocess.Root;
030: import newprocess.SyncActivity;
031: import newprocess.Term;
032:
033: import org.eclipse.emf.ecore.EClass;
034: import org.eclipse.emf.ecore.EObject;
035:
036: /**
037: * <!-- begin-user-doc -->
038: * The <b>Switch</b> for the model's inheritance hierarchy.
039: * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
040: * to invoke the <code>caseXXX</code> method for each class of the model,
041: * starting with the actual class of the object
042: * and proceeding up the inheritance hierarchy
043: * until a non-null result is returned,
044: * which is the result of the switch.
045: * <!-- end-user-doc -->
046: * @see newprocess.NewprocessPackage
047: * @generated
048: */
049: public class NewprocessSwitch<T> {
050: /**
051: * The cached model package
052: * <!-- begin-user-doc -->
053: * <!-- end-user-doc -->
054: * @generated
055: */
056: protected static NewprocessPackage modelPackage;
057:
058: /**
059: * Creates an instance of the switch.
060: * <!-- begin-user-doc -->
061: * <!-- end-user-doc -->
062: * @generated
063: */
064: public NewprocessSwitch() {
065: if (modelPackage == null) {
066: modelPackage = NewprocessPackage.eINSTANCE;
067: }
068: }
069:
070: /**
071: * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
072: * <!-- begin-user-doc -->
073: * <!-- end-user-doc -->
074: * @return the first non-null result returned by a <code>caseXXX</code> call.
075: * @generated
076: */
077: public T doSwitch(EObject theEObject) {
078: return doSwitch(theEObject.eClass(), theEObject);
079: }
080:
081: /**
082: * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
083: * <!-- begin-user-doc -->
084: * <!-- end-user-doc -->
085: * @return the first non-null result returned by a <code>caseXXX</code> call.
086: * @generated
087: */
088: protected T doSwitch(EClass theEClass, EObject theEObject) {
089: if (theEClass.eContainer() == modelPackage) {
090: return doSwitch(theEClass.getClassifierID(), theEObject);
091: } else {
092: List<EClass> eSuperTypes = theEClass.getESuperTypes();
093: return eSuperTypes.isEmpty() ? defaultCase(theEObject)
094: : doSwitch(eSuperTypes.get(0), theEObject);
095: }
096: }
097:
098: /**
099: * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
100: * <!-- begin-user-doc -->
101: * <!-- end-user-doc -->
102: * @return the first non-null result returned by a <code>caseXXX</code> call.
103: * @generated
104: */
105: protected T doSwitch(int classifierID, EObject theEObject) {
106: switch (classifierID) {
107: case NewprocessPackage.PROCESS: {
108: newprocess.Process process = (newprocess.Process) theEObject;
109: T result = caseProcess(process);
110: if (result == null)
111: result = caseElement(process);
112: if (result == null)
113: result = defaultCase(theEObject);
114: return result;
115: }
116: case NewprocessPackage.CONDITION: {
117: Condition condition = (Condition) theEObject;
118: T result = caseCondition(condition);
119: if (result == null)
120: result = caseElement(condition);
121: if (result == null)
122: result = defaultCase(theEObject);
123: return result;
124: }
125: case NewprocessPackage.ELEMENT: {
126: Element element = (Element) theEObject;
127: T result = caseElement(element);
128: if (result == null)
129: result = defaultCase(theEObject);
130: return result;
131: }
132: case NewprocessPackage.SYNC_ACTIVITY: {
133: SyncActivity syncActivity = (SyncActivity) theEObject;
134: T result = caseSyncActivity(syncActivity);
135: if (result == null)
136: result = caseElement(syncActivity);
137: if (result == null)
138: result = defaultCase(theEObject);
139: return result;
140: }
141: case NewprocessPackage.LOADER: {
142: Loader loader = (Loader) theEObject;
143: T result = caseLoader(loader);
144: if (result == null)
145: result = caseElement(loader);
146: if (result == null)
147: result = defaultCase(theEObject);
148: return result;
149: }
150: case NewprocessPackage.ASYNC_ACTIVITY: {
151: AsyncActivity asyncActivity = (AsyncActivity) theEObject;
152: T result = caseAsyncActivity(asyncActivity);
153: if (result == null)
154: result = caseElement(asyncActivity);
155: if (result == null)
156: result = defaultCase(theEObject);
157: return result;
158: }
159: case NewprocessPackage.EVENT: {
160: Event event = (Event) theEObject;
161: T result = caseEvent(event);
162: if (result == null)
163: result = caseElement(event);
164: if (result == null)
165: result = defaultCase(theEObject);
166: return result;
167: }
168: case NewprocessPackage.ACTOR: {
169: Actor actor = (Actor) theEObject;
170: T result = caseActor(actor);
171: if (result == null)
172: result = caseElement(actor);
173: if (result == null)
174: result = defaultCase(theEObject);
175: return result;
176: }
177: case NewprocessPackage.LISTENER: {
178: Listener listener = (Listener) theEObject;
179: T result = caseListener(listener);
180: if (result == null)
181: result = caseElement(listener);
182: if (result == null)
183: result = defaultCase(theEObject);
184: return result;
185: }
186: case NewprocessPackage.ENV_ENTRY: {
187: EnvEntry envEntry = (EnvEntry) theEObject;
188: T result = caseEnvEntry(envEntry);
189: if (result == null)
190: result = defaultCase(theEObject);
191: return result;
192: }
193: case NewprocessPackage.MESSAGE: {
194: Message message = (Message) theEObject;
195: T result = caseMessage(message);
196: if (result == null)
197: result = caseElement(message);
198: if (result == null)
199: result = defaultCase(theEObject);
200: return result;
201: }
202: case NewprocessPackage.CONDITION_PROXY: {
203: ConditionProxy conditionProxy = (ConditionProxy) theEObject;
204: T result = caseConditionProxy(conditionProxy);
205: if (result == null)
206: result = defaultCase(theEObject);
207: return result;
208: }
209: case NewprocessPackage.CONCLUSION: {
210: Conclusion conclusion = (Conclusion) theEObject;
211: T result = caseConclusion(conclusion);
212: if (result == null)
213: result = caseElement(conclusion);
214: if (result == null)
215: result = defaultCase(theEObject);
216: return result;
217: }
218: case NewprocessPackage.EXPANSION: {
219: Expansion expansion = (Expansion) theEObject;
220: T result = caseExpansion(expansion);
221: if (result == null)
222: result = caseElement(expansion);
223: if (result == null)
224: result = defaultCase(theEObject);
225: return result;
226: }
227: case NewprocessPackage.EXPRESSION: {
228: Expression expression = (Expression) theEObject;
229: T result = caseExpression(expression);
230: if (result == null)
231: result = defaultCase(theEObject);
232: return result;
233: }
234: case NewprocessPackage.TERM: {
235: Term term = (Term) theEObject;
236: T result = caseTerm(term);
237: if (result == null)
238: result = defaultCase(theEObject);
239: return result;
240: }
241: case NewprocessPackage.CONDITION_TERM: {
242: ConditionTerm conditionTerm = (ConditionTerm) theEObject;
243: T result = caseConditionTerm(conditionTerm);
244: if (result == null)
245: result = caseTerm(conditionTerm);
246: if (result == null)
247: result = defaultCase(theEObject);
248: return result;
249: }
250: case NewprocessPackage.OPERATOR_TERM: {
251: OperatorTerm operatorTerm = (OperatorTerm) theEObject;
252: T result = caseOperatorTerm(operatorTerm);
253: if (result == null)
254: result = caseTerm(operatorTerm);
255: if (result == null)
256: result = defaultCase(theEObject);
257: return result;
258: }
259: case NewprocessPackage.OR_OPERATOR: {
260: OrOperator orOperator = (OrOperator) theEObject;
261: T result = caseOrOperator(orOperator);
262: if (result == null)
263: result = caseOperatorTerm(orOperator);
264: if (result == null)
265: result = caseTerm(orOperator);
266: if (result == null)
267: result = defaultCase(theEObject);
268: return result;
269: }
270: case NewprocessPackage.AND_OPERATOR: {
271: AndOperator andOperator = (AndOperator) theEObject;
272: T result = caseAndOperator(andOperator);
273: if (result == null)
274: result = caseOperatorTerm(andOperator);
275: if (result == null)
276: result = caseTerm(andOperator);
277: if (result == null)
278: result = defaultCase(theEObject);
279: return result;
280: }
281: case NewprocessPackage.ROOT: {
282: Root root = (Root) theEObject;
283: T result = caseRoot(root);
284: if (result == null)
285: result = defaultCase(theEObject);
286: return result;
287: }
288: case NewprocessPackage.GLOBALS: {
289: Globals globals = (Globals) theEObject;
290: T result = caseGlobals(globals);
291: if (result == null)
292: result = defaultCase(theEObject);
293: return result;
294: }
295: default:
296: return defaultCase(theEObject);
297: }
298: }
299:
300: /**
301: * Returns the result of interpretting the object as an instance of '<em>Process</em>'.
302: * <!-- begin-user-doc -->
303: * This implementation returns null;
304: * returning a non-null result will terminate the switch.
305: * <!-- end-user-doc -->
306: * @param object the target of the switch.
307: * @return the result of interpretting the object as an instance of '<em>Process</em>'.
308: * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
309: * @generated
310: */
311: public T caseProcess(newprocess.Process object) {
312: return null;
313: }
314:
315: /**
316: * Returns the result of interpretting the object as an instance of '<em>Condition</em>'.
317: * <!-- begin-user-doc -->
318: * This implementation returns null;
319: * returning a non-null result will terminate the switch.
320: * <!-- end-user-doc -->
321: * @param object the target of the switch.
322: * @return the result of interpretting the object as an instance of '<em>Condition</em>'.
323: * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
324: * @generated
325: */
326: public T caseCondition(Condition object) {
327: return null;
328: }
329:
330: /**
331: * Returns the result of interpretting the object as an instance of '<em>Element</em>'.
332: * <!-- begin-user-doc -->
333: * This implementation returns null;
334: * returning a non-null result will terminate the switch.
335: * <!-- end-user-doc -->
336: * @param object the target of the switch.
337: * @return the result of interpretting the object as an instance of '<em>Element</em>'.
338: * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
339: * @generated
340: */
341: public T caseElement(Element object) {
342: return null;
343: }
344:
345: /**
346: * Returns the result of interpretting the object as an instance of '<em>Sync Activity</em>'.
347: * <!-- begin-user-doc -->
348: * This implementation returns null;
349: * returning a non-null result will terminate the switch.
350: * <!-- end-user-doc -->
351: * @param object the target of the switch.
352: * @return the result of interpretting the object as an instance of '<em>Sync Activity</em>'.
353: * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
354: * @generated
355: */
356: public T caseSyncActivity(SyncActivity object) {
357: return null;
358: }
359:
360: /**
361: * Returns the result of interpretting the object as an instance of '<em>Loader</em>'.
362: * <!-- begin-user-doc -->
363: * This implementation returns null;
364: * returning a non-null result will terminate the switch.
365: * <!-- end-user-doc -->
366: * @param object the target of the switch.
367: * @return the result of interpretting the object as an instance of '<em>Loader</em>'.
368: * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
369: * @generated
370: */
371: public T caseLoader(Loader object) {
372: return null;
373: }
374:
375: /**
376: * Returns the result of interpretting the object as an instance of '<em>Async Activity</em>'.
377: * <!-- begin-user-doc -->
378: * This implementation returns null;
379: * returning a non-null result will terminate the switch.
380: * <!-- end-user-doc -->
381: * @param object the target of the switch.
382: * @return the result of interpretting the object as an instance of '<em>Async Activity</em>'.
383: * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
384: * @generated
385: */
386: public T caseAsyncActivity(AsyncActivity object) {
387: return null;
388: }
389:
390: /**
391: * Returns the result of interpretting the object as an instance of '<em>Event</em>'.
392: * <!-- begin-user-doc -->
393: * This implementation returns null;
394: * returning a non-null result will terminate the switch.
395: * <!-- end-user-doc -->
396: * @param object the target of the switch.
397: * @return the result of interpretting the object as an instance of '<em>Event</em>'.
398: * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
399: * @generated
400: */
401: public T caseEvent(Event object) {
402: return null;
403: }
404:
405: /**
406: * Returns the result of interpretting the object as an instance of '<em>Actor</em>'.
407: * <!-- begin-user-doc -->
408: * This implementation returns null;
409: * returning a non-null result will terminate the switch.
410: * <!-- end-user-doc -->
411: * @param object the target of the switch.
412: * @return the result of interpretting the object as an instance of '<em>Actor</em>'.
413: * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
414: * @generated
415: */
416: public T caseActor(Actor object) {
417: return null;
418: }
419:
420: /**
421: * Returns the result of interpretting the object as an instance of '<em>Listener</em>'.
422: * <!-- begin-user-doc -->
423: * This implementation returns null;
424: * returning a non-null result will terminate the switch.
425: * <!-- end-user-doc -->
426: * @param object the target of the switch.
427: * @return the result of interpretting the object as an instance of '<em>Listener</em>'.
428: * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
429: * @generated
430: */
431: public T caseListener(Listener object) {
432: return null;
433: }
434:
435: /**
436: * Returns the result of interpretting the object as an instance of '<em>Env Entry</em>'.
437: * <!-- begin-user-doc -->
438: * This implementation returns null;
439: * returning a non-null result will terminate the switch.
440: * <!-- end-user-doc -->
441: * @param object the target of the switch.
442: * @return the result of interpretting the object as an instance of '<em>Env Entry</em>'.
443: * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
444: * @generated
445: */
446: public T caseEnvEntry(EnvEntry object) {
447: return null;
448: }
449:
450: /**
451: * Returns the result of interpretting the object as an instance of '<em>Message</em>'.
452: * <!-- begin-user-doc -->
453: * This implementation returns null;
454: * returning a non-null result will terminate the switch.
455: * <!-- end-user-doc -->
456: * @param object the target of the switch.
457: * @return the result of interpretting the object as an instance of '<em>Message</em>'.
458: * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
459: * @generated
460: */
461: public T caseMessage(Message object) {
462: return null;
463: }
464:
465: /**
466: * Returns the result of interpretting the object as an instance of '<em>Condition Proxy</em>'.
467: * <!-- begin-user-doc -->
468: * This implementation returns null;
469: * returning a non-null result will terminate the switch.
470: * <!-- end-user-doc -->
471: * @param object the target of the switch.
472: * @return the result of interpretting the object as an instance of '<em>Condition Proxy</em>'.
473: * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
474: * @generated
475: */
476: public T caseConditionProxy(ConditionProxy object) {
477: return null;
478: }
479:
480: /**
481: * Returns the result of interpretting the object as an instance of '<em>Conclusion</em>'.
482: * <!-- begin-user-doc -->
483: * This implementation returns null;
484: * returning a non-null result will terminate the switch.
485: * <!-- end-user-doc -->
486: * @param object the target of the switch.
487: * @return the result of interpretting the object as an instance of '<em>Conclusion</em>'.
488: * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
489: * @generated
490: */
491: public T caseConclusion(Conclusion object) {
492: return null;
493: }
494:
495: /**
496: * Returns the result of interpretting the object as an instance of '<em>Expansion</em>'.
497: * <!-- begin-user-doc -->
498: * This implementation returns null;
499: * returning a non-null result will terminate the switch.
500: * <!-- end-user-doc -->
501: * @param object the target of the switch.
502: * @return the result of interpretting the object as an instance of '<em>Expansion</em>'.
503: * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
504: * @generated
505: */
506: public T caseExpansion(Expansion object) {
507: return null;
508: }
509:
510: /**
511: * Returns the result of interpretting the object as an instance of '<em>Expression</em>'.
512: * <!-- begin-user-doc -->
513: * This implementation returns null;
514: * returning a non-null result will terminate the switch.
515: * <!-- end-user-doc -->
516: * @param object the target of the switch.
517: * @return the result of interpretting the object as an instance of '<em>Expression</em>'.
518: * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
519: * @generated
520: */
521: public T caseExpression(Expression object) {
522: return null;
523: }
524:
525: /**
526: * Returns the result of interpretting the object as an instance of '<em>Term</em>'.
527: * <!-- begin-user-doc -->
528: * This implementation returns null;
529: * returning a non-null result will terminate the switch.
530: * <!-- end-user-doc -->
531: * @param object the target of the switch.
532: * @return the result of interpretting the object as an instance of '<em>Term</em>'.
533: * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
534: * @generated
535: */
536: public T caseTerm(Term object) {
537: return null;
538: }
539:
540: /**
541: * Returns the result of interpretting the object as an instance of '<em>Condition Term</em>'.
542: * <!-- begin-user-doc -->
543: * This implementation returns null;
544: * returning a non-null result will terminate the switch.
545: * <!-- end-user-doc -->
546: * @param object the target of the switch.
547: * @return the result of interpretting the object as an instance of '<em>Condition Term</em>'.
548: * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
549: * @generated
550: */
551: public T caseConditionTerm(ConditionTerm object) {
552: return null;
553: }
554:
555: /**
556: * Returns the result of interpretting the object as an instance of '<em>Operator Term</em>'.
557: * <!-- begin-user-doc -->
558: * This implementation returns null;
559: * returning a non-null result will terminate the switch.
560: * <!-- end-user-doc -->
561: * @param object the target of the switch.
562: * @return the result of interpretting the object as an instance of '<em>Operator Term</em>'.
563: * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
564: * @generated
565: */
566: public T caseOperatorTerm(OperatorTerm object) {
567: return null;
568: }
569:
570: /**
571: * Returns the result of interpretting the object as an instance of '<em>Or Operator</em>'.
572: * <!-- begin-user-doc -->
573: * This implementation returns null;
574: * returning a non-null result will terminate the switch.
575: * <!-- end-user-doc -->
576: * @param object the target of the switch.
577: * @return the result of interpretting the object as an instance of '<em>Or Operator</em>'.
578: * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
579: * @generated
580: */
581: public T caseOrOperator(OrOperator object) {
582: return null;
583: }
584:
585: /**
586: * Returns the result of interpretting the object as an instance of '<em>And Operator</em>'.
587: * <!-- begin-user-doc -->
588: * This implementation returns null;
589: * returning a non-null result will terminate the switch.
590: * <!-- end-user-doc -->
591: * @param object the target of the switch.
592: * @return the result of interpretting the object as an instance of '<em>And Operator</em>'.
593: * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
594: * @generated
595: */
596: public T caseAndOperator(AndOperator object) {
597: return null;
598: }
599:
600: /**
601: * Returns the result of interpretting the object as an instance of '<em>Root</em>'.
602: * <!-- begin-user-doc -->
603: * This implementation returns null;
604: * returning a non-null result will terminate the switch.
605: * <!-- end-user-doc -->
606: * @param object the target of the switch.
607: * @return the result of interpretting the object as an instance of '<em>Root</em>'.
608: * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
609: * @generated
610: */
611: public T caseRoot(Root object) {
612: return null;
613: }
614:
615: /**
616: * Returns the result of interpretting the object as an instance of '<em>Globals</em>'.
617: * <!-- begin-user-doc -->
618: * This implementation returns null;
619: * returning a non-null result will terminate the switch.
620: * <!-- end-user-doc -->
621: * @param object the target of the switch.
622: * @return the result of interpretting the object as an instance of '<em>Globals</em>'.
623: * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
624: * @generated
625: */
626: public T caseGlobals(Globals object) {
627: return null;
628: }
629:
630: /**
631: * Returns the result of interpretting the object as an instance of '<em>EObject</em>'.
632: * <!-- begin-user-doc -->
633: * This implementation returns null;
634: * returning a non-null result will terminate the switch, but this is the last case anyway.
635: * <!-- end-user-doc -->
636: * @param object the target of the switch.
637: * @return the result of interpretting the object as an instance of '<em>EObject</em>'.
638: * @see #doSwitch(org.eclipse.emf.ecore.EObject)
639: * @generated
640: */
641: public T defaultCase(EObject object) {
642: return null;
643: }
644:
645: } //NewprocessSwitch
|