blob: 937e9740e28afd68f902b4fb02598d4d1dd468a4 [file] [log] [blame]
/*******************************************************************************
* CHESS core plugin
*
* Copyright (C) 2011-2015
* Mälardalen University, Sweden
*
*
* 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-v20.html
*******************************************************************************/
package org.polarsys.chess.fla.flamm.util;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.util.Switch;
import org.polarsys.chess.fla.flamm.*;
/**
* <!-- 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.polarsys.chess.fla.flamm.FlammPackage
* @generated
*/
public class FlammSwitch<T> extends Switch<T> {
/**
* The cached model package
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected static FlammPackage modelPackage;
/**
* Creates an instance of the switch.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public FlammSwitch() {
if (modelPackage == null) {
modelPackage = FlammPackage.eINSTANCE;
}
}
/**
* Checks whether this is a switch for the given package.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param 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 FlammPackage.NAMED_ELEMENT: {
NamedElement namedElement = (NamedElement)theEObject;
T result = caseNamedElement(namedElement);
if (result == null) result = defaultCase(theEObject);
return result;
}
case FlammPackage.FLA_BEHAVIOUR: {
FlaBehaviour flaBehaviour = (FlaBehaviour)theEObject;
T result = caseFlaBehaviour(flaBehaviour);
if (result == null) result = defaultCase(theEObject);
return result;
}
case FlammPackage.COMPONENT: {
Component component = (Component)theEObject;
T result = caseComponent(component);
if (result == null) result = caseNamedElement(component);
if (result == null) result = caseFlaBehaviour(component);
if (result == null) result = defaultCase(theEObject);
return result;
}
case FlammPackage.COMPOSITE_COMPONENT: {
CompositeComponent compositeComponent = (CompositeComponent)theEObject;
T result = caseCompositeComponent(compositeComponent);
if (result == null) result = caseComponent(compositeComponent);
if (result == null) result = caseNamedElement(compositeComponent);
if (result == null) result = caseFlaBehaviour(compositeComponent);
if (result == null) result = defaultCase(theEObject);
return result;
}
case FlammPackage.SIMPLE_COMPONENT: {
SimpleComponent simpleComponent = (SimpleComponent)theEObject;
T result = caseSimpleComponent(simpleComponent);
if (result == null) result = caseComponent(simpleComponent);
if (result == null) result = caseNamedElement(simpleComponent);
if (result == null) result = caseFlaBehaviour(simpleComponent);
if (result == null) result = defaultCase(theEObject);
return result;
}
case FlammPackage.PORT: {
Port port = (Port)theEObject;
T result = casePort(port);
if (result == null) result = caseNamedElement(port);
if (result == null) result = defaultCase(theEObject);
return result;
}
case FlammPackage.CONNECTION: {
Connection connection = (Connection)theEObject;
T result = caseConnection(connection);
if (result == null) result = caseFlaBehaviour(connection);
if (result == null) result = defaultCase(theEObject);
return result;
}
case FlammPackage.RULE: {
Rule rule = (Rule)theEObject;
T result = caseRule(rule);
if (result == null) result = defaultCase(theEObject);
return result;
}
case FlammPackage.EXPRESSION: {
Expression expression = (Expression)theEObject;
T result = caseExpression(expression);
if (result == null) result = defaultCase(theEObject);
return result;
}
case FlammPackage.FAILURE: {
Failure failure = (Failure)theEObject;
T result = caseFailure(failure);
if (result == null) result = defaultCase(theEObject);
return result;
}
case FlammPackage.ACI_DAVOIDABLE: {
ACIDavoidable aciDavoidable = (ACIDavoidable)theEObject;
T result = caseACIDavoidable(aciDavoidable);
if (result == null) result = defaultCase(theEObject);
return result;
}
case FlammPackage.ACI_DMITIGATION: {
ACIDmitigation aciDmitigation = (ACIDmitigation)theEObject;
T result = caseACIDmitigation(aciDmitigation);
if (result == null) result = defaultCase(theEObject);
return result;
}
default: return defaultCase(theEObject);
}
}
/**
* 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>Fla Behaviour</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>Fla Behaviour</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseFlaBehaviour(FlaBehaviour object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Component</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>Component</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseComponent(Component object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Composite Component</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>Composite Component</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseCompositeComponent(CompositeComponent object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Simple Component</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>Simple Component</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseSimpleComponent(SimpleComponent object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Port</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>Port</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T casePort(Port object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Connection</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>Connection</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseConnection(Connection object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Rule</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>Rule</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseRule(Rule object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Expression</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>Expression</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseExpression(Expression object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Failure</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>Failure</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseFailure(Failure object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>ACI Davoidable</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>ACI Davoidable</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseACIDavoidable(ACIDavoidable object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>ACI Dmitigation</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>ACI Dmitigation</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseACIDmitigation(ACIDmitigation 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;
}
} //FlammSwitch