| /******************************************************************************* |
| * Copyright (c) 2006 IBM Corporation and others. |
| * 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: |
| * IBM Corporation - initial API and implementation |
| *******************************************************************************/ |
| package org.eclipse.ui.examples.views.properties.tabbed.hockeyleague.util; |
| |
| |
| import java.util.List; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.EObject; |
| import org.eclipse.ui.examples.views.properties.tabbed.hockeyleague.*; |
| |
| /** |
| * <!-- 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.ui.examples.views.properties.tabbed.hockeyleague.HockeyleaguePackage |
| * @generated |
| */ |
| public class HockeyleagueSwitch { |
| /** |
| * The cached model package |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected static HockeyleaguePackage modelPackage; |
| |
| /** |
| * Creates an instance of the switch. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public HockeyleagueSwitch() { |
| if (modelPackage == null) { |
| modelPackage = HockeyleaguePackage.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 Object 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 Object doSwitch(EClass theEClass, EObject theEObject) { |
| if (theEClass.eContainer() == modelPackage) { |
| return doSwitch(theEClass.getClassifierID(), theEObject); |
| } |
| else { |
| List eSuperTypes = theEClass.getESuperTypes(); |
| return |
| eSuperTypes.isEmpty() ? |
| defaultCase(theEObject) : |
| doSwitch((EClass)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 Object doSwitch(int classifierID, EObject theEObject) { |
| switch (classifierID) { |
| case HockeyleaguePackage.ARENA: { |
| Arena arena = (Arena)theEObject; |
| Object result = caseArena(arena); |
| if (result == null) result = caseHockeyleagueObject(arena); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case HockeyleaguePackage.DEFENCE: { |
| Defence defence = (Defence)theEObject; |
| Object result = caseDefence(defence); |
| if (result == null) result = casePlayer(defence); |
| if (result == null) result = caseHockeyleagueObject(defence); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case HockeyleaguePackage.FORWARD: { |
| Forward forward = (Forward)theEObject; |
| Object result = caseForward(forward); |
| if (result == null) result = casePlayer(forward); |
| if (result == null) result = caseHockeyleagueObject(forward); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case HockeyleaguePackage.GOALIE: { |
| Goalie goalie = (Goalie)theEObject; |
| Object result = caseGoalie(goalie); |
| if (result == null) result = casePlayer(goalie); |
| if (result == null) result = caseHockeyleagueObject(goalie); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case HockeyleaguePackage.GOALIE_STATS: { |
| GoalieStats goalieStats = (GoalieStats)theEObject; |
| Object result = caseGoalieStats(goalieStats); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case HockeyleaguePackage.HOCKEYLEAGUE_OBJECT: { |
| HockeyleagueObject hockeyleagueObject = (HockeyleagueObject)theEObject; |
| Object result = caseHockeyleagueObject(hockeyleagueObject); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case HockeyleaguePackage.LEAGUE: { |
| League league = (League)theEObject; |
| Object result = caseLeague(league); |
| if (result == null) result = caseHockeyleagueObject(league); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case HockeyleaguePackage.PLAYER: { |
| Player player = (Player)theEObject; |
| Object result = casePlayer(player); |
| if (result == null) result = caseHockeyleagueObject(player); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case HockeyleaguePackage.PLAYER_STATS: { |
| PlayerStats playerStats = (PlayerStats)theEObject; |
| Object result = casePlayerStats(playerStats); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case HockeyleaguePackage.TEAM: { |
| Team team = (Team)theEObject; |
| Object result = caseTeam(team); |
| if (result == null) result = caseHockeyleagueObject(team); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| default: return defaultCase(theEObject); |
| } |
| } |
| |
| /** |
| * Returns the result of interpretting the object as an instance of '<em>Arena</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 interpretting the object as an instance of '<em>Arena</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public Object caseArena(Arena object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpretting the object as an instance of '<em>Defence</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 interpretting the object as an instance of '<em>Defence</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public Object caseDefence(Defence object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpretting the object as an instance of '<em>Forward</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 interpretting the object as an instance of '<em>Forward</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public Object caseForward(Forward object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpretting the object as an instance of '<em>Goalie</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 interpretting the object as an instance of '<em>Goalie</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public Object caseGoalie(Goalie object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpretting the object as an instance of '<em>Goalie Stats</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 interpretting the object as an instance of '<em>Goalie Stats</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public Object caseGoalieStats(GoalieStats object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpretting the object as an instance of '<em>Object</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 interpretting the object as an instance of '<em>Object</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public Object caseHockeyleagueObject(HockeyleagueObject object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpretting the object as an instance of '<em>League</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 interpretting the object as an instance of '<em>League</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public Object caseLeague(League object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpretting the object as an instance of '<em>Player</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 interpretting the object as an instance of '<em>Player</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public Object casePlayer(Player object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpretting the object as an instance of '<em>Player Stats</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 interpretting the object as an instance of '<em>Player Stats</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public Object casePlayerStats(PlayerStats object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpretting the object as an instance of '<em>Team</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 interpretting the object as an instance of '<em>Team</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public Object caseTeam(Team object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpretting 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 interpretting the object as an instance of '<em>EObject</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) |
| * @generated |
| */ |
| public Object defaultCase(EObject object) { |
| return null; |
| } |
| |
| } //HockeyleagueSwitch |