org.eclipse.emf.henshin.model.util
Class HenshinSwitch<T>

java.lang.Object
  extended by org.eclipse.emf.henshin.model.util.HenshinSwitch<T>

public class HenshinSwitch<T>
extends 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:
HenshinPackage

Field Summary
protected static HenshinPackage modelPackage
          The cached model package
 
Constructor Summary
HenshinSwitch()
          Creates an instance of the switch.
 
Method Summary
 T caseAnd(And object)
          Returns the result of interpreting the object as an instance of 'And'.
 T caseAnnotation(Annotation object)
          Returns the result of interpreting the object as an instance of 'Annotation'.
 T caseAttribute(Attribute object)
          Returns the result of interpreting the object as an instance of 'Attribute'.
 T caseAttributeCondition(AttributeCondition object)
          Returns the result of interpreting the object as an instance of 'Attribute Condition'.
 T caseBinaryFormula(BinaryFormula object)
          Returns the result of interpreting the object as an instance of 'Binary Formula'.
 T caseConditionalUnit(ConditionalUnit object)
          Returns the result of interpreting the object as an instance of 'Conditional Unit'.
 T caseEdge(Edge object)
          Returns the result of interpreting the object as an instance of 'Edge'.
 T caseFormula(Formula object)
          Returns the result of interpreting the object as an instance of 'Formula'.
 T caseGraph(Graph object)
          Returns the result of interpreting the object as an instance of 'Graph'.
 T caseGraphElement(GraphElement object)
          Returns the result of interpreting the object as an instance of 'Graph Element'.
 T caseIndependentUnit(IndependentUnit object)
          Returns the result of interpreting the object as an instance of 'Independent Unit'.
 T caseIteratedUnit(IteratedUnit object)
          Returns the result of interpreting the object as an instance of 'Iterated Unit'.
 T caseLoopUnit(LoopUnit object)
          Returns the result of interpreting the object as an instance of 'Loop Unit'.
 T caseMapping(Mapping object)
          Returns the result of interpreting the object as an instance of 'Mapping'.
 T caseModelElement(ModelElement object)
          Returns the result of interpreting the object as an instance of 'Model Element'.
 T caseModule(Module object)
          Returns the result of interpreting the object as an instance of 'Module'.
 T caseMultiUnit(MultiUnit object)
          Returns the result of interpreting the object as an instance of 'Multi Unit'.
 T caseNamedElement(NamedElement object)
          Returns the result of interpreting the object as an instance of 'Named Element'.
 T caseNestedCondition(NestedCondition object)
          Returns the result of interpreting the object as an instance of 'Nested Condition'.
 T caseNode(Node object)
          Returns the result of interpreting the object as an instance of 'Node'.
 T caseNot(Not object)
          Returns the result of interpreting the object as an instance of 'Not'.
 T caseOr(Or object)
          Returns the result of interpreting the object as an instance of 'Or'.
 T caseParameter(Parameter object)
          Returns the result of interpreting the object as an instance of 'Parameter'.
 T caseParameterMapping(ParameterMapping object)
          Returns the result of interpreting the object as an instance of 'Parameter Mapping'.
 T casePriorityUnit(PriorityUnit object)
          Returns the result of interpreting the object as an instance of 'Priority Unit'.
 T caseRule(Rule object)
          Returns the result of interpreting the object as an instance of 'Rule'.
 T caseSequentialUnit(SequentialUnit object)
          Returns the result of interpreting the object as an instance of 'Sequential Unit'.
 T caseUnaryFormula(UnaryFormula object)
          Returns the result of interpreting the object as an instance of 'Unary Formula'.
 T caseUnaryUnit(UnaryUnit object)
          Returns the result of interpreting the object as an instance of 'Unary Unit'.
 T caseUnit(Unit object)
          Returns the result of interpreting the object as an instance of 'Unit'.
 T caseXor(Xor object)
          Returns the result of interpreting the object as an instance of 'Xor'.
 T defaultCase(EObject object)
          Returns the result of interpreting the object as an instance of 'EObject'.
