| /** |
| * * Copyright (c) 2006-2010 Istvan Rath and Daniel Varro |
| * * 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: |
| * * Istvan Rath, Daniel Varro - initial API and implementation |
| * |
| */ |
| package org.eclipse.viatra2.gtasmmodel.gtasm.metamodel.asm.definitions.util; |
| |
| import java.util.List; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.EObject; |
| |
| import org.eclipse.viatra2.gtasmmodel.gtasm.metamodel.asm.core.AnnotatedElement; |
| import org.eclipse.viatra2.gtasmmodel.gtasm.metamodel.asm.core.GTASMElement; |
| |
| import org.eclipse.viatra2.gtasmmodel.gtasm.metamodel.asm.definitions.*; |
| |
| import org.eclipse.viatra2.gtasmmodel.gtasm.metamodel.gt.PatternContainer; |
| |
| /** |
| * <!-- 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.eclipse.viatra2.gtasmmodel.gtasm.metamodel.asm.definitions.DefinitionsPackage |
| * @generated |
| */ |
| public class DefinitionsSwitch<T> |
| { |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static final String copyright = " * Copyright (c) 2006-2010 Istvan Rath and Daniel Varro\r\n * All rights reserved. This program and the accompanying materials\r\n * are made available under the terms of the Eclipse Public License v1.0\r\n * which accompanies this distribution, and is available at\r\n * http://www.eclipse.org/legal/epl-v10.html\r\n *\r\n * Contributors:\r\n * Istvan Rath, Daniel Varro - initial API and implementation\r\n"; |
| |
| /** |
| * The cached model package |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected static DefinitionsPackage modelPackage; |
| |
| /** |
| * Creates an instance of the switch. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public DefinitionsSwitch() |
| { |
| if (modelPackage == null) |
| { |
| modelPackage = DefinitionsPackage.eINSTANCE; |
| } |
| } |
| |
| /** |
| * 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 |
| */ |
| public T doSwitch(EObject theEObject) |
| { |
| return doSwitch(theEObject.eClass(), theEObject); |
| } |
| |
| /** |
| * 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 |
| */ |
| protected T doSwitch(EClass theEClass, EObject theEObject) |
| { |
| if (theEClass.eContainer() == modelPackage) |
| { |
| return doSwitch(theEClass.getClassifierID(), theEObject); |
| } |
| else |
| { |
| List<EClass> eSuperTypes = theEClass.getESuperTypes(); |
| return |
| eSuperTypes.isEmpty() ? |
| defaultCase(theEObject) : |
| doSwitch(eSuperTypes.get(0), theEObject); |
| } |
| } |
| |
| /** |
| * 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 |
| */ |
| protected T doSwitch(int classifierID, EObject theEObject) |
| { |
| switch (classifierID) |
| { |
| case DefinitionsPackage.MACHINE: |
| { |
| Machine machine = (Machine)theEObject; |
| T result = caseMachine(machine); |
| if (result == null) result = casePatternContainer(machine); |
| if (result == null) result = caseGTASMElement(machine); |
| if (result == null) result = caseAnnotatedElement(machine); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case DefinitionsPackage.RULE: |
| { |
| Rule rule = (Rule)theEObject; |
| T result = caseRule(rule); |
| if (result == null) result = caseGTASMElement(rule); |
| if (result == null) result = caseAnnotatedElement(rule); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case DefinitionsPackage.VARIABLE: |
| { |
| Variable variable = (Variable)theEObject; |
| T result = caseVariable(variable); |
| if (result == null) result = caseGTASMElement(variable); |
| if (result == null) result = caseAnnotatedElement(variable); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case DefinitionsPackage.VARIABLE_DEFINITION: |
| { |
| VariableDefinition variableDefinition = (VariableDefinition)theEObject; |
| T result = caseVariableDefinition(variableDefinition); |
| if (result == null) result = caseGTASMElement(variableDefinition); |
| if (result == null) result = caseAnnotatedElement(variableDefinition); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case DefinitionsPackage.ASM_FUNCTION: |
| { |
| ASMFunction asmFunction = (ASMFunction)theEObject; |
| T result = caseASMFunction(asmFunction); |
| if (result == null) result = caseFunctionDefinition(asmFunction); |
| if (result == null) result = caseGTASMElement(asmFunction); |
| if (result == null) result = caseAnnotatedElement(asmFunction); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case DefinitionsPackage.FUNCTION_DEFINITION: |
| { |
| FunctionDefinition functionDefinition = (FunctionDefinition)theEObject; |
| T result = caseFunctionDefinition(functionDefinition); |
| if (result == null) result = caseGTASMElement(functionDefinition); |
| if (result == null) result = caseAnnotatedElement(functionDefinition); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case DefinitionsPackage.INITIAL_VALUE: |
| { |
| InitialValue initialValue = (InitialValue)theEObject; |
| T result = caseInitialValue(initialValue); |
| if (result == null) result = caseGTASMElement(initialValue); |
| if (result == null) result = caseAnnotatedElement(initialValue); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case DefinitionsPackage.SYMBOLIC_RULE_PARAMETER: |
| { |
| SymbolicRuleParameter symbolicRuleParameter = (SymbolicRuleParameter)theEObject; |
| T result = caseSymbolicRuleParameter(symbolicRuleParameter); |
| if (result == null) result = caseGTASMElement(symbolicRuleParameter); |
| if (result == null) result = caseAnnotatedElement(symbolicRuleParameter); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case DefinitionsPackage.MODULE: |
| { |
| Module module = (Module)theEObject; |
| T result = caseModule(module); |
| if (result == null) result = caseGTASMElement(module); |
| if (result == null) result = caseAnnotatedElement(module); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case DefinitionsPackage.IMPORT_DECLARATION: |
| { |
| ImportDeclaration importDeclaration = (ImportDeclaration)theEObject; |
| T result = caseImportDeclaration(importDeclaration); |
| if (result == null) result = caseGTASMElement(importDeclaration); |
| if (result == null) result = caseAnnotatedElement(importDeclaration); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case DefinitionsPackage.NAMESPACE_DEFINITION: |
| { |
| NamespaceDefinition namespaceDefinition = (NamespaceDefinition)theEObject; |
| T result = caseNamespaceDefinition(namespaceDefinition); |
| if (result == null) result = caseGTASMElement(namespaceDefinition); |
| if (result == null) result = caseAnnotatedElement(namespaceDefinition); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case DefinitionsPackage.TRANSFORMATION: |
| { |
| Transformation transformation = (Transformation)theEObject; |
| T result = caseTransformation(transformation); |
| if (result == null) result = caseGTASMElement(transformation); |
| if (result == null) result = caseAnnotatedElement(transformation); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case DefinitionsPackage.TYPE_CONSTANT: |
| { |
| TypeConstant typeConstant = (TypeConstant)theEObject; |
| T result = caseTypeConstant(typeConstant); |
| if (result == null) result = caseGTASMElement(typeConstant); |
| if (result == null) result = caseAnnotatedElement(typeConstant); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case DefinitionsPackage.CHANGE_EVENT: |
| { |
| ChangeEvent changeEvent = (ChangeEvent)theEObject; |
| T result = caseChangeEvent(changeEvent); |
| if (result == null) result = caseGTASMElement(changeEvent); |
| if (result == null) result = caseAnnotatedElement(changeEvent); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| default: return defaultCase(theEObject); |
| } |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Machine</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>Machine</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T caseMachine(Machine object) |
| { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Rule</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>Rule</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T caseRule(Rule object) |
| { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Variable</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>Variable</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T caseVariable(Variable object) |
| { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Variable Definition</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>Variable Definition</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T caseVariableDefinition(VariableDefinition object) |
| { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>ASM Function</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>ASM Function</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T caseASMFunction(ASMFunction object) |
| { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Function Definition</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>Function Definition</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T caseFunctionDefinition(FunctionDefinition object) |
| { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Initial Value</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>Initial Value</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T caseInitialValue(InitialValue object) |
| { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Symbolic Rule Parameter</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>Symbolic Rule Parameter</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T caseSymbolicRuleParameter(SymbolicRuleParameter object) |
| { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Module</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>Module</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T caseModule(Module 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>Namespace Definition</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>Namespace Definition</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T caseNamespaceDefinition(NamespaceDefinition object) |
| { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Transformation</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>Transformation</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T caseTransformation(Transformation object) |
| { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Type Constant</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>Type Constant</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T caseTypeConstant(TypeConstant object) |
| { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Change Event</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>Change Event</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T caseChangeEvent(ChangeEvent object) |
| { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Annotated 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>Annotated Element</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T caseAnnotatedElement(AnnotatedElement object) |
| { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>GTASM 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>GTASM Element</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T caseGTASMElement(GTASMElement object) |
| { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Pattern Container</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>Pattern Container</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T casePatternContainer(PatternContainer 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 |
| */ |
| public T defaultCase(EObject object) |
| { |
| return null; |
| } |
| |
| } //DefinitionsSwitch |