/**
* <copyright>
* </copyright>
*
* $Id$
*/
package com.sap.furcas.oclinversion.util;
import com.sap.furcas.oclinversion.*;
import java.util.List;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EModelElement;
import org.eclipse.emf.ecore.ENamedElement;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.ETypedElement;
import org.eclipse.ocl.expressions.BooleanLiteralExp;
import org.eclipse.ocl.expressions.EnumLiteralExp;
import org.eclipse.ocl.expressions.IntegerLiteralExp;
import org.eclipse.ocl.expressions.LiteralExp;
import org.eclipse.ocl.expressions.NumericLiteralExp;
import org.eclipse.ocl.expressions.OCLExpression;
import org.eclipse.ocl.expressions.PrimitiveLiteralExp;
import org.eclipse.ocl.expressions.RealLiteralExp;
import org.eclipse.ocl.expressions.StringLiteralExp;
import org.eclipse.ocl.utilities.ASTNode;
import org.eclipse.ocl.utilities.TypedElement;
import org.eclipse.ocl.utilities.Visitable;
/**
* <!-- 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.sap.furcas.oclinversion.OclinversionPackage
* @generated
*/
public class OclinversionSwitch<T> {
/**
* The cached model package
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected static OclinversionPackage modelPackage;
/**
* Creates an instance of the switch.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public OclinversionSwitch() {
if (modelPackage == null) {
modelPackage = OclinversionPackage.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 T 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 T doSwitch(EClass theEClass, EObject theEObject) {
if (theEClass.eContainer() == modelPackage) {
return doSwitch(theEClass.getClassifierID(), theEObject);
}
else {
List<EClass> eSuperTypes = theEClass.getESuperTypes();
return
eSuperTypes.isEmpty() ?
defaultCase(theEObject) :
doSwitch(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 T doSwitch(int classifierID, EObject theEObject) {
switch (classifierID) {
case OclinversionPackage.QMARK_LITERAL_EXP: {
QMarkLiteralExp qMarkLiteralExp = (QMarkLiteralExp)theEObject;
T result = caseQMarkLiteralExp(qMarkLiteralExp);
if (result == null) result = caseEcore_BooleanLiteralExp(qMarkLiteralExp);
if (result == null) result = caseEcore_EnumLiteralExp(qMarkLiteralExp);
if (result == null) result = caseEcore_IntegerLiteralExp(qMarkLiteralExp);
if (result == null) result = caseEcore_RealLiteralExp(qMarkLiteralExp);
if (result == null) result = caseEcore_StringLiteralExp(qMarkLiteralExp);
if (result == null) result = caseBooleanLiteralExp(qMarkLiteralExp);
if (result == null) result = caseEnumLiteralExp(qMarkLiteralExp);
if (result == null) result = caseEcore_NumericLiteralExp(qMarkLiteralExp);
if (result == null) result = caseIntegerLiteralExp(qMarkLiteralExp);
if (result == null) result = caseRealLiteralExp(qMarkLiteralExp);
if (result == null) result = caseStringLiteralExp(qMarkLiteralExp);
if (result == null) result = caseEcore_PrimitiveLiteralExp(qMarkLiteralExp);
if (result == null) result = caseEcore_LiteralExp(qMarkLiteralExp);
if (result == null) result = caseNumericLiteralExp(qMarkLiteralExp);
if (result == null) result = caseEcore_OCLExpression(qMarkLiteralExp);
if (result == null) result = caseLiteralExp(qMarkLiteralExp);
if (result == null) result = casePrimitiveLiteralExp(qMarkLiteralExp);
if (result == null) result = caseETypedElement(qMarkLiteralExp);
if (result == null) result = caseOCLExpression(qMarkLiteralExp);
if (result == null) result = caseENamedElement(qMarkLiteralExp);
if (result == null) result = caseTypedElement(qMarkLiteralExp);
if (result == null) result = caseVisitable(qMarkLiteralExp);
if (result == null) result = caseASTNode(qMarkLiteralExp);
if (result == null) result = caseEModelElement(qMarkLiteralExp);
if (result == null) result = defaultCase(theEObject);
return result;
}
default: return defaultCase(theEObject);
}
}
/**
* Returns the result of interpreting the object as an instance of '<em>QMark Literal Exp</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>QMark Literal Exp</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseQMarkLiteralExp(QMarkLiteralExp object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>EModel 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>EModel Element</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseEModelElement(EModelElement object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>ENamed 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>ENamed Element</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseENamedElement(ENamedElement object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>ETyped 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>ETyped Element</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseETypedElement(ETypedElement object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Typed 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>Typed Element</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public <C> T caseTypedElement(TypedElement<C> object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Visitable</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>Visitable</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseVisitable(Visitable object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>AST Node</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 Node</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseASTNode(ASTNode object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>OCL 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>OCL Expression</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public <C> T caseOCLExpression(OCLExpression<C> object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>OCL 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>OCL Expression</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseEcore_OCLExpression(org.eclipse.ocl.ecore.OCLExpression object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Literal Exp</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>Literal Exp</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public <C> T caseLiteralExp(LiteralExp<C> object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Literal Exp</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>Literal Exp</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseEcore_LiteralExp(org.eclipse.ocl.ecore.LiteralExp object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Primitive Literal Exp</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>Primitive Literal Exp</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public <C> T casePrimitiveLiteralExp(PrimitiveLiteralExp<C> object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Primitive Literal Exp</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>Primitive Literal Exp</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseEcore_PrimitiveLiteralExp(org.eclipse.ocl.ecore.PrimitiveLiteralExp object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Boolean Literal Exp</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>Boolean Literal Exp</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public <C> T caseBooleanLiteralExp(BooleanLiteralExp<C> object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Boolean Literal Exp</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>Boolean Literal Exp</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseEcore_BooleanLiteralExp(org.eclipse.ocl.ecore.BooleanLiteralExp object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Enum Literal Exp</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>Enum Literal Exp</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public <C, EL> T caseEnumLiteralExp(EnumLiteralExp<C, EL> object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Enum Literal Exp</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>Enum Literal Exp</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseEcore_EnumLiteralExp(org.eclipse.ocl.ecore.EnumLiteralExp object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Numeric Literal Exp</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>Numeric Literal Exp</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public <C> T caseNumericLiteralExp(NumericLiteralExp<C> object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Numeric Literal Exp</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>Numeric Literal Exp</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseEcore_NumericLiteralExp(org.eclipse.ocl.ecore.NumericLiteralExp object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Integer Literal Exp</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>Integer Literal Exp</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public <C> T caseIntegerLiteralExp(IntegerLiteralExp<C> object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Integer Literal Exp</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>Integer Literal Exp</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseEcore_IntegerLiteralExp(org.eclipse.ocl.ecore.IntegerLiteralExp object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Real Literal Exp</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>Real Literal Exp</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public <C> T caseRealLiteralExp(RealLiteralExp<C> object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Real Literal Exp</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>Real Literal Exp</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseEcore_RealLiteralExp(org.eclipse.ocl.ecore.RealLiteralExp object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>String Literal Exp</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>String Literal Exp</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public <C> T caseStringLiteralExp(StringLiteralExp<C> object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>String Literal Exp</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>String Literal Exp</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseEcore_StringLiteralExp(org.eclipse.ocl.ecore.StringLiteralExp 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
*/
public T defaultCase(EObject object) {
return null;
}
} //OclinversionSwitch