Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'extraplugins/marte/org.eclipse.papyrus.marte.static.profile/src/org/eclipse/papyrus/MARTE/MARTE_DesignModel/HRM/HwLogical/HwComputing/util/HwComputingSwitch.java')
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.marte.static.profile/src/org/eclipse/papyrus/MARTE/MARTE_DesignModel/HRM/HwLogical/HwComputing/util/HwComputingSwitch.java331
1 files changed, 331 insertions, 0 deletions
diff --git a/extraplugins/marte/org.eclipse.papyrus.marte.static.profile/src/org/eclipse/papyrus/MARTE/MARTE_DesignModel/HRM/HwLogical/HwComputing/util/HwComputingSwitch.java b/extraplugins/marte/org.eclipse.papyrus.marte.static.profile/src/org/eclipse/papyrus/MARTE/MARTE_DesignModel/HRM/HwLogical/HwComputing/util/HwComputingSwitch.java
new file mode 100644
index 00000000000..dfd0ce92d66
--- /dev/null
+++ b/extraplugins/marte/org.eclipse.papyrus.marte.static.profile/src/org/eclipse/papyrus/MARTE/MARTE_DesignModel/HRM/HwLogical/HwComputing/util/HwComputingSwitch.java
@@ -0,0 +1,331 @@
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * 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:
+ * Chokri MRAIDHA (CEA LIST) chokri.mraidha@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.MARTE.MARTE_DesignModel.HRM.HwLogical.HwComputing.util;
+
+import java.util.List;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.papyrus.MARTE.MARTE_DesignModel.HRM.HwGeneral.HwResource;
+
+import org.eclipse.papyrus.MARTE.MARTE_DesignModel.HRM.HwLogical.HwComputing.*;
+
+import org.eclipse.papyrus.MARTE.MARTE_Foundations.GRM.ComputingResource;
+import org.eclipse.papyrus.MARTE.MARTE_Foundations.GRM.ProcessingResource;
+import org.eclipse.papyrus.MARTE.MARTE_Foundations.GRM.Resource;
+
+/**
+ * <!-- 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.papyrus.MARTE.MARTE_DesignModel.HRM.HwLogical.HwComputing.HwComputingPackage
+ * @generated
+ */
+public class HwComputingSwitch<T> {
+ /**
+ * The cached model package
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static HwComputingPackage modelPackage;
+
+ /**
+ * Creates an instance of the switch.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public HwComputingSwitch() {
+ if (modelPackage == null) {
+ modelPackage = HwComputingPackage.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 HwComputingPackage.HW_PROCESSOR: {
+ HwProcessor hwProcessor = (HwProcessor)theEObject;
+ T result = caseHwProcessor(hwProcessor);
+ if (result == null) result = caseHwComputingResource(hwProcessor);
+ if (result == null) result = caseHwResource(hwProcessor);
+ if (result == null) result = caseComputingResource(hwProcessor);
+ if (result == null) result = caseProcessingResource(hwProcessor);
+ if (result == null) result = caseResource(hwProcessor);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case HwComputingPackage.HW_COMPUTING_RESOURCE: {
+ HwComputingResource hwComputingResource = (HwComputingResource)theEObject;
+ T result = caseHwComputingResource(hwComputingResource);
+ if (result == null) result = caseHwResource(hwComputingResource);
+ if (result == null) result = caseComputingResource(hwComputingResource);
+ if (result == null) result = caseProcessingResource(hwComputingResource);
+ if (result == null) result = caseResource(hwComputingResource);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case HwComputingPackage.HW_ISA: {
+ HwISA hwISA = (HwISA)theEObject;
+ T result = caseHwISA(hwISA);
+ if (result == null) result = caseHwResource(hwISA);
+ if (result == null) result = caseResource(hwISA);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case HwComputingPackage.HW_BRANCH_PREDICTOR: {
+ HwBranchPredictor hwBranchPredictor = (HwBranchPredictor)theEObject;
+ T result = caseHwBranchPredictor(hwBranchPredictor);
+ if (result == null) result = caseHwResource(hwBranchPredictor);
+ if (result == null) result = caseResource(hwBranchPredictor);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case HwComputingPackage.HW_ASIC: {
+ HwASIC hwASIC = (HwASIC)theEObject;
+ T result = caseHwASIC(hwASIC);
+ if (result == null) result = caseHwComputingResource(hwASIC);
+ if (result == null) result = caseHwResource(hwASIC);
+ if (result == null) result = caseComputingResource(hwASIC);
+ if (result == null) result = caseProcessingResource(hwASIC);
+ if (result == null) result = caseResource(hwASIC);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case HwComputingPackage.HW_PLD: {
+ HwPLD hwPLD = (HwPLD)theEObject;
+ T result = caseHwPLD(hwPLD);
+ if (result == null) result = caseHwComputingResource(hwPLD);
+ if (result == null) result = caseHwResource(hwPLD);
+ if (result == null) result = caseComputingResource(hwPLD);
+ if (result == null) result = caseProcessingResource(hwPLD);
+ if (result == null) result = caseResource(hwPLD);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ default: return defaultCase(theEObject);
+ }
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Hw Processor</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>Hw Processor</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseHwProcessor(HwProcessor object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Resource</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>Resource</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseHwComputingResource(HwComputingResource object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Hw ISA</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>Hw ISA</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseHwISA(HwISA object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Hw Branch Predictor</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>Hw Branch Predictor</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseHwBranchPredictor(HwBranchPredictor object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Hw ASIC</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>Hw ASIC</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseHwASIC(HwASIC object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Hw PLD</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>Hw PLD</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseHwPLD(HwPLD object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Resource</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>Resource</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseResource(Resource object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Hw Resource</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>Hw Resource</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseHwResource(HwResource object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Processing Resource</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>Processing Resource</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseProcessingResource(ProcessingResource object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Computing Resource</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>Computing Resource</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseComputingResource(ComputingResource 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;
+ }
+
+} //HwComputingSwitch

Back to the top