org.eclipse.xtext.xbase.util
Class XbaseSwitch<T>

java.lang.Object
  extended by org.eclipse.xtext.xbase.util.XbaseSwitch<T>

public class XbaseSwitch<T>
extends java.lang.Object

The Switch for the model's inheritance hierarchy. It supports the call doSwitch(object) to invoke the caseXXX 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.

See Also:
XbasePackage
EMF generated code

Field Summary
protected static XbasePackage modelPackage
          The cached model package
 
Constructor Summary
XbaseSwitch()
          Creates an instance of the switch
 
Method Summary
 T caseJvmIdentifiableElement(JvmIdentifiableElement object)
          Returns the result of interpreting the object as an instance of 'Jvm Identifiable Element'
 T caseXAbstractFeatureCall(XAbstractFeatureCall object)
          Returns the result of interpreting the object as an instance of 'XAbstract Feature Call'
 T caseXAbstractWhileExpression(XAbstractWhileExpression object)
          Returns the result of interpreting the object as an instance of 'XAbstract While Expression'
 T caseXAssignment(XAssignment object)
          Returns the result of interpreting the object as an instance of 'XAssignment'
 T caseXBinaryOperation(XBinaryOperation object)
          Returns the result of interpreting the object as an instance of 'XBinary Operation'
 T caseXBlockExpression(XBlockExpression object)
          Returns the result of interpreting the object as an instance of 'XBlock Expression'
 T caseXBooleanLiteral(XBooleanLiteral object)
          Returns the result of interpreting the object as an instance of 'XBoolean Literal'
 T caseXCasePart(XCasePart object)
          Returns the result of interpreting the object as an instance of 'XCase Part'
 T caseXCastedExpression(XCastedExpression object)
          Returns the result of interpreting the object as an instance of 'XCasted Expression'
 T caseXCatchClause(XCatchClause object)
          Returns the result of interpreting the object as an instance of 'XCatch Clause'
 T caseXClosure(XClosure object)
          Returns the result of interpreting the object as an instance of 'XClosure'
 T caseXConstructorCall(XConstructorCall object)
          Returns the result of interpreting the object as an instance of 'XConstructor Call'
 T caseXDoWhileExpression(XDoWhileExpression object)
          Returns the result of interpreting the object as an instance of 'XDo While Expression'
 T caseXExpression(XExpression object)
          Returns the result of interpreting the object as an instance of 'XExpression'
 T caseXFeatureCall(XFeatureCall object)
          Returns the result of interpreting the object as an instance of 'XFeature Call'
 T caseXForLoopExpression(XForLoopExpression object)
          Returns the result of interpreting the object as an instance of 'XFor Loop Expression'
 T caseXIfExpression(XIfExpression object)
          Returns the result of interpreting the object as an instance of 'XIf Expression'
 T caseXInstanceOfExpression(XInstanceOfExpression object)
          Returns the result of interpreting the object as an instance of 'XInstance Of Expression'
 T caseXIntLiteral(XIntLiteral object)
          Returns the result of interpreting the object as an instance of 'XInt Literal'
 T caseXMemberFeatureCall(XMemberFeatureCall object)
          Returns the result of interpreting the object as an instance of 'XMember Feature Call'
 T caseXNullLiteral(XNullLiteral object)
          Returns the result of interpreting the object as an instance of 'XNull Literal'
 T caseXReturnExpression(XReturnExpression object)
          Returns the result of interpreting the object as an instance of 'XReturn Expression'
 T caseXStringLiteral(XStringLiteral object)
          Returns the result of interpreting the object as an instance of 'XString Literal'
 T caseXSwitchExpression(XSwitchExpression object)
          Returns the result of interpreting the object as an instance of 'XSwitch Expression'
 T caseXThrowExpression(XThrowExpression object)
          Returns the result of interpreting the object as an instance of 'XThrow Expression'
 T caseXTryCatchFinallyExpression(XTryCatchFinallyExpression object)
          Returns the result of interpreting the object as an instance of 'XTry Catch Finally Expression'
 T caseXTypeLiteral(XTypeLiteral object)
          Returns the result of interpreting the object as an instance of 'XType Literal'
 T caseXUnaryOperation(XUnaryOperation object)
          Returns the result of interpreting the object as an instance of 'XUnary Operation'
 T caseXVariableDeclaration(XVariableDeclaration object)
          Returns the result of interpreting the object as an instance of 'XVariable Declaration'
 T caseXWhileExpression(XWhileExpression object)
          Returns the result of interpreting the object as an instance of 'XWhile Expression'
 T defaultCase(org.eclipse.emf.ecore.EObject object)
          Returns the result of interpreting the object as an instance of 'EObject'
