/**
* <copyright>
* </copyright>
*
*/
package urban.urban.util;
import java.util.List;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import urban.urban.Agent;
import urban.urban.Assignment;
import urban.urban.Atom;
import urban.urban.CommentLine;
import urban.urban.Concentration;
import urban.urban.Expression;
import urban.urban.Generator;
import urban.urban.Imports;
import urban.urban.Initialise;
import urban.urban.Lambda;
import urban.urban.Line;
import urban.urban.Link;
import urban.urban.Model;
import urban.urban.Modification;
import urban.urban.Mrk;
import urban.urban.Observe;
import urban.urban.Op;
import urban.urban.Rule;
import urban.urban.RuleRhs;
import urban.urban.Shape;
import urban.urban.Site;
import urban.urban.Story;
import urban.urban.UrbanPackage;
import urban.urban.ValueCalc;
/**
* <!-- 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 urban.urban.UrbanPackage
* @generated
*/
public class UrbanSwitch<T>
{
/**
* The cached model package
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected static UrbanPackage modelPackage;
/**
* Creates an instance of the switch.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public UrbanSwitch()
{
if (modelPackage == null)
{
modelPackage = UrbanPackage.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 UrbanPackage.MODEL:
{
Model model = (Model)theEObject;
T result = caseModel(model);
if (result == null) result = defaultCase(theEObject);
return result;
}
case UrbanPackage.LINE:
{
Line line = (Line)theEObject;
T result = caseLine(line);
if (result == null) result = defaultCase(theEObject);
return result;
}
case UrbanPackage.IMPORTS:
{
Imports imports = (Imports)theEObject;
T result = caseImports(imports);
if (result == null) result = defaultCase(theEObject);
return result;
}
case UrbanPackage.LAMBDA:
{
Lambda lambda = (Lambda)theEObject;
T result = caseLambda(lambda);
if (result == null) result = defaultCase(theEObject);
return result;
}
case UrbanPackage.SHAPE:
{
Shape shape = (Shape)theEObject;
T result = caseShape(shape);
if (result == null) result = defaultCase(theEObject);
return result;
}
case UrbanPackage.GENERATOR:
{
Generator generator = (Generator)theEObject;
T result = caseGenerator(generator);
if (result == null) result = defaultCase(theEObject);
return result;
}
case UrbanPackage.COMMENT_LINE:
{
CommentLine commentLine = (CommentLine)theEObject;
T result = caseCommentLine(commentLine);
if (result == null) result = defaultCase(theEObject);
return result;
}
case UrbanPackage.INITIALISE:
{
Initialise initialise = (Initialise)theEObject;
T result = caseInitialise(initialise);
if (result == null) result = defaultCase(theEObject);
return result;
}
case UrbanPackage.RULE:
{
Rule rule = (Rule)theEObject;
T result = caseRule(rule);
if (result == null) result = defaultCase(theEObject);
return result;
}
case UrbanPackage.RULE_RHS:
{
RuleRhs ruleRhs = (RuleRhs)theEObject;
T result = caseRuleRhs(ruleRhs);
if (result == null) result = defaultCase(theEObject);
return result;
}
case UrbanPackage.EXPRESSION:
{
Expression expression = (Expression)theEObject;
T result = caseExpression(expression);
if (result == null) result = defaultCase(theEObject);
return result;
}
case UrbanPackage.AGENT:
{
Agent agent = (Agent)theEObject;
T result = caseAgent(agent);
if (result == null) result = defaultCase(theEObject);
return result;
}
case UrbanPackage.SITE:
{
Site site = (Site)theEObject;
T result = caseSite(site);
if (result == null) result = defaultCase(theEObject);
return result;
}
case UrbanPackage.MRK:
{
Mrk mrk = (Mrk)theEObject;
T result = caseMrk(mrk);
if (result == null) result = defaultCase(theEObject);
return result;
}
case UrbanPackage.LINK:
{
Link link = (Link)theEObject;
T result = caseLink(link);
if (result == null) result = defaultCase(theEObject);
return result;
}
case UrbanPackage.OBSERVE:
{
Observe observe = (Observe)theEObject;
T result = caseObserve(observe);
if (result == null) result = defaultCase(theEObject);
return result;
}
case UrbanPackage.STORY:
{
Story story = (Story)theEObject;
T result = caseStory(story);
if (result == null) result = defaultCase(theEObject);
return result;
}
case UrbanPackage.MODIFICATION:
{
Modification modification = (Modification)theEObject;
T result = caseModification(modification);
if (result == null) result = defaultCase(theEObject);
return result;
}
case UrbanPackage.CONCENTRATION:
{
Concentration concentration = (Concentration)theEObject;
T result = caseConcentration(concentration);
if (result == null) result = defaultCase(theEObject);
return result;
}
case UrbanPackage.ASSIGNMENT:
{
Assignment assignment = (Assignment)theEObject;
T result = caseAssignment(assignment);
if (result == null) result = defaultCase(theEObject);
return result;
}
case UrbanPackage.VALUE_CALC:
{
ValueCalc valueCalc = (ValueCalc)theEObject;
T result = caseValueCalc(valueCalc);
if (result == null) result = defaultCase(theEObject);
return result;
}
case UrbanPackage.ATOM:
{
Atom atom = (Atom)theEObject;
T result = caseAtom(atom);
if (result == null) result = caseValueCalc(atom);
if (result == null) result = defaultCase(theEObject);
return result;
}
case UrbanPackage.NUMBER:
{
urban.urban.Number number = (urban.urban.Number)theEObject;
T result = caseNumber(number);
if (result == null) result = defaultCase(theEObject);
return result;
}
case UrbanPackage.OP:
{
Op op = (Op)theEObject;
T result = caseOp(op);
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>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>Line</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseLine(Line object)
{
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Imports</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>Imports</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseImports(Imports object)
{
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Lambda</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>Lambda</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseLambda(Lambda object)
{
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Shape</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>Shape</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseShape(Shape object)
{
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Generator</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>Generator</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseGenerator(Generator object)
{
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Comment 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>Comment Line</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseCommentLine(CommentLine object)
{
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Initialise</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>Initialise</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseInitialise(Initialise object)
{
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Rule</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>Rule</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseRule(Rule object)
{
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Rule Rhs</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>Rule Rhs</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseRuleRhs(RuleRhs object)
{
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Expression</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>Expression</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseExpression(Expression object)
{
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Agent</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>Agent</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseAgent(Agent object)
{
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Site</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>Site</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseSite(Site object)
{
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Mrk</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>Mrk</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseMrk(Mrk 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>Observe</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>Observe</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseObserve(Observe object)
{
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Story</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>Story</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseStory(Story object)
{
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Modification</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>Modification</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseModification(Modification object)
{
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Concentration</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>Concentration</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseConcentration(Concentration object)
{
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Assignment</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>Assignment</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseAssignment(Assignment object)
{
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Value Calc</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>Value Calc</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseValueCalc(ValueCalc object)
{
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Atom</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>Atom</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseAtom(Atom object)
{
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Number</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>Number</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseNumber(urban.urban.Number object)
{
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Op</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>Op</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseOp(Op 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;
}
} //UrbanSwitch