/**
*/
package com.perforce.example.p4dsl.p4Dsl.util;
import com.perforce.example.p4dsl.p4Dsl.*;
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 com.perforce.example.p4dsl.p4Dsl.P4DslPackage
* @generated
*/
public class P4DslSwitch<T> extends Switch<T>
{
/**
* The cached model package
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected static P4DslPackage modelPackage;
/**
* Creates an instance of the switch.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public P4DslSwitch()
{
if (modelPackage == null)
{
modelPackage = P4DslPackage.eINSTANCE;
}
}
/**
* Checks whether this is a switch for the given package.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @parameter 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 P4DslPackage.MODEL:
{
Model model = (Model)theEObject;
T result = caseModel(model);
if (result == null) result = defaultCase(theEObject);
return result;
}
case P4DslPackage.COMMAND:
{
Command command = (Command)theEObject;
T result = caseCommand(command);
if (result == null) result = defaultCase(theEObject);
return result;
}
case P4DslPackage.P4_COMMAND:
{
P4Command p4Command = (P4Command)theEObject;
T result = caseP4Command(p4Command);
if (result == null) result = caseCommand(p4Command);
if (result == null) result = defaultCase(theEObject);
return result;
}
case P4DslPackage.PUC_FLAG:
{
PUCFlag pucFlag = (PUCFlag)theEObject;
T result = casePUCFlag(pucFlag);
if (result == null) result = caseP4Command(pucFlag);
if (result == null) result = caseCommand(pucFlag);
if (result == null) result = defaultCase(theEObject);
return result;
}
case P4DslPackage.PORT:
{
Port port = (Port)theEObject;
T result = casePort(port);
if (result == null) result = casePUCFlag(port);
if (result == null) result = caseP4Command(port);
if (result == null) result = caseCommand(port);
if (result == null) result = defaultCase(theEObject);
return result;
}
case P4DslPackage.USER:
{
User user = (User)theEObject;
T result = caseUser(user);
if (result == null) result = casePUCFlag(user);
if (result == null) result = caseP4Command(user);
if (result == null) result = caseCommand(user);
if (result == null) result = defaultCase(theEObject);
return result;
}
case P4DslPackage.CLIENT:
{
Client client = (Client)theEObject;
T result = caseClient(client);
if (result == null) result = casePUCFlag(client);
if (result == null) result = caseP4Command(client);
if (result == null) result = caseCommand(client);
if (result == null) result = defaultCase(theEObject);
return result;
}
case P4DslPackage.FILE_BASED_COMMAND:
{
FileBasedCommand fileBasedCommand = (FileBasedCommand)theEObject;
T result = caseFileBasedCommand(fileBasedCommand);
if (result == null) result = caseP4Command(fileBasedCommand);
if (result == null) result = caseCommand(fileBasedCommand);
if (result == null) result = defaultCase(theEObject);
return result;
}
case P4DslPackage.ADD:
{
Add add = (Add)theEObject;
T result = caseAdd(add);
if (result == null) result = caseFileBasedCommand(add);
if (result == null) result = caseP4Command(add);
if (result == null) result = caseCommand(add);
if (result == null) result = defaultCase(theEObject);
return result;
}
case P4DslPackage.EDIT:
{
Edit edit = (Edit)theEObject;
T result = caseEdit(edit);
if (result == null) result = caseFileBasedCommand(edit);
if (result == null) result = caseP4Command(edit);
if (result == null) result = caseCommand(edit);
if (result == null) result = defaultCase(theEObject);
return result;
}
case P4DslPackage.DELETE:
{
Delete delete = (Delete)theEObject;
T result = caseDelete(delete);
if (result == null) result = caseFileBasedCommand(delete);
if (result == null) result = caseP4Command(delete);
if (result == null) result = caseCommand(delete);
if (result == null) result = defaultCase(theEObject);
return result;
}
default: return defaultCase(theEObject);
}
}
/**
* Returns the result of interpreting the object as an instance of '<em>Model</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</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseModel(Model object)
{
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Command</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>Command</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseCommand(Command object)
{
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>P4 Command</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>P4 Command</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseP4Command(P4Command object)
{
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>PUC Flag</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>PUC Flag</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T casePUCFlag(PUCFlag 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>User</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>User</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseUser(User object)
{
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Client</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>Client</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseClient(Client object)
{
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>File Based Command</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>File Based Command</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseFileBasedCommand(FileBasedCommand object)
{
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Add</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>Add</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseAdd(Add object)
{
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Edit</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>Edit</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseEdit(Edit object)
{
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Delete</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>Delete</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseDelete(Delete 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;
}
} //P4DslSwitch