org.eclipse.ocl.utilities.util
Class UtilitiesSwitch<T1>

java.lang.Object
  extended by org.eclipse.ocl.utilities.util.UtilitiesSwitch<T1>

public class UtilitiesSwitch<T1>
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:
UtilitiesPackage

Field Summary
protected static UtilitiesPackage modelPackage
          The cached model package
 
Constructor Summary
UtilitiesSwitch()
          Creates an instance of the switch
 
Method Summary
 T1 caseASTNode(ASTNode object)
          Returns the result of interpreting the object as an instance of 'AST Node'
 T1 caseCallingASTNode(CallingASTNode object)
          Returns the result of interpreting the object as an instance of 'Calling AST Node'
<C,PM> T1
caseExpressionInOCL(ExpressionInOCL<C,PM> object)
          Returns the result of interpreting the object as an instance of 'Expression In OCL'
<O> T1
casePredefinedType(PredefinedType<O> object)
          Returns the result of interpreting the object as an instance of 'Predefined Type'
 T1 caseTypedASTNode(TypedASTNode object)
          Returns the result of interpreting the object as an instance of 'Typed AST Node'
<C> T1
caseTypedElement(TypedElement<C> object)
          Returns the result of interpreting the object as an instance of 'Typed Element'
 T1 caseVisitable(Visitable object)
          Returns the result of interpreting the object as an instance of 'Visitable'
<T,C,O,P,EL,PM,S,COA,SSA,CT>
T1
caseVisitor(Visitor<T,C,O,P,EL,PM,S,COA,SSA,CT> object)
          Returns the result of interpreting the object as an instance of 'Visitor'
 T1 defaultCase(EObject object)
          Returns the result of interpreting the object as an instance of 'EObject'
protected  T1 doSwitch(EClass theEClass, EObject theEObject)
          Calls caseXXX for each class of the model until one returns a non null result; it yields that result
 T1 doSwitch(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 UtilitiesPackage modelPackage
The cached model package

Constructor Detail

UtilitiesSwitch

public UtilitiesSwitch()
Creates an instance of the switch.

Method Detail

doSwitch

public T1 doSwitch(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.

doSwitch

protected T1 doSwitch(EClass theEClass,
                      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.

caseASTNode

public T1 caseASTNode(ASTNode object)
Returns the result of interpreting the object as an instance of 'AST Node'. 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 'AST Node'.
See Also:
doSwitch(EObject)

caseCallingASTNode

public T1 caseCallingASTNode(CallingASTNode object)
Returns the result of interpreting the object as an instance of 'Calling AST Node'. 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 'Calling AST Node'.
See Also:
doSwitch(EObject)

casePredefinedType

public <O> T1 casePredefinedType(PredefinedType<O> object)
Returns the result of interpreting the object as an instance of 'Predefined Type'. 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 'Predefined Type'.
See Also:
doSwitch(EObject)

caseTypedASTNode

public T1 caseTypedASTNode(TypedASTNode object)
Returns the result of interpreting the object as an instance of 'Typed AST Node'. 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 'Typed AST Node'.
See Also:
doSwitch(EObject)

caseVisitable

public T1 caseVisitable(Visitable object)
Returns the result of interpreting the object as an instance of 'Visitable'. 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 'Visitable'.
See Also:
doSwitch(EObject)

caseTypedElement

public <C> T1 caseTypedElement(TypedElement<C> object)
Returns the result of interpreting the object as an instance of 'Typed 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 'Typed Element'.
See Also:
doSwitch(EObject)

caseVisitor

public <T,C,O,P,EL,PM,S,COA,SSA,CT> T1 caseVisitor(Visitor<T,C,O,P,EL,PM,S,COA,SSA,CT> object)
Returns the result of interpreting the object as an instance of 'Visitor'. 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 'Visitor'.
See Also:
doSwitch(EObject)

caseExpressionInOCL

public <C,PM> T1 caseExpressionInOCL(ExpressionInOCL<C,PM> object)
Returns the result of interpreting the object as an instance of 'Expression In OCL'. 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 'Expression In OCL'.
See Also:
doSwitch(EObject)

defaultCase

public T1 defaultCase(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)

Copyright 2002, 2007 IBM Corporation and others.
All Rights Reserved.