/**
* <copyright>
* </copyright>
*
* $Id$
*/
package activityDiagram.util;
import activityDiagram.*;
import java.util.List;
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 activityDiagram.ActivityDiagramPackage
* @generated
*/
public class ActivityDiagramSwitch<T> {
/**
* The cached model package
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected static ActivityDiagramPackage modelPackage;
/**
* Creates an instance of the switch.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ActivityDiagramSwitch() {
if (modelPackage == null) {
modelPackage = ActivityDiagramPackage.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 ActivityDiagramPackage.ACTIVITY_DIAGRAM_CONTAINER: {
activityDiagramContainer activityDiagramContainer = (activityDiagramContainer)theEObject;
T result = caseactivityDiagramContainer(activityDiagramContainer);
if (result == null) result = defaultCase(theEObject);
return result;
}
case ActivityDiagramPackage.ELEMENT: {
Element element = (Element)theEObject;
T result = caseElement(element);
if (result == null) result = defaultCase(theEObject);
return result;
}
case ActivityDiagramPackage.ACTIVITY: {
Activity activity = (Activity)theEObject;
T result = caseActivity(activity);
if (result == null) result = caseElement(activity);
if (result == null) result = defaultCase(theEObject);
return result;
}
case ActivityDiagramPackage.ACTION: {
Action action = (Action)theEObject;
T result = caseAction(action);
if (result == null) result = caseElement(action);
if (result == null) result = defaultCase(theEObject);
return result;
}
case ActivityDiagramPackage.CONTROL_FLOW: {
ControlFlow controlFlow = (ControlFlow)theEObject;
T result = caseControlFlow(controlFlow);
if (result == null) result = caseElement(controlFlow);
if (result == null) result = defaultCase(theEObject);
return result;
}
case ActivityDiagramPackage.SEND_SIGNAL: {
SendSignal sendSignal = (SendSignal)theEObject;
T result = caseSendSignal(sendSignal);
if (result == null) result = caseElement(sendSignal);
if (result == null) result = defaultCase(theEObject);
return result;
}
case ActivityDiagramPackage.RECEIVE_SIGNAL: {
ReceiveSignal receiveSignal = (ReceiveSignal)theEObject;
T result = caseReceiveSignal(receiveSignal);
if (result == null) result = caseElement(receiveSignal);
if (result == null) result = defaultCase(theEObject);
return result;
}
case ActivityDiagramPackage.FORK_NODE: {
ForkNode forkNode = (ForkNode)theEObject;
T result = caseForkNode(forkNode);
if (result == null) result = caseNode(forkNode);
if (result == null) result = caseElement(forkNode);
if (result == null) result = defaultCase(theEObject);
return result;
}
case ActivityDiagramPackage.MERGE_NODE: {
MergeNode mergeNode = (MergeNode)theEObject;
T result = caseMergeNode(mergeNode);
if (result == null) result = caseNode(mergeNode);
if (result == null) result = caseElement(mergeNode);
if (result == null) result = defaultCase(theEObject);
return result;
}
case ActivityDiagramPackage.NODE: {
Node node = (Node)theEObject;
T result = caseNode(node);
if (result == null) result = caseElement(node);
if (result == null) result = defaultCase(theEObject);
return result;
}
case ActivityDiagramPackage.DECISION_NODE: {
DecisionNode decisionNode = (DecisionNode)theEObject;
T result = caseDecisionNode(decisionNode);
if (result == null) result = caseNode(decisionNode);
if (result == null) result = caseElement(decisionNode);
if (result == null) result = defaultCase(theEObject);
return result;
}
case ActivityDiagramPackage.JOIN_NODE: {
JoinNode joinNode = (JoinNode)theEObject;
T result = caseJoinNode(joinNode);
if (result == null) result = caseNode(joinNode);
if (result == null) result = caseElement(joinNode);
if (result == null) result = defaultCase(theEObject);
return result;
}
case ActivityDiagramPackage.START_NODE: {
StartNode startNode = (StartNode)theEObject;
T result = caseStartNode(startNode);
if (result == null) result = caseNode(startNode);
if (result == null) result = caseElement(startNode);
if (result == null) result = defaultCase(theEObject);
return result;
}
case ActivityDiagramPackage.END_NODE_FLOW: {
EndNodeFlow endNodeFlow = (EndNodeFlow)theEObject;
T result = caseEndNodeFlow(endNodeFlow);
if (result == null) result = caseEndNode(endNodeFlow);
if (result == null) result = caseNode(endNodeFlow);
if (result == null) result = caseElement(endNodeFlow);
if (result == null) result = defaultCase(theEObject);
return result;
}
case ActivityDiagramPackage.END_NODE_ACTIVITY: {
EndNodeActivity endNodeActivity = (EndNodeActivity)theEObject;
T result = caseEndNodeActivity(endNodeActivity);
if (result == null) result = caseEndNode(endNodeActivity);
if (result == null) result = caseNode(endNodeActivity);
if (result == null) result = caseElement(endNodeActivity);
if (result == null) result = defaultCase(theEObject);
return result;
}
case ActivityDiagramPackage.END_NODE: {
EndNode endNode = (EndNode)theEObject;
T result = caseEndNode(endNode);
if (result == null) result = caseNode(endNode);
if (result == null) result = caseElement(endNode);
if (result == null) result = defaultCase(theEObject);
return result;
}
default: return defaultCase(theEObject);
}
}
/**
* Returns the result of interpreting the object as an instance of '<em>activity Diagram Container</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>activity Diagram Container</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseactivityDiagramContainer(activityDiagramContainer 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 caseElement(Element object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Activity</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>Activity</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseActivity(Activity object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Action</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>Action</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseAction(Action object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Control Flow</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>Control Flow</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseControlFlow(ControlFlow object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Send Signal</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>Send Signal</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseSendSignal(SendSignal object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Receive Signal</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>Receive Signal</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseReceiveSignal(ReceiveSignal object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Fork 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>Fork Node</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseForkNode(ForkNode object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Merge 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>Merge Node</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseMergeNode(MergeNode object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>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>Node</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseNode(Node object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Decision 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>Decision Node</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseDecisionNode(DecisionNode object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Join 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>Join Node</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseJoinNode(JoinNode object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Start 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>Start Node</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseStartNode(StartNode object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>End Node Flow</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>End Node Flow</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseEndNodeFlow(EndNodeFlow object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>End Node Activity</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>End Node Activity</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseEndNodeActivity(EndNodeActivity object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>End 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>End Node</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseEndNode(EndNode 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;
}
} //ActivityDiagramSwitch