/**
* Copyright (c) 2012-2016 Marsha Chechik, Alessio Di Sandro, Michalis Famelis,
* Rick Salay.
* 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:
* Alessio Di Sandro - Implementation.
*/
package edu.toronto.cs.se.modelepedia.powerwindow.util;
import edu.toronto.cs.se.modelepedia.powerwindow.*;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.util.Switch;
/**
* <!-- 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 edu.toronto.cs.se.modelepedia.powerwindow.PowerWindowPackage
* @generated
*/
public class PowerWindowSwitch<T> extends Switch<T> {
/**
* The cached model package
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected static PowerWindowPackage modelPackage;
/**
* Creates an instance of the switch.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public PowerWindowSwitch() {
if (modelPackage == null) {
modelPackage = PowerWindowPackage.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 PowerWindowPackage.WINDOW: {
Window window = (Window)theEObject;
T result = caseWindow(window);
if (result == null) result = caseNamedElement(window);
if (result == null) result = defaultCase(theEObject);
return result;
}
case PowerWindowPackage.SENSOR: {
Sensor sensor = (Sensor)theEObject;
T result = caseSensor(sensor);
if (result == null) result = defaultCase(theEObject);
return result;
}
case PowerWindowPackage.INFRARED: {
Infrared infrared = (Infrared)theEObject;
T result = caseInfrared(infrared);
if (result == null) result = caseSensor(infrared);
if (result == null) result = defaultCase(theEObject);
return result;
}
case PowerWindowPackage.FORCE_DETECTING: {
ForceDetecting forceDetecting = (ForceDetecting)theEObject;
T result = caseForceDetecting(forceDetecting);
if (result == null) result = caseSensor(forceDetecting);
if (result == null) result = defaultCase(theEObject);
return result;
}
case PowerWindowPackage.SWITCH: {
edu.toronto.cs.se.modelepedia.powerwindow.Switch switch_ = (edu.toronto.cs.se.modelepedia.powerwindow.Switch)theEObject;
T result = caseSwitch(switch_);
if (result == null) result = caseNamedElement(switch_);
if (result == null) result = defaultCase(theEObject);
return result;
}
case PowerWindowPackage.LOCK_OUT: {
LockOut lockOut = (LockOut)theEObject;
T result = caseLockOut(lockOut);
if (result == null) result = caseSwitch(lockOut);
if (result == null) result = caseNamedElement(lockOut);
if (result == null) result = defaultCase(theEObject);
return result;
}
case PowerWindowPackage.MOVEMENT: {
Movement movement = (Movement)theEObject;
T result = caseMovement(movement);
if (result == null) result = caseSwitch(movement);
if (result == null) result = caseNamedElement(movement);
if (result == null) result = defaultCase(theEObject);
return result;
}
case PowerWindowPackage.ROCKER: {
Rocker rocker = (Rocker)theEObject;
T result = caseRocker(rocker);
if (result == null) result = caseMovement(rocker);
if (result == null) result = caseSwitch(rocker);
if (result == null) result = caseNamedElement(rocker);
if (result == null) result = defaultCase(theEObject);
return result;
}
case PowerWindowPackage.PUSH_PULL: {
PushPull pushPull = (PushPull)theEObject;
T result = casePushPull(pushPull);
if (result == null) result = caseMovement(pushPull);
if (result == null) result = caseSwitch(pushPull);
if (result == null) result = caseNamedElement(pushPull);
if (result == null) result = defaultCase(theEObject);
return result;
}
case PowerWindowPackage.NAMED_ELEMENT: {
NamedElement namedElement = (NamedElement)theEObject;
T result = caseNamedElement(namedElement);
if (result == null) result = defaultCase(theEObject);
return result;
}
default: return defaultCase(theEObject);
}
}
/**
* Returns the result of interpreting the object as an instance of '<em>Window</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>Window</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseWindow(Window object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Sensor</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>Sensor</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseSensor(Sensor object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Infrared</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>Infrared</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseInfrared(Infrared object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Force Detecting</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>Force Detecting</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseForceDetecting(ForceDetecting object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Switch</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>Switch</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseSwitch(edu.toronto.cs.se.modelepedia.powerwindow.Switch object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Lock Out</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>Lock Out</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseLockOut(LockOut object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Movement</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>Movement</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseMovement(Movement object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Rocker</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>Rocker</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseRocker(Rocker object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Push Pull</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>Push Pull</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T casePushPull(PushPull object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Named 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>Named Element</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseNamedElement(NamedElement 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;
}
} //PowerWindowSwitch