protected  T doSwitch(org.eclipse.emf.ecore.EClass theEClass, org.eclipse.emf.ecore.EObject theEObject)
          Calls caseXXX for each class of the model until one returns a non null result; it yields that result
 T doSwitch(org.eclipse.emf.ecore.EObject theEObject)
          Calls caseXXX for each class of the model until one returns a non null result; it yields that result
protected  T doSwitch(int classifierID, org.eclipse.emf.ecore.EObject theEObject)
          Calls caseXXX for each class of the model until one returns a non null result; it yields that result
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

modelPackage

protected static XbasePackage modelPackage
The cached model package

EMF generated code
Constructor Detail

XbaseSwitch

public XbaseSwitch()
Creates an instance of the switch.

EMF generated code
Method Detail

doSwitch

public T doSwitch(org.eclipse.emf.ecore.EObject theEObject)
Calls caseXXX for each class of the model until one returns a non null result; it yields that result.

Returns:
the first non-null result returned by a caseXXX call.
EMF generated code

doSwitch

protected T doSwitch(org.eclipse.emf.ecore.EClass theEClass,
                     org.eclipse.emf.ecore.EObject theEObject)
Calls caseXXX for each class of the model until one returns a non null result; it yields that result.

Returns:
the first non-null result returned by a caseXXX call.
EMF generated code

doSwitch

protected T doSwitch(int classifierID,
                     org.eclipse.emf.ecore.EObject theEObject)
Calls caseXXX for each class of the model until one returns a non null result; it yields that result.

Returns:
the first non-null result returned by a caseXXX call.
EMF generated code

caseXExpression

public T caseXExpression(XExpression object)
Returns the result of interpreting the object as an instance of 'XExpression'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'XExpression'.
See Also:
doSwitch(EObject)
EMF generated code

caseXIfExpression

public T caseXIfExpression(XIfExpression object)
Returns the result of interpreting the object as an instance of 'XIf Expression'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'XIf Expression'.
See Also:
doSwitch(EObject)
EMF generated code

caseXSwitchExpression

public T caseXSwitchExpression(XSwitchExpression object)
Returns the result of interpreting the object as an instance of 'XSwitch Expression'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'XSwitch Expression'.
See Also:
doSwitch(EObject)
EMF generated code

caseXCasePart

public T caseXCasePart(XCasePart object)
Returns the result of interpreting the object as an instance of 'XCase Part'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'XCase Part'.
See Also:
doSwitch(EObject)
EMF generated code

caseXBlockExpression

public T caseXBlockExpression(XBlockExpression object)
Returns the result of interpreting the object as an instance of 'XBlock Expression'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'XBlock Expression'.
See Also:
doSwitch(EObject)
EMF generated code

caseXVariableDeclaration

public T caseXVariableDeclaration(XVariableDeclaration object)
Returns the result of interpreting the object as an instance of 'XVariable Declaration'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'XVariable Declaration'.
See Also:
doSwitch(EObject)
EMF generated code

caseXAbstractFeatureCall

public T caseXAbstractFeatureCall(XAbstractFeatureCall object)
Returns the result of interpreting the object as an instance of 'XAbstract Feature Call'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'XAbstract Feature Call'.
See Also:
doSwitch(EObject)
EMF generated code

caseXMemberFeatureCall

public T caseXMemberFeatureCall(XMemberFeatureCall object)
Returns the result of interpreting the object as an instance of 'XMember Feature Call'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'XMember Feature Call'.
See Also:
doSwitch(EObject)
EMF generated code

caseXFeatureCall

public T caseXFeatureCall(XFeatureCall object)
Returns the result of interpreting the object as an instance of 'XFeature Call'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'XFeature Call'.
See Also:
doSwitch(EObject)
EMF generated code

caseXConstructorCall

public T caseXConstructorCall(XConstructorCall object)
Returns the result of interpreting the object as an instance of 'XConstructor Call'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'XConstructor Call'.
See Also:
doSwitch(EObject)
EMF generated code

caseXBooleanLiteral

public T caseXBooleanLiteral(XBooleanLiteral object)
Returns the result of interpreting the object as an instance of 'XBoolean Literal'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'XBoolean Literal'.
See Also:
doSwitch(EObject)
EMF generated code

caseXNullLiteral

public T caseXNullLiteral(XNullLiteral object)
Returns the result of interpreting the object as an instance of 'XNull Literal'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'XNull Literal'.
See Also:
doSwitch(EObject)
EMF generated code

caseXIntLiteral

