/**
* <copyright>
* </copyright>
*
* $Id$
*/
package orgomg.cwm.analysis.businessnomenclature.util;
import java.util.List;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import orgomg.cwm.analysis.businessnomenclature.*;
import orgomg.cwm.objectmodel.core.Element;
import orgomg.cwm.objectmodel.core.ModelElement;
import orgomg.cwm.objectmodel.core.Namespace;
/**
* <!-- 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 orgomg.cwm.analysis.businessnomenclature.BusinessnomenclaturePackage
* @generated
*/
public class BusinessnomenclatureSwitch<T> {
/**
* The cached model package
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected static BusinessnomenclaturePackage modelPackage;
/**
* Creates an instance of the switch.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public BusinessnomenclatureSwitch() {
if (modelPackage == null) {
modelPackage = BusinessnomenclaturePackage.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 BusinessnomenclaturePackage.VOCABULARY_ELEMENT: {
VocabularyElement vocabularyElement = (VocabularyElement)theEObject;
T result = caseVocabularyElement(vocabularyElement);
if (result == null) result = caseModelElement(vocabularyElement);
if (result == null) result = caseElement(vocabularyElement);
if (result == null) result = defaultCase(theEObject);
return result;
}
case BusinessnomenclaturePackage.NOMENCLATURE: {
Nomenclature nomenclature = (Nomenclature)theEObject;
T result = caseNomenclature(nomenclature);
if (result == null) result = casePackage(nomenclature);
if (result == null) result = caseNamespace(nomenclature);
if (result == null) result = caseModelElement(nomenclature);
if (result == null) result = caseElement(nomenclature);
if (result == null) result = defaultCase(theEObject);
return result;
}
case BusinessnomenclaturePackage.TAXONOMY: {
Taxonomy taxonomy = (Taxonomy)theEObject;
T result = caseTaxonomy(taxonomy);
if (result == null) result = caseNomenclature(taxonomy);
if (result == null) result = casePackage(taxonomy);
if (result == null) result = caseNamespace(taxonomy);
if (result == null) result = caseModelElement(taxonomy);
if (result == null) result = caseElement(taxonomy);
if (result == null) result = defaultCase(theEObject);
return result;
}
case BusinessnomenclaturePackage.GLOSSARY: {
Glossary glossary = (Glossary)theEObject;
T result = caseGlossary(glossary);
if (result == null) result = caseNomenclature(glossary);
if (result == null) result = casePackage(glossary);
if (result == null) result = caseNamespace(glossary);
if (result == null) result = caseModelElement(glossary);
if (result == null) result = caseElement(glossary);
if (result == null) result = defaultCase(theEObject);
return result;
}
case BusinessnomenclaturePackage.BUSINESS_DOMAIN: {
BusinessDomain businessDomain = (BusinessDomain)theEObject;
T result = caseBusinessDomain(businessDomain);
if (result == null) result = casePackage(businessDomain);
if (result == null) result = caseNamespace(businessDomain);
if (result == null) result = caseModelElement(businessDomain);
if (result == null) result = caseElement(businessDomain);
if (result == null) result = defaultCase(theEObject);
return result;
}
case BusinessnomenclaturePackage.CONCEPT: {
Concept concept = (Concept)theEObject;
T result = caseConcept(concept);
if (result == null) result = caseVocabularyElement(concept);
if (result == null) result = caseModelElement(concept);
if (result == null) result = caseElement(concept);
if (result == null) result = defaultCase(theEObject);
return result;
}
case BusinessnomenclaturePackage.TERM: {
Term term = (Term)theEObject;
T result = caseTerm(term);
if (result == null) result = caseVocabularyElement(term);
if (result == null) result = caseModelElement(term);
if (result == null) result = caseElement(term);
if (result == null) result = defaultCase(theEObject);
return result;
}
default: return defaultCase(theEObject);
}
}
/**
* Returns the result of interpreting the object as an instance of '<em>Vocabulary Element</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>Vocabulary Element</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseVocabularyElement(VocabularyElement object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Nomenclature</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>Nomenclature</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseNomenclature(Nomenclature object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Taxonomy</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>Taxonomy</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseTaxonomy(Taxonomy object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Glossary</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>Glossary</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseGlossary(Glossary object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Business Domain</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>Business Domain</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseBusinessDomain(BusinessDomain object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Concept</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>Concept</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseConcept(Concept object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Term</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>Term</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseTerm(Term object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Element</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>Element</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseElement(Element object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Model Element</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 Element</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseModelElement(ModelElement object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Namespace</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>Namespace</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseNamespace(Namespace object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Package</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>Package</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T casePackage(orgomg.cwm.objectmodel.core.Package 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;
}
} //BusinessnomenclatureSwitch