/* license-start * * Copyright (C) 2008 - 2013 Crispico, <http://www.crispico.com/>. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation version 3. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details, at <http://www.gnu.org/licenses/>. * * Contributors: * Crispico - Initial API and implementation * * license-end */ /** * <copyright> * </copyright> * * $Id$ */ package com.crispico.flower.mp.model.codesync.util; import com.crispico.flower.mp.model.codesync.*; import java.io.Serializable; import java.util.Map; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.emf.ecore.util.Switch; import com.crispico.flower.mp.model.codesync.AstCacheElement; import com.crispico.flower.mp.model.codesync.CodeSyncElement; import com.crispico.flower.mp.model.codesync.CodeSyncPackage; import com.crispico.flower.mp.model.codesync.CodeSyncRoot; import com.crispico.flower.mp.model.codesync.FeatureChange; /** * <!-- 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 com.crispico.flower.mp.model.codesync.CodeSyncPackage * @generated */ public class CodeSyncSwitch<T> extends Switch<T> { /** * The cached model package * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected static CodeSyncPackage modelPackage; /** * Creates an instance of the switch. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public CodeSyncSwitch() { if (modelPackage == null) { modelPackage = CodeSyncPackage.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; } /** * 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 CodeSyncPackage.CODE_SYNC_ELEMENT: { CodeSyncElement codeSyncElement = (CodeSyncElement)theEObject; T result = caseCodeSyncElement(codeSyncElement); if (result == null) result = defaultCase(theEObject); return result; } case CodeSyncPackage.ESTRUCTURAL_FEATURE_TO_FEATURE_CHANGE_ENTRY: { @SuppressWarnings("unchecked") Map.Entry<EStructuralFeature, FeatureChange> eStructuralFeatureToFeatureChangeEntry = (Map.Entry<EStructuralFeature, FeatureChange>)theEObject; T result = caseEStructuralFeatureToFeatureChangeEntry(eStructuralFeatureToFeatureChangeEntry); if (result == null) result = defaultCase(theEObject); return result; } case CodeSyncPackage.FEATURE_CHANGE: { FeatureChange featureChange = (FeatureChange)theEObject; T result = caseFeatureChange(featureChange); if (result == null) result = defaultCase(theEObject); return result; } case CodeSyncPackage.CODE_SYNC_ROOT: { CodeSyncRoot codeSyncRoot = (CodeSyncRoot)theEObject; T result = caseCodeSyncRoot(codeSyncRoot); if (result == null) result = caseCodeSyncElement(codeSyncRoot); if (result == null) result = defaultCase(theEObject); return result; } case CodeSyncPackage.AST_CACHE_ELEMENT: { AstCacheElement astCacheElement = (AstCacheElement)theEObject; T result = caseAstCacheElement(astCacheElement); if (result == null) result = caseSerializable(astCacheElement); if (result == null) result = defaultCase(theEObject); return result; } case CodeSyncPackage.SCENARIO_ELEMENT: { ScenarioElement scenarioElement = (ScenarioElement)theEObject; T result = caseScenarioElement(scenarioElement); if (result == null) result = caseCodeSyncElement(scenarioElement); if (result == null) result = defaultCase(theEObject); return result; } case CodeSyncPackage.MIND_MAP_ELEMENT: { MindMapElement mindMapElement = (MindMapElement)theEObject; T result = caseMindMapElement(mindMapElement); if (result == null) result = caseCodeSyncElement(mindMapElement); if (result == null) result = defaultCase(theEObject); return result; } case CodeSyncPackage.MIND_MAP_ROOT: { MindMapRoot mindMapRoot = (MindMapRoot)theEObject; T result = caseMindMapRoot(mindMapRoot); if (result == null) result = caseCodeSyncRoot(mindMapRoot); if (result == null) result = caseMindMapElement(mindMapRoot); if (result == null) result = caseCodeSyncElement(mindMapRoot); if (result == null) result = defaultCase(theEObject); return result; } case CodeSyncPackage.RELATION: { Relation relation = (Relation)theEObject; T result = caseRelation(relation); if (result == null) result = defaultCase(theEObject); return result; } default: return defaultCase(theEObject); } } /** * Returns the result of interpreting the object as an instance of '<em>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>Element</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseCodeSyncElement(CodeSyncElement object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>EStructural Feature To Feature Change Entry</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>EStructural Feature To Feature Change Entry</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseEStructuralFeatureToFeatureChangeEntry(Map.Entry<EStructuralFeature, FeatureChange> object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Feature Change</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>Feature Change</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseFeatureChange(FeatureChange object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>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>Root</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseCodeSyncRoot(CodeSyncRoot object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Ast Cache 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>Ast Cache Element</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseAstCacheElement(AstCacheElement object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Serializable</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>Serializable</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseSerializable(Serializable object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Scenario 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>Scenario Element</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseScenarioElement(ScenarioElement object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Mind Map 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>Mind Map Element</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseMindMapElement(MindMapElement object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Mind Map 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>Mind Map Root</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseMindMapRoot(MindMapRoot object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Relation</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>Relation</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseRelation(Relation 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; } } //CodeSyncSwitch