public T caseXIntLiteral(XIntLiteral object)
Returns the result of interpreting the object as an instance of 'XInt Literal'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'XInt Literal'.
See Also:
doSwitch(EObject)
EMF generated code

caseXStringLiteral

public T caseXStringLiteral(XStringLiteral object)
Returns the result of interpreting the object as an instance of 'XString Literal'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'XString Literal'.
See Also:
doSwitch(EObject)
EMF generated code

caseXClosure

public T caseXClosure(XClosure object)
Returns the result of interpreting the object as an instance of 'XClosure'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'XClosure'.
See Also:
doSwitch(EObject)
EMF generated code

caseXCastedExpression

public T caseXCastedExpression(XCastedExpression object)
Returns the result of interpreting the object as an instance of 'XCasted Expression'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'XCasted Expression'.
See Also:
doSwitch(EObject)
EMF generated code

caseXBinaryOperation

public T caseXBinaryOperation(XBinaryOperation object)
Returns the result of interpreting the object as an instance of 'XBinary Operation'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'XBinary Operation'.
See Also:
doSwitch(EObject)
EMF generated code

caseXUnaryOperation

public T caseXUnaryOperation(XUnaryOperation object)
Returns the result of interpreting the object as an instance of 'XUnary Operation'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'XUnary Operation'.
See Also:
doSwitch(EObject)
EMF generated code

caseXForLoopExpression

public T caseXForLoopExpression(XForLoopExpression object)
Returns the result of interpreting the object as an instance of 'XFor Loop Expression'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'XFor Loop Expression'.
See Also:
doSwitch(EObject)
EMF generated code

caseXAbstractWhileExpression

public T caseXAbstractWhileExpression(XAbstractWhileExpression object)
Returns the result of interpreting the object as an instance of 'XAbstract While Expression'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'XAbstract While Expression'.
See Also:
doSwitch(EObject)
EMF generated code

caseXDoWhileExpression

public T caseXDoWhileExpression(XDoWhileExpression object)
Returns the result of interpreting the object as an instance of 'XDo While Expression'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'XDo While Expression'.
See Also:
doSwitch(EObject)
EMF generated code

caseXWhileExpression

public T caseXWhileExpression(XWhileExpression object)
Returns the result of interpreting the object as an instance of 'XWhile Expression'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'XWhile Expression'.
See Also:
doSwitch(EObject)
EMF generated code

caseXTypeLiteral

public T caseXTypeLiteral(XTypeLiteral object)
Returns the result of interpreting the object as an instance of 'XType Literal'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'XType Literal'.
See Also:
doSwitch(EObject)
EMF generated code

caseXInstanceOfExpression

public T caseXInstanceOfExpression(XInstanceOfExpression object)
Returns the result of interpreting the object as an instance of 'XInstance Of Expression'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'XInstance Of Expression'.
See Also:
doSwitch(EObject)
EMF generated code

caseXThrowExpression

public T caseXThrowExpression(XThrowExpression object)
Returns the result of interpreting the object as an instance of 'XThrow Expression'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'XThrow Expression'.
See Also:
doSwitch(EObject)
EMF generated code

caseXTryCatchFinallyExpression

public T caseXTryCatchFinallyExpression(XTryCatchFinallyExpression object)
Returns the result of interpreting the object as an instance of 'XTry Catch Finally Expression'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'XTry Catch Finally Expression'.
See Also:
doSwitch(EObject)
EMF generated code

caseXCatchClause

public T caseXCatchClause(XCatchClause object)
Returns the result of interpreting the object as an instance of 'XCatch Clause'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'XCatch Clause'.
See Also:
doSwitch(EObject)
EMF generated code

caseXAssignment

public T caseXAssignment(XAssignment object)
Returns the result of interpreting the object as an instance of 'XAssignment'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'XAssignment'.
See Also:
doSwitch(EObject)
EMF generated code

caseXReturnExpression

public T caseXReturnExpression(XReturnExpression object)
Returns the result of interpreting the object as an instance of 'XReturn Expression'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'XReturn Expression'.
See Also:
doSwitch(EObject)
EMF generated code

caseJvmIdentifiableElement

public T caseJvmIdentifiableElement(JvmIdentifiableElement object)
Returns the result of interpreting the object as an instance of 'Jvm Identifiable Element'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Jvm Identifiable Element'.
See Also:
doSwitch(EObject)
EMF generated code

defaultCase

public T defaultCase(org.eclipse.emf.ecore.EObject object)
Returns the result of interpreting the object as an instance of 'EObject'. This implementation returns null; returning a non-null result will terminate the switch, but this is the last case anyway.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'EObject'.
See Also:
doSwitch(org.eclipse.emf.ecore.EObject)
EMF generated code