/**
*/
package de.sebastianbenz.task.util;
import de.sebastianbenz.task.*;
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 de.sebastianbenz.task.TaskPackage
* @generated
*/
public class TaskSwitch<T>
{
/**
* The cached model package
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected static TaskPackage modelPackage;
/**
* Creates an instance of the switch.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public TaskSwitch()
{
if (modelPackage == null)
{
modelPackage = TaskPackage.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 TaskPackage.TASK_MODEL:
{
TaskModel taskModel = (TaskModel)theEObject;
T result = caseTaskModel(taskModel);
if (result == null) result = caseContainer(taskModel);
if (result == null) result = defaultCase(theEObject);
return result;
}
case TaskPackage.CONTENT:
{
Content content = (Content)theEObject;
T result = caseContent(content);
if (result == null) result = caseContainer(content);
if (result == null) result = defaultCase(theEObject);
return result;
}
case TaskPackage.TASK:
{
Task task = (Task)theEObject;
T result = caseTask(task);
if (result == null) result = caseContent(task);
if (result == null) result = caseContainer(task);
if (result == null) result = defaultCase(theEObject);
return result;
}
case TaskPackage.NOTE:
{
Note note = (Note)theEObject;
T result = caseNote(note);
if (result == null) result = caseContent(note);
if (result == null) result = caseContainer(note);
if (result == null) result = defaultCase(theEObject);
return result;
}
case TaskPackage.PROJECT:
{
Project project = (Project)theEObject;
T result = caseProject(project);
if (result == null) result = caseContent(project);
if (result == null) result = caseContainer(project);
if (result == null) result = defaultCase(theEObject);
return result;
}
case TaskPackage.GLOBAL_TASK_MODEL:
{
GlobalTaskModel globalTaskModel = (GlobalTaskModel)theEObject;
T result = caseGlobalTaskModel(globalTaskModel);
if (result == null) result = caseContainer(globalTaskModel);
if (result == null) result = defaultCase(theEObject);
return result;
}
case TaskPackage.CONTAINER:
{
Container container = (Container)theEObject;
T result = caseContainer(container);
if (result == null) result = defaultCase(theEObject);
return result;
}
case TaskPackage.EMPTY_LINE:
{
EmptyLine emptyLine = (EmptyLine)theEObject;
T result = caseEmptyLine(emptyLine);
if (result == null) result = caseContent(emptyLine);
if (result == null) result = caseContainer(emptyLine);
if (result == null) result = defaultCase(theEObject);
return result;
}
case TaskPackage.CODE:
{
Code code = (Code)theEObject;
T result = caseCode(code);
if (result == null) result = caseContent(code);
if (result == null) result = caseContainer(code);
if (result == null) result = defaultCase(theEObject);
return result;
}
case TaskPackage.TEXT_SEGMENT:
{
TextSegment textSegment = (TextSegment)theEObject;
T result = caseTextSegment(textSegment);
if (result == null) result = defaultCase(theEObject);
return result;
}
case TaskPackage.TAG:
{
Tag tag = (Tag)theEObject;
T result = caseTag(tag);
if (result == null) result = caseTextSegment(tag);
if (result == null) result = defaultCase(theEObject);
return result;
}
case TaskPackage.LINK:
{
Link link = (Link)theEObject;
T result = caseLink(link);
if (result == null) result = caseTextSegment(link);
if (result == null) result = defaultCase(theEObject);
return result;
}
case TaskPackage.TEXT:
{
Text text = (Text)theEObject;
T result = caseText(text);
if (result == null) result = caseTextSegment(text);
if (result == null) result = defaultCase(theEObject);
return result;
}
case TaskPackage.IMAGE:
{
Image image = (Image)theEObject;
T result = caseImage(image);
if (result == null) result = caseLink(image);
if (result == null) result = caseTextSegment(image);
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 caseTaskModel(TaskModel object)
{
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Content</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>Content</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseContent(Content object)
{
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Task</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>Task</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseTask(Task object)
{
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Note</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>Note</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseNote(Note object)
{
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Project</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>Project</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseProject(Project object)
{
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Global Task 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>Global Task Model</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseGlobalTaskModel(GlobalTaskModel object)
{
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>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>Container</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseContainer(Container object)
{
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Empty Line</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>Empty Line</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseEmptyLine(EmptyLine object)
{
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Code</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>Code</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseCode(Code object)
{
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Text Segment</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>Text Segment</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseTextSegment(TextSegment object)
{
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Tag</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>Tag</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseTag(Tag object)
{
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>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>Link</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseLink(Link object)
{
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Text</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>Text</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseText(Text object)
{
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Image</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>Image</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseImage(Image 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;
}
} //TaskSwitch