EGF Engine
Release 0.1.0

org.eclipse.egf.model.util
Class ModelSwitch<T>

java.lang.Object
  extended by org.eclipse.egf.model.util.ModelSwitch<T>

public class ModelSwitch<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:
ModelPackage

Field Summary
protected static ModelPackage modelPackage
          The cached model package
 
Constructor Summary
ModelSwitch()
          Creates an instance of the switch
 
Method Summary
 T caseAbstractFactoryComponentFactory(AbstractFactoryComponentFactory object)
          Returns the result of interpreting the object as an instance of 'Abstract Factory Component Factory'
 T caseAbstractPatternElement(AbstractPatternElement object)
          Returns the result of interpreting the object as an instance of 'Abstract Pattern Element'
 T caseAbstractViewpoint(AbstractViewpoint object)
          Returns the result of interpreting the object as an instance of 'Abstract Viewpoint'
 T caseContext(Context object)
          Returns the result of interpreting the object as an instance of 'Context'
 T caseContextElement(ContextElement object)
          Returns the result of interpreting the object as an instance of 'Context Element'
 T caseContract(Contract object)
          Returns the result of interpreting the object as an instance of 'Contract'
 T caseContractElement(ContractElement object)
          Returns the result of interpreting the object as an instance of 'Contract Element'
 T caseContractElementReference(ContractElementReference object)
          Returns the result of interpreting the object as an instance of 'Contract Element Reference'
 T caseDomain(Domain object)
          Returns the result of interpreting the object as an instance of 'Domain'
 T caseFactory(Factory object)
          Returns the result of interpreting the object as an instance of 'Factory'
 T caseFactoryComponent(FactoryComponent object)
          Returns the result of interpreting the object as an instance of 'Factory Component'
 T caseFactoryComponentInvocation(FactoryComponentInvocation object)
          Returns the result of interpreting the object as an instance of 'Factory Component Invocation'
 T caseMappingModel(MappingModel object)
          Returns the result of interpreting the object as an instance of 'Mapping Model'
 T caseMappingViewpoint(MappingViewpoint object)
          Returns the result of interpreting the object as an instance of 'Mapping Viewpoint'
 T caseNamedModelElementWithId(NamedModelElementWithId object)
          Returns the result of interpreting the object as an instance of 'Named Model Element With Id'
 T casePatternLibrary(PatternLibrary object)
          Returns the result of interpreting the object as an instance of 'Pattern Library'
 T casePatternModel(PatternModel object)
          Returns the result of interpreting the object as an instance of 'Pattern Model'
 T casePatternViewpoint(PatternViewpoint object)
          Returns the result of interpreting the object as an instance of 'Pattern Viewpoint'
 T caseProductionPlan(ProductionPlan object)
          Returns the result of interpreting the object as an instance of 'Production Plan'
 T caseSpecification(Specification object)
          Returns the result of interpreting the object as an instance of 'Specification'
 T caseTaskFactoryHolder(TaskFactoryHolder object)
          Returns the result of interpreting the object as an instance of 'Task Factory Holder'
 T caseType(Type object)
          Returns the result of interpreting the object as an instance of 'Type'
 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 ModelPackage modelPackage
The cached model package

Constructor Detail

ModelSwitch

public ModelSwitch()
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.

caseNamedModelElementWithId

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

caseFactoryComponent

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

caseDomain

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

caseSpecification

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

caseAbstractViewpoint

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

caseContract

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

caseContractElement

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

caseContractElementReference

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

caseType

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

casePatternViewpoint

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

caseAbstractPatternElement

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

casePatternLibrary

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

casePatternModel

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

caseFactory

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

caseAbstractFactoryComponentFactory

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

caseProductionPlan

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

caseContext

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

caseContextElement

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

caseFactoryComponentInvocation

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

caseTaskFactoryHolder

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

caseMappingViewpoint

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

caseMappingModel

public T caseMappingModel(MappingModel object)
Returns the result of interpreting the object as an instance of 'Mapping Model'. 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 Model'.
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)

EGF Engine
Release 0.1.0

Copyright (c) Thales Corporate Services S.A.S, 2009.

This page is made available under license. For full details see the LEGAL in the documentation book that contains this page.