protected  T doSwitch(EClass theEClass, EObject theEObject)
          Calls caseXXX for each class of the model until one returns a non null result; it yields that result.
 T doSwitch(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, 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 HenshinPackage modelPackage
The cached model package

Constructor Detail

HenshinSwitch

public HenshinSwitch()
Creates an instance of the switch.

Method Detail

doSwitch

public T 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 T 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.

doSwitch

protected T doSwitch(int classifierID,
                     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.

caseModelElement

public T caseModelElement(ModelElement object)
Returns the result of interpreting the object as an instance of 'Model 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 'Model Element'.
See Also:
doSwitch(EObject)

caseAnnotation

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

caseNamedElement

public T caseNamedElement(NamedElement object)
Returns the result of interpreting the object as an instance of 'Named 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 'Named Element'.
See Also:
doSwitch(EObject)

caseRule

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

caseAttributeCondition

public T caseAttributeCondition(AttributeCondition object)
Returns the result of interpreting the object as an instance of 'Attribute Condition'. 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 'Attribute Condition'.
See Also:
doSwitch(EObject)

caseParameter

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

caseGraph

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

caseGraphElement

public T caseGraphElement(GraphElement object)
Returns the result of interpreting the object as an instance of 'Graph 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 'Graph Element'.
See Also:
doSwitch(EObject)

caseModule

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

caseUnit

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

caseMapping

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

caseNode

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

caseAttribute

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

caseEdge

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

caseUnaryUnit

public T caseUnaryUnit(UnaryUnit object)
Returns the result of interpreting the object as an instance of 'Unary Unit'. 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 'Unary Unit'.
See Also:
doSwitch(EObject)

caseMultiUnit

public T caseMultiUnit(MultiUnit object)
Returns the result of interpreting the object as an instance of 'Multi Unit'. 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 'Multi Unit'.
See Also:
doSwitch(EObject)

caseIndependentUnit

public T caseIndependentUnit(IndependentUnit object)
Returns the result of interpreting the object as an instance of 'Independent Unit'. 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 'Independent Unit'.
See Also:
doSwitch(EObject)

caseSequentialUnit

public T caseSequentialUnit(SequentialUnit object)
Returns the result of interpreting the object as an instance of 'Sequential Unit'. 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 'Sequential Unit'.
See Also:
doSwitch(EObject)

caseConditionalUnit

public T caseConditionalUnit(ConditionalUnit object)
Returns the result of interpreting the object as an instance of 'Conditional Unit'. 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 'Conditional Unit'.
See Also:
doSwitch(EObject)

casePriorityUnit

public T casePriorityUnit(PriorityUnit object)
Returns the result of interpreting the object as an instance of 'Priority Unit'. 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 'Priority Unit'.
See Also:
doSwitch(EObject)

caseIteratedUnit

public T caseIteratedUnit(IteratedUnit object)
Returns the result of interpreting the object as an instance of 'Iterated Unit'. 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 'Iterated Unit'.
See Also:
doSwitch(EObject)

caseLoopUnit

public T caseLoopUnit(LoopUnit object)
Returns the result of interpreting the object as an instance of 'Loop Unit'. 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 'Loop Unit'.
See Also:
doSwitch(EObject)

caseNestedCondition

public T caseNestedCondition(NestedCondition object)
Returns the result of interpreting the object as an instance of 'Nested Condition'. 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 'Nested Condition'.
See Also:
doSwitch(EObject)

caseFormula

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

caseUnaryFormula

public T caseUnaryFormula(UnaryFormula object)
Returns the result of interpreting the object as an instance of 'Unary Formula'. 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 'Unary Formula'.
See Also:
doSwitch(EObject)

caseBinaryFormula

public T caseBinaryFormula(BinaryFormula object)
Returns the result of interpreting the object as an instance of 'Binary Formula'. 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 'Binary Formula'.
See Also:
doSwitch(EObject)

caseAnd

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

caseOr

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

caseNot

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

caseXor

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

caseParameterMapping

public T caseParameterMapping(ParameterMapping object)
Returns the result of interpreting the object as an instance of 'Parameter Mapping'. 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 'Parameter Mapping'.
See Also:
doSwitch(EObject)

defaultCase

public T 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)