/**
* 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.icse15_sequencediagram_mavo.util;
import edu.toronto.cs.se.mavo.LogicElement;
import edu.toronto.cs.se.mavo.MAVOElement;
import edu.toronto.cs.se.mavo.MAVORoot;
import edu.toronto.cs.se.mavo.MAVOReference;
import edu.toronto.cs.se.modelepedia.icse15_sequencediagram_mavo.ClassReference;
import edu.toronto.cs.se.modelepedia.icse15_sequencediagram_mavo.ICSE15_SequenceDiagram_MAVOPackage;
import edu.toronto.cs.se.modelepedia.icse15_sequencediagram_mavo.Lifeline;
import edu.toronto.cs.se.modelepedia.icse15_sequencediagram_mavo.Message;
import edu.toronto.cs.se.modelepedia.icse15_sequencediagram_mavo.NamedElement;
import edu.toronto.cs.se.modelepedia.icse15_sequencediagram_mavo.Operation;
import edu.toronto.cs.se.modelepedia.icse15_sequencediagram_mavo.OperationReference;
import edu.toronto.cs.se.modelepedia.icse15_sequencediagram_mavo.SequenceDiagram;
import edu.toronto.cs.se.modelepedia.icse15_sequencediagram_mavo.SourceLifelineReference;
import edu.toronto.cs.se.modelepedia.icse15_sequencediagram_mavo.TargetLifelineReference;
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.icse15_sequencediagram_mavo.ICSE15_SequenceDiagram_MAVOPackage
* @generated
*/
public class ICSE15_SequenceDiagram_MAVOSwitch<T> extends Switch<T> {
/**
* The cached model package
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected static ICSE15_SequenceDiagram_MAVOPackage modelPackage;
/**
* Creates an instance of the switch.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ICSE15_SequenceDiagram_MAVOSwitch() {
if (modelPackage == null) {
modelPackage = ICSE15_SequenceDiagram_MAVOPackage.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 ICSE15_SequenceDiagram_MAVOPackage.SEQUENCE_DIAGRAM: {
SequenceDiagram sequenceDiagram = (SequenceDiagram)theEObject;
T result = caseSequenceDiagram(sequenceDiagram);
if (result == null) result = caseMAVORoot(sequenceDiagram);
if (result == null) result = defaultCase(theEObject);
return result;
}
case ICSE15_SequenceDiagram_MAVOPackage.NAMED_ELEMENT: {
NamedElement namedElement = (NamedElement)theEObject;
T result = caseNamedElement(namedElement);
if (result == null) result = caseMAVOElement(namedElement);
if (result == null) result = caseLogicElement(namedElement);
if (result == null) result = defaultCase(theEObject);
return result;
}
case ICSE15_SequenceDiagram_MAVOPackage.LIFELINE: {
Lifeline lifeline = (Lifeline)theEObject;
T result = caseLifeline(lifeline);
if (result == null) result = caseNamedElement(lifeline);
if (result == null) result = caseMAVOElement(lifeline);
if (result == null) result = caseLogicElement(lifeline);
if (result == null) result = defaultCase(theEObject);
return result;
}
case ICSE15_SequenceDiagram_MAVOPackage.CLASS: {
edu.toronto.cs.se.modelepedia.icse15_sequencediagram_mavo.Class class_ = (edu.toronto.cs.se.modelepedia.icse15_sequencediagram_mavo.Class)theEObject;
T result = caseClass(class_);
if (result == null) result = caseNamedElement(class_);
if (result == null) result = caseMAVOElement(class_);
if (result == null) result = caseLogicElement(class_);
if (result == null) result = defaultCase(theEObject);
return result;
}
case ICSE15_SequenceDiagram_MAVOPackage.OPERATION: {
Operation operation = (Operation)theEObject;
T result = caseOperation(operation);
if (result == null) result = caseNamedElement(operation);
if (result == null) result = caseMAVOElement(operation);
if (result == null) result = caseLogicElement(operation);
if (result == null) result = defaultCase(theEObject);
return result;
}
case ICSE15_SequenceDiagram_MAVOPackage.MESSAGE: {
Message message = (Message)theEObject;
T result = caseMessage(message);
if (result == null) result = caseNamedElement(message);
if (result == null) result = caseMAVOElement(message);
if (result == null) result = caseLogicElement(message);
if (result == null) result = defaultCase(theEObject);
return result;
}
case ICSE15_SequenceDiagram_MAVOPackage.CLASS_REFERENCE: {
ClassReference classReference = (ClassReference)theEObject;
T result = caseClassReference(classReference);
if (result == null) result = caseMAVOReference(classReference);
if (result == null) result = caseMAVOElement(classReference);
if (result == null) result = caseLogicElement(classReference);
if (result == null) result = defaultCase(theEObject);
return result;
}
case ICSE15_SequenceDiagram_MAVOPackage.OPERATION_REFERENCE: {
OperationReference operationReference = (OperationReference)theEObject;
T result = caseOperationReference(operationReference);
if (result == null) result = caseMAVOReference(operationReference);
if (result == null) result = caseMAVOElement(operationReference);
if (result == null) result = caseLogicElement(operationReference);
if (result == null) result = defaultCase(theEObject);
return result;
}
case ICSE15_SequenceDiagram_MAVOPackage.SOURCE_LIFELINE_REFERENCE: {
SourceLifelineReference sourceLifelineReference = (SourceLifelineReference)theEObject;
T result = caseSourceLifelineReference(sourceLifelineReference);
if (result == null) result = caseMAVOReference(sourceLifelineReference);
if (result == null) result = caseMAVOElement(sourceLifelineReference);
if (result == null) result = caseLogicElement(sourceLifelineReference);
if (result == null) result = defaultCase(theEObject);
return result;
}
case ICSE15_SequenceDiagram_MAVOPackage.TARGET_LIFELINE_REFERENCE: {
TargetLifelineReference targetLifelineReference = (TargetLifelineReference)theEObject;
T result = caseTargetLifelineReference(targetLifelineReference);
if (result == null) result = caseMAVOReference(targetLifelineReference);
if (result == null) result = caseMAVOElement(targetLifelineReference);
if (result == null) result = caseLogicElement(targetLifelineReference);
if (result == null) result = defaultCase(theEObject);
return result;
}
default: return defaultCase(theEObject);
}
}
/**
* Returns the result of interpreting the object as an instance of '<em>Sequence Diagram</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>Sequence Diagram</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseSequenceDiagram(SequenceDiagram 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>Lifeline</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>Lifeline</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseLifeline(Lifeline object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Class</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>Class</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseClass(edu.toronto.cs.se.modelepedia.icse15_sequencediagram_mavo.Class object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Operation</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>Operation</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseOperation(Operation object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Message</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>Message</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseMessage(Message object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Class Reference</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>Class Reference</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseClassReference(ClassReference object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Operation Reference</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>Operation Reference</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseOperationReference(OperationReference object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Source Lifeline Reference</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>Source Lifeline Reference</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseSourceLifelineReference(SourceLifelineReference object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Target Lifeline Reference</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>Target Lifeline Reference</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseTargetLifelineReference(TargetLifelineReference object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Root</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>Root</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseMAVORoot(MAVORoot object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Logic 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>Logic Element</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseLogicElement(LogicElement object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>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>Element</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseMAVOElement(MAVOElement object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Reference</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>Reference</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseMAVOReference(MAVOReference 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;
}
} //ICSE15_SequenceDiagram_MAVOSwitch