/****************************************************************************** * Copyright (c) 2008 g-Eclipse consortium * 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 * * Initial development of the original code was made for * project g-Eclipse founded by European Union * project number: FP6-IST-034327 http://www.geclipse.eu/ * * Contributor(s): * UCY (http://www.cs.ucy.ac.cy) * - Nicholas Loulloudes (loulloudes.n@cs.ucy.ac.cy) * *****************************************************************************/ package eu.geclipse.batch.model.qdl.util; import eu.geclipse.batch.model.qdl.*; import java.util.List; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EObject; /** * <!-- 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 eu.geclipse.batch.model.qdl.QdlPackage * @generated */ public class QdlSwitch<T> { /** * The cached model package * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected static QdlPackage modelPackage; /** * Creates an instance of the switch. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public QdlSwitch() { if (modelPackage == null) { modelPackage = QdlPackage.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 QdlPackage.ALLOWED_VIRTUAL_ORGANIZATIONS_TYPE: { AllowedVirtualOrganizationsType allowedVirtualOrganizationsType = (AllowedVirtualOrganizationsType)theEObject; T result = caseAllowedVirtualOrganizationsType(allowedVirtualOrganizationsType); if (result == null) result = defaultCase(theEObject); return result; } case QdlPackage.BOUNDARY_TYPE: { BoundaryType boundaryType = (BoundaryType)theEObject; T result = caseBoundaryType(boundaryType); if (result == null) result = defaultCase(theEObject); return result; } case QdlPackage.DOCUMENT_ROOT: { DocumentRoot documentRoot = (DocumentRoot)theEObject; T result = caseDocumentRoot(documentRoot); if (result == null) result = defaultCase(theEObject); return result; } case QdlPackage.EXACT_TYPE: { ExactType exactType = (ExactType)theEObject; T result = caseExactType(exactType); if (result == null) result = defaultCase(theEObject); return result; } case QdlPackage.INTEGER_BOUNDARY_TYPE: { IntegerBoundaryType integerBoundaryType = (IntegerBoundaryType)theEObject; T result = caseIntegerBoundaryType(integerBoundaryType); if (result == null) result = defaultCase(theEObject); return result; } case QdlPackage.INTEGER_EXACT_TYPE: { IntegerExactType integerExactType = (IntegerExactType)theEObject; T result = caseIntegerExactType(integerExactType); if (result == null) result = defaultCase(theEObject); return result; } case QdlPackage.INTEGER_RANGE_TYPE: { IntegerRangeType integerRangeType = (IntegerRangeType)theEObject; T result = caseIntegerRangeType(integerRangeType); if (result == null) result = defaultCase(theEObject); return result; } case QdlPackage.INTEGER_RANGE_VALUE_TYPE: { IntegerRangeValueType integerRangeValueType = (IntegerRangeValueType)theEObject; T result = caseIntegerRangeValueType(integerRangeValueType); if (result == null) result = defaultCase(theEObject); return result; } case QdlPackage.QUEUE_TYPE: { QueueType queueType = (QueueType)theEObject; T result = caseQueueType(queueType); if (result == null) result = defaultCase(theEObject); return result; } case QdlPackage.RANGE_TYPE: { RangeType rangeType = (RangeType)theEObject; T result = caseRangeType(rangeType); if (result == null) result = defaultCase(theEObject); return result; } case QdlPackage.RANGE_VALUE_TYPE: { RangeValueType rangeValueType = (RangeValueType)theEObject; T result = caseRangeValueType(rangeValueType); if (result == null) result = defaultCase(theEObject); return result; } default: return defaultCase(theEObject); } } /** * Returns the result of interpreting the object as an instance of '<em>Allowed Virtual Organizations Type</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>Allowed Virtual Organizations Type</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseAllowedVirtualOrganizationsType(AllowedVirtualOrganizationsType object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Boundary Type</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>Boundary Type</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseBoundaryType(BoundaryType object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Document Root</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>Document Root</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseDocumentRoot(DocumentRoot object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Exact Type</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>Exact Type</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseExactType(ExactType object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Integer Boundary Type</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>Integer Boundary Type</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseIntegerBoundaryType(IntegerBoundaryType object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Integer Exact Type</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>Integer Exact Type</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseIntegerExactType(IntegerExactType object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Integer Range Type</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>Integer Range Type</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseIntegerRangeType(IntegerRangeType object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Integer Range Value Type</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>Integer Range Value Type</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseIntegerRangeValueType(IntegerRangeValueType object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Queue Type</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>Queue Type</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseQueueType(QueueType object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Range Type</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>Range Type</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseRangeType(RangeType object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Range Value Type</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>Range Value Type</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseRangeValueType(RangeValueType 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; } } //QdlSwitch