/***************************************************************************** * 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.structure.featuremodeling.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.infrastructure.elements.Context; import org.eclipse.papyrus.eastadl.infrastructure.elements.EAElement; import org.eclipse.papyrus.eastadl.infrastructure.elements.Relationship; import org.eclipse.papyrus.eastadl.structure.featuremodeling.BindingTime; import org.eclipse.papyrus.eastadl.structure.featuremodeling.Feature; import org.eclipse.papyrus.eastadl.structure.featuremodeling.FeatureConstraint; import org.eclipse.papyrus.eastadl.structure.featuremodeling.FeatureGroup; import org.eclipse.papyrus.eastadl.structure.featuremodeling.FeatureLink; import org.eclipse.papyrus.eastadl.structure.featuremodeling.FeatureModel; import org.eclipse.papyrus.eastadl.structure.featuremodeling.FeatureTreeNode; import org.eclipse.papyrus.eastadl.structure.featuremodeling.FeaturemodelingPackage; /** * The Switch for the model's inheritance hierarchy. It supports the * call {@link #doSwitch(EObject) doSwitch(object)} to invoke the caseXXX 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. * * @see org.eclipse.papyrus.eastadl.structure.featuremodeling.FeaturemodelingPackage * @generated */ public class FeaturemodelingSwitch extends Switch { /** * The cached model package * * @generated */ protected static FeaturemodelingPackage modelPackage; /** * Creates an instance of the switch. * * @generated */ public FeaturemodelingSwitch() { if (modelPackage == null) { modelPackage = FeaturemodelingPackage.eINSTANCE; } } /** * Checks whether this is a switch for the given package. * * * @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 'Binding Time'. This implementation returns null; returning a non-null result will * terminate the switch. * * @param object * the target of the switch. * @return the result of interpreting the object as an instance of 'Binding Time'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseBindingTime(BindingTime object) { return null; } /** * Returns the result of interpreting the object as an instance of 'Context'. * * This implementation returns null; * returning a non-null result will terminate the switch. * * @param object the target of the switch. * @return the result of interpreting the object as an instance of 'Context'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseContext(Context object) { return null; } /** * Returns the result of interpreting the object as an instance of 'Feature'. This implementation returns null; returning a non-null result will * terminate the switch. * * @param object * the target of the switch. * @return the result of interpreting the object as an instance of 'Feature'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseFeature(Feature object) { return null; } /** * Returns the result of interpreting the object as an instance of 'Feature Constraint'. * This implementation returns null; returning a non-null result will * terminate the switch. * @param object the target of the switch. * @return the result of interpreting the object as an instance of 'Feature Constraint'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseFeatureConstraint(FeatureConstraint object) { return null; } /** * Returns the result of interpreting the object as an instance of 'Feature Group'. * This implementation returns null; returning a non-null result will * terminate the switch. * @param object the target of the switch. * @return the result of interpreting the object as an instance of 'Feature Group'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseFeatureGroup(FeatureGroup object) { return null; } /** * Returns the result of interpreting the object as an instance of 'EA Element'. * * This implementation returns null; * returning a non-null result will terminate the switch. * * @param object the target of the switch. * @return the result of interpreting the object as an instance of 'EA Element'. * @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 'Feature Link'. This implementation returns null; returning a non-null result will * terminate the switch. * * @param object * the target of the switch. * @return the result of interpreting the object as an instance of 'Feature Link'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseFeatureLink(FeatureLink object) { return null; } /** * Returns the result of interpreting the object as an instance of 'Feature Model'. * This implementation returns null; returning a non-null result will * terminate the switch. * @param object the target of the switch. * @return the result of interpreting the object as an instance of 'Feature Model'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseFeatureModel(FeatureModel object) { return null; } /** * Returns the result of interpreting the object as an instance of 'Feature Tree Node'. * This implementation returns null; returning a non-null result will * terminate the switch. * @param object the target of the switch. * @return the result of interpreting the object as an instance of 'Feature Tree Node'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseFeatureTreeNode(FeatureTreeNode object) { return null; } /** * Returns the result of interpreting the object as an instance of 'Relationship'. * * This implementation returns null; * returning a non-null result will terminate the switch. * * @param object the target of the switch. * @return the result of interpreting the object as an instance of 'Relationship'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseRelationship(Relationship object) { return null; } /** * Returns the result of interpreting the object as an instance of 'EObject'. This implementation returns null; returning a non-null result will * terminate the switch, but this is the last case anyway. * * @param object * the target of the switch. * @return the result of interpreting the object as an instance of 'EObject'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) * @generated */ @Override public T defaultCase(EObject object) { return null; } /** * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. * * @return the first non-null result returned by a caseXXX call. * @generated */ @Override protected T doSwitch(int classifierID, EObject theEObject) { switch (classifierID) { case FeaturemodelingPackage.FEATURE_MODEL: { FeatureModel featureModel = (FeatureModel)theEObject; T result = caseFeatureModel(featureModel); if (result == null) result = caseContext(featureModel); if (result == null) result = caseEAElement(featureModel); if (result == null) result = defaultCase(theEObject); return result; } case FeaturemodelingPackage.FEATURE: { Feature feature = (Feature)theEObject; T result = caseFeature(feature); if (result == null) result = caseFeatureTreeNode(feature); if (result == null) result = caseContext(feature); if (result == null) result = caseEAElement(feature); if (result == null) result = defaultCase(theEObject); return result; } case FeaturemodelingPackage.FEATURE_TREE_NODE: { FeatureTreeNode featureTreeNode = (FeatureTreeNode)theEObject; T result = caseFeatureTreeNode(featureTreeNode); if (result == null) result = caseContext(featureTreeNode); if (result == null) result = caseEAElement(featureTreeNode); if (result == null) result = defaultCase(theEObject); return result; } case FeaturemodelingPackage.BINDING_TIME: { BindingTime bindingTime = (BindingTime)theEObject; T result = caseBindingTime(bindingTime); if (result == null) result = caseEAElement(bindingTime); if (result == null) result = defaultCase(theEObject); return result; } case FeaturemodelingPackage.FEATURE_LINK: { FeatureLink featureLink = (FeatureLink)theEObject; T result = caseFeatureLink(featureLink); if (result == null) result = caseRelationship(featureLink); if (result == null) result = caseEAElement(featureLink); if (result == null) result = defaultCase(theEObject); return result; } case FeaturemodelingPackage.FEATURE_CONSTRAINT: { FeatureConstraint featureConstraint = (FeatureConstraint)theEObject; T result = caseFeatureConstraint(featureConstraint); if (result == null) result = caseEAElement(featureConstraint); if (result == null) result = defaultCase(theEObject); return result; } case FeaturemodelingPackage.FEATURE_GROUP: { FeatureGroup featureGroup = (FeatureGroup)theEObject; T result = caseFeatureGroup(featureGroup); if (result == null) result = caseFeatureTreeNode(featureGroup); if (result == null) result = caseContext(featureGroup); if (result == null) result = caseEAElement(featureGroup); if (result == null) result = defaultCase(theEObject); return result; } default: return defaultCase(theEObject); } } } // FeaturemodelingSwitch