/** * Copyright (c) 2011 committers of YAKINDU and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * Contributors: * committers of YAKINDU - initial API and implementation * */ package org.yakindu.sct.model.sgraph.util; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.util.Switch; import org.yakindu.base.base.DocumentedElement; import org.yakindu.base.base.DomainElement; import org.yakindu.base.base.NamedElement; import org.yakindu.base.types.AnnotatableElement; import org.yakindu.base.types.Declaration; import org.yakindu.base.types.PackageMember; import org.yakindu.base.types.TypedElement; import org.yakindu.sct.model.sgraph.Choice; import org.yakindu.sct.model.sgraph.CompositeElement; import org.yakindu.sct.model.sgraph.Effect; import org.yakindu.sct.model.sgraph.Entry; import org.yakindu.sct.model.sgraph.Exit; import org.yakindu.sct.model.sgraph.FinalState; import org.yakindu.sct.model.sgraph.ImportDeclaration; import org.yakindu.sct.model.sgraph.Pseudostate; import org.yakindu.sct.model.sgraph.Reaction; import org.yakindu.sct.model.sgraph.ReactionProperty; import org.yakindu.sct.model.sgraph.ReactiveElement; import org.yakindu.sct.model.sgraph.Region; import org.yakindu.sct.model.sgraph.RegularState; import org.yakindu.sct.model.sgraph.SGraphPackage; import org.yakindu.sct.model.sgraph.Scope; import org.yakindu.sct.model.sgraph.ScopedElement; import org.yakindu.sct.model.sgraph.SpecificationElement; import org.yakindu.sct.model.sgraph.State; import org.yakindu.sct.model.sgraph.Statechart; import org.yakindu.sct.model.sgraph.Synchronization; import org.yakindu.sct.model.sgraph.Transition; import org.yakindu.sct.model.sgraph.Trigger; import org.yakindu.sct.model.sgraph.Vertex; /** * <!-- begin-user-doc --> * The <b>Switch</b> for the model's inheritance hierarchy. * It supports the call {@link #doSwitch(EObject) doSwitch(object)} * to invoke the <code>caseXXX</code> method for each class of the model, * starting with the actual class of the object * and proceeding up the inheritance hierarchy * until a non-null result is returned, * which is the result of the switch. * <!-- end-user-doc --> * @see org.yakindu.sct.model.sgraph.SGraphPackage * @generated */ public class SGraphSwitch<T> extends Switch<T> { /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public static final String copyright = "Copyright (c) 2011 committers of YAKINDU and others.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\nContributors:\r\ncommitters of YAKINDU - initial API and implementation\r\n"; /** * The cached model package * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected static SGraphPackage modelPackage; /** * Creates an instance of the switch. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public SGraphSwitch() { if (modelPackage == null) { modelPackage = SGraphPackage.eINSTANCE; } } /** * Checks whether this is a switch for the given package. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param ePackage the package in question. * @return whether this is a switch for the given package. * @generated */ @Override protected boolean isSwitchFor(EPackage ePackage) { return ePackage == modelPackage; } /** * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the first non-null result returned by a <code>caseXXX</code> call. * @generated */ @Override protected T doSwitch(int classifierID, EObject theEObject) { switch (classifierID) { case SGraphPackage.PSEUDOSTATE: { Pseudostate pseudostate = (Pseudostate)theEObject; T result = casePseudostate(pseudostate); if (result == null) result = caseVertex(pseudostate); if (result == null) result = caseNamedElement(pseudostate); if (result == null) result = defaultCase(theEObject); return result; } case SGraphPackage.VERTEX: { Vertex vertex = (Vertex)theEObject; T result = caseVertex(vertex); if (result == null) result = caseNamedElement(vertex); if (result == null) result = defaultCase(theEObject); return result; } case SGraphPackage.REGION: { Region region = (Region)theEObject; T result = caseRegion(region); if (result == null) result = caseNamedElement(region); if (result == null) result = defaultCase(theEObject); return result; } case SGraphPackage.TRANSITION: { Transition transition = (Transition)theEObject; T result = caseTransition(transition); if (result == null) result = caseSpecificationElement(transition); if (result == null) result = caseReaction(transition); if (result == null) result = caseDocumentedElement(transition); if (result == null) result = defaultCase(theEObject); return result; } case SGraphPackage.FINAL_STATE: { FinalState finalState = (FinalState)theEObject; T result = caseFinalState(finalState); if (result == null) result = caseRegularState(finalState); if (result == null) result = caseVertex(finalState); if (result == null) result = caseNamedElement(finalState); if (result == null) result = defaultCase(theEObject); return result; } case SGraphPackage.CHOICE: { Choice choice = (Choice)theEObject; T result = caseChoice(choice); if (result == null) result = casePseudostate(choice); if (result == null) result = caseVertex(choice); if (result == null) result = caseNamedElement(choice); if (result == null) result = defaultCase(theEObject); return result; } case SGraphPackage.STATECHART: { Statechart statechart = (Statechart)theEObject; T result = caseStatechart(statechart); if (result == null) result = caseSpecificationElement(statechart); if (result == null) result = caseReactiveElement(statechart); if (result == null) result = caseScopedElement(statechart); if (result == null) result = caseCompositeElement(statechart); if (result == null) result = caseNamedElement(statechart); if (result == null) result = caseDocumentedElement(statechart); if (result == null) result = caseDomainElement(statechart); if (result == null) result = caseAnnotatableElement(statechart); if (result == null) result = defaultCase(theEObject); return result; } case SGraphPackage.ENTRY: { Entry entry = (Entry)theEObject; T result = caseEntry(entry); if (result == null) result = casePseudostate(entry); if (result == null) result = caseVertex(entry); if (result == null) result = caseNamedElement(entry); if (result == null) result = defaultCase(theEObject); return result; } case SGraphPackage.EXIT: { Exit exit = (Exit)theEObject; T result = caseExit(exit); if (result == null) result = casePseudostate(exit); if (result == null) result = caseVertex(exit); if (result == null) result = caseNamedElement(exit); if (result == null) result = defaultCase(theEObject); return result; } case SGraphPackage.REACTIVE_ELEMENT: { ReactiveElement reactiveElement = (ReactiveElement)theEObject; T result = caseReactiveElement(reactiveElement); if (result == null) result = defaultCase(theEObject); return result; } case SGraphPackage.REACTION: { Reaction reaction = (Reaction)theEObject; T result = caseReaction(reaction); if (result == null) result = defaultCase(theEObject); return result; } case SGraphPackage.TRIGGER: { Trigger trigger = (Trigger)theEObject; T result = caseTrigger(trigger); if (result == null) result = defaultCase(theEObject); return result; } case SGraphPackage.EFFECT: { Effect effect = (Effect)theEObject; T result = caseEffect(effect); if (result == null) result = defaultCase(theEObject); return result; } case SGraphPackage.REACTION_PROPERTY: { ReactionProperty reactionProperty = (ReactionProperty)theEObject; T result = caseReactionProperty(reactionProperty); if (result == null) result = defaultCase(theEObject); return result; } case SGraphPackage.SPECIFICATION_ELEMENT: { SpecificationElement specificationElement = (SpecificationElement)theEObject; T result = caseSpecificationElement(specificationElement); if (result == null) result = defaultCase(theEObject); return result; } case SGraphPackage.SCOPE: { Scope scope = (Scope)theEObject; T result = caseScope(scope); if (result == null) result = defaultCase(theEObject); return result; } case SGraphPackage.SCOPED_ELEMENT: { ScopedElement scopedElement = (ScopedElement)theEObject; T result = caseScopedElement(scopedElement); if (result == null) result = defaultCase(theEObject); return result; } case SGraphPackage.SYNCHRONIZATION: { Synchronization synchronization = (Synchronization)theEObject; T result = caseSynchronization(synchronization); if (result == null) result = casePseudostate(synchronization); if (result == null) result = caseVertex(synchronization); if (result == null) result = caseNamedElement(synchronization); if (result == null) result = defaultCase(theEObject); return result; } case SGraphPackage.STATE: { State state = (State)theEObject; T result = caseState(state); if (result == null) result = caseSpecificationElement(state); if (result == null) result = caseReactiveElement(state); if (result == null) result = caseScopedElement(state); if (result == null) result = caseRegularState(state); if (result == null) result = caseCompositeElement(state); if (result == null) result = caseDocumentedElement(state); if (result == null) result = caseVertex(state); if (result == null) result = caseNamedElement(state); if (result == null) result = defaultCase(theEObject); return result; } case SGraphPackage.REGULAR_STATE: { RegularState regularState = (RegularState)theEObject; T result = caseRegularState(regularState); if (result == null) result = caseVertex(regularState); if (result == null) result = caseNamedElement(regularState); if (result == null) result = defaultCase(theEObject); return result; } case SGraphPackage.COMPOSITE_ELEMENT: { CompositeElement compositeElement = (CompositeElement)theEObject; T result = caseCompositeElement(compositeElement); if (result == null) result = defaultCase(theEObject); return result; } case SGraphPackage.IMPORT_DECLARATION: { ImportDeclaration importDeclaration = (ImportDeclaration)theEObject; T result = caseImportDeclaration(importDeclaration); if (result == null) result = caseDeclaration(importDeclaration); if (result == null) result = caseTypedElement(importDeclaration); if (result == null) result = casePackageMember(importDeclaration); if (result == null) result = caseNamedElement(importDeclaration); if (result == null) result = caseAnnotatableElement(importDeclaration); if (result == null) result = defaultCase(theEObject); return result; } default: return defaultCase(theEObject); } } /** * Returns the result of interpreting the object as an instance of '<em>Pseudostate</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Pseudostate</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T casePseudostate(Pseudostate object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Vertex</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Vertex</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseVertex(Vertex object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Named Element</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Named Element</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseNamedElement(NamedElement object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Documented Element</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Documented Element</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseDocumentedElement(DocumentedElement object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Domain Element</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Domain Element</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseDomainElement(DomainElement object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Annotatable Element</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Annotatable Element</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseAnnotatableElement(AnnotatableElement object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Typed Element</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Typed Element</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseTypedElement(TypedElement object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Package Member</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Package Member</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T casePackageMember(PackageMember object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Declaration</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Declaration</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseDeclaration(Declaration object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Region</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Region</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseRegion(Region object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Transition</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Transition</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseTransition(Transition object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Final State</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Final State</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseFinalState(FinalState object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>State</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>State</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseState(State object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Regular State</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Regular State</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseRegularState(RegularState object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Composite Element</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Composite Element</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseCompositeElement(CompositeElement object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Import Declaration</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Import Declaration</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseImportDeclaration(ImportDeclaration object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Choice</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Choice</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseChoice(Choice object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Statechart</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Statechart</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseStatechart(Statechart object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Entry</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Entry</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseEntry(Entry object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Trigger</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Trigger</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseTrigger(Trigger object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Effect</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Effect</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseEffect(Effect object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Reaction Property</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Reaction Property</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseReactionProperty(ReactionProperty object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Specification Element</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Specification Element</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseSpecificationElement(SpecificationElement object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Reaction</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Reaction</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseReaction(Reaction object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Reactive Element</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Reactive Element</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseReactiveElement(ReactiveElement object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Exit</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Exit</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseExit(Exit object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Scope</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Scope</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseScope(Scope object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Scoped Element</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Scoped Element</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseScopedElement(ScopedElement object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Synchronization</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Synchronization</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseSynchronization(Synchronization object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>EObject</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch, but this is the last case anyway. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>EObject</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) * @generated */ @Override public T defaultCase(EObject object) { return null; } } //SGraphSwitch