/** * Copyright (c) 2010 National Aeronautics and Space Administration. All rights reserved. */ package net.certware.argument.eur.util; import java.util.List; import net.certware.argument.arm.ArgumentElement; import net.certware.argument.arm.ArgumentLink; import net.certware.argument.arm.AssertedEvidence; import net.certware.argument.arm.AssertedRelationship; import net.certware.argument.arm.Claim; import net.certware.argument.arm.InformationElement; import net.certware.argument.arm.ModelElement; import net.certware.argument.arm.ReasoningElement; import net.certware.argument.eur.Argument; import net.certware.argument.eur.Assumption; import net.certware.argument.eur.Context; import net.certware.argument.eur.Criteria; import net.certware.argument.eur.EurPackage; import net.certware.argument.eur.Justification; import net.certware.argument.eur.Solution; import net.certware.argument.eur.Strategy; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EObject; /** * <!-- 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 net.certware.argument.eur.EurPackage * @generated */ public class EurSwitch<T> { /** * The cached model package * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected static EurPackage modelPackage; /** * Creates an instance of the switch. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EurSwitch() { if (modelPackage == null) { modelPackage = EurPackage.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 EurPackage.ARGUMENT: { Argument argument = (Argument)theEObject; T result = caseArgument(argument); if (result == null) result = caseClaim(argument); if (result == null) result = caseReasoningElement(argument); if (result == null) result = caseArgumentElement(argument); if (result == null) result = caseModelElement(argument); if (result == null) result = defaultCase(theEObject); return result; } case EurPackage.STRATEGY: { Strategy strategy = (Strategy)theEObject; T result = caseStrategy(strategy); if (result == null) result = caseReasoningElement(strategy); if (result == null) result = caseArgumentElement(strategy); if (result == null) result = caseModelElement(strategy); if (result == null) result = defaultCase(theEObject); return result; } case EurPackage.SOLUTION: { Solution solution = (Solution)theEObject; T result = caseSolution(solution); if (result == null) result = caseAssertedEvidence(solution); if (result == null) result = caseAssertedRelationship(solution); if (result == null) result = caseArgumentLink(solution); if (result == null) result = caseModelElement(solution); if (result == null) result = defaultCase(theEObject); return result; } case EurPackage.ASSUMPTION: { Assumption assumption = (Assumption)theEObject; T result = caseAssumption(assumption); if (result == null) result = caseInformationElement(assumption); if (result == null) result = caseArgumentElement(assumption); if (result == null) result = caseModelElement(assumption); if (result == null) result = defaultCase(theEObject); return result; } case EurPackage.CONTEXT: { Context context = (Context)theEObject; T result = caseContext(context); if (result == null) result = caseInformationElement(context); if (result == null) result = caseArgumentElement(context); if (result == null) result = caseModelElement(context); if (result == null) result = defaultCase(theEObject); return result; } case EurPackage.JUSTIFICATION: { Justification justification = (Justification)theEObject; T result = caseJustification(justification); if (result == null) result = caseInformationElement(justification); if (result == null) result = caseArgumentElement(justification); if (result == null) result = caseModelElement(justification); if (result == null) result = defaultCase(theEObject); return result; } case EurPackage.CRITERIA: { Criteria criteria = (Criteria)theEObject; T result = caseCriteria(criteria); if (result == null) result = caseInformationElement(criteria); if (result == null) result = caseArgumentElement(criteria); if (result == null) result = caseModelElement(criteria); if (result == null) result = defaultCase(theEObject); return result; } default: return defaultCase(theEObject); } } /** * Returns the result of interpreting the object as an instance of '<em>Argument</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>Argument</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseArgument(Argument object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Strategy</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>Strategy</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseStrategy(Strategy object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Solution</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>Solution</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseSolution(Solution object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Assumption</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>Assumption</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseAssumption(Assumption object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Context</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>Context</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseContext(Context object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Justification</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>Justification</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseJustification(Justification object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Criteria</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>Criteria</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseCriteria(Criteria object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Model 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>Model Element</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseModelElement(ModelElement object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Argument 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>Argument Element</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseArgumentElement(ArgumentElement object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Reasoning 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>Reasoning Element</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseReasoningElement(ReasoningElement object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Claim</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>Claim</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseClaim(Claim object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Argument Link</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>Argument Link</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseArgumentLink(ArgumentLink object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Asserted Relationship</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>Asserted Relationship</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseAssertedRelationship(AssertedRelationship object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Asserted Evidence</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>Asserted Evidence</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseAssertedEvidence(AssertedEvidence object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Information 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>Information Element</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseInformationElement(InformationElement 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; } } //EurSwitch