diff options
Diffstat (limited to 'extraplugins/eastadl/org.eclipse.papyrus.eastadl/src/org/eclipse/papyrus/eastadl/dependability/safetycase/util/SafetycaseSwitch.java')
-rw-r--r-- | extraplugins/eastadl/org.eclipse.papyrus.eastadl/src/org/eclipse/papyrus/eastadl/dependability/safetycase/util/SafetycaseSwitch.java | 249 |
1 files changed, 249 insertions, 0 deletions
diff --git a/extraplugins/eastadl/org.eclipse.papyrus.eastadl/src/org/eclipse/papyrus/eastadl/dependability/safetycase/util/SafetycaseSwitch.java b/extraplugins/eastadl/org.eclipse.papyrus.eastadl/src/org/eclipse/papyrus/eastadl/dependability/safetycase/util/SafetycaseSwitch.java new file mode 100644 index 00000000000..b3acfd59f45 --- /dev/null +++ b/extraplugins/eastadl/org.eclipse.papyrus.eastadl/src/org/eclipse/papyrus/eastadl/dependability/safetycase/util/SafetycaseSwitch.java @@ -0,0 +1,249 @@ +/***************************************************************************** + * 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: + * Sara TUCCI (CEA LIST) sara.tucci@cea.fr - Initial API and implementation + * Chokri MRAIDHA (CEA LIST) chokri.mraidha@cea.fr - Initial API and implementation + * David SERVAT (CEA LIST) david.servat@cea.fr - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.eastadl.dependability.safetycase.util; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.util.Switch; +import org.eclipse.papyrus.eastadl.dependability.safetycase.Claim; +import org.eclipse.papyrus.eastadl.dependability.safetycase.Ground; +import org.eclipse.papyrus.eastadl.dependability.safetycase.SafetyCase; +import org.eclipse.papyrus.eastadl.dependability.safetycase.SafetycasePackage; +import org.eclipse.papyrus.eastadl.dependability.safetycase.Warrant; +import org.eclipse.papyrus.eastadl.infrastructure.elements.EAElement; +import org.eclipse.papyrus.eastadl.infrastructure.elements.EAPackageableElement; +import org.eclipse.papyrus.eastadl.infrastructure.elements.TraceableSpecification; + + +/** + * <!-- 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.eastadl.dependability.safetycase.SafetycasePackage + * @generated + */ +public class SafetycaseSwitch<T> extends Switch<T> { + /** + * The cached model package + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected static SafetycasePackage modelPackage; + + /** + * Creates an instance of the switch. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public SafetycaseSwitch() { + if (modelPackage == null) { + modelPackage = SafetycasePackage.eINSTANCE; + } + } + + /** + * Checks whether this is a switch for the given package. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @parameter 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; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Claim</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>Claim</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseClaim(Claim object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>EA 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>EA Element</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseEAElement(EAElement object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>EA Packageable 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>EA Packageable Element</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseEAPackageableElement(EAPackageableElement object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Ground</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>Ground</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseGround(Ground object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Safety Case</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>Safety Case</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseSafetyCase(SafetyCase object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Traceable Specification</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>Traceable Specification</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseTraceableSpecification(TraceableSpecification object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Warrant</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>Warrant</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseWarrant(Warrant 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; + } + + /** + * 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 SafetycasePackage.SAFETY_CASE: { + SafetyCase safetyCase = (SafetyCase)theEObject; + T result = caseSafetyCase(safetyCase); + if (result == null) result = caseTraceableSpecification(safetyCase); + if (result == null) result = caseEAPackageableElement(safetyCase); + if (result == null) result = caseEAElement(safetyCase); + if (result == null) result = defaultCase(theEObject); + return result; + } + case SafetycasePackage.GROUND: { + Ground ground = (Ground)theEObject; + T result = caseGround(ground); + if (result == null) result = caseTraceableSpecification(ground); + if (result == null) result = caseEAPackageableElement(ground); + if (result == null) result = caseEAElement(ground); + if (result == null) result = defaultCase(theEObject); + return result; + } + case SafetycasePackage.WARRANT: { + Warrant warrant = (Warrant)theEObject; + T result = caseWarrant(warrant); + if (result == null) result = caseTraceableSpecification(warrant); + if (result == null) result = caseEAPackageableElement(warrant); + if (result == null) result = caseEAElement(warrant); + if (result == null) result = defaultCase(theEObject); + return result; + } + case SafetycasePackage.CLAIM: { + Claim claim = (Claim)theEObject; + T result = caseClaim(claim); + if (result == null) result = caseTraceableSpecification(claim); + if (result == null) result = caseEAPackageableElement(claim); + if (result == null) result = caseEAElement(claim); + if (result == null) result = defaultCase(theEObject); + return result; + } + default: return defaultCase(theEObject); + } + } + +} //SafetycaseSwitch |