/*******************************************************************************
* Copyright (c) 2005, 2019 IBM Corporation and others.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
/**
*
*
*
* $Id: RTIndexSwitch.java,v 1.2 2005/12/03 04:06:47 cbrealey Exp $
*/
package org.eclipse.wst.ws.internal.model.v10.rtindex.util;
import java.util.List;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.wst.ws.internal.model.v10.rtindex.*;
/**
*
* The Switch for the model's inheritance hierarchy.
* It supports the call {@link #doSwitch(EObject) 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 org.eclipse.wst.ws.internal.model.v10.rtindex.RTIndexPackage
* @generated
*/
public class RTIndexSwitch {
/**
* The cached model package
*
*
* @generated
*/
protected static RTIndexPackage modelPackage;
/**
* Creates an instance of the switch.
*
*
* @generated
*/
public RTIndexSwitch() {
if (modelPackage == null) {
modelPackage = RTIndexPackage.eINSTANCE;
}
}
/**
* Calls caseXXX
for each class of the model until one returns a non null result; it yields that result.
*
*
* @return the first non-null result returned by a caseXXX
call.
* @generated
*/
public Object doSwitch(EObject theEObject) {
return doSwitch(theEObject.eClass(), theEObject);
}
/**
* Calls caseXXX
for each class of the model until one returns a non null result; it yields that result.
*
*
* @return the first non-null result returned by a caseXXX
call.
* @generated
*/
protected Object doSwitch(EClass theEClass, EObject theEObject) {
if (theEClass.eContainer() == modelPackage) {
return doSwitch(theEClass.getClassifierID(), theEObject);
}
else {
List eSuperTypes = theEClass.getESuperTypes();
return
eSuperTypes.isEmpty() ?
defaultCase(theEObject) :
doSwitch((EClass)eSuperTypes.get(0), theEObject);
}
}
/**
* Calls caseXXX
for each class of the model until one returns a non null result; it yields that result.
*
*
* @return the first non-null result returned by a caseXXX
call.
* @generated
*/
protected Object doSwitch(int classifierID, EObject theEObject) {
switch (classifierID) {
case RTIndexPackage.DESCRIPTION: {
Description description = (Description)theEObject;
Object result = caseDescription(description);
if (result == null) result = defaultCase(theEObject);
return result;
}
case RTIndexPackage.DOCUMENT_ROOT: {
DocumentRoot documentRoot = (DocumentRoot)theEObject;
Object result = caseDocumentRoot(documentRoot);
if (result == null) result = defaultCase(theEObject);
return result;
}
case RTIndexPackage.INDEX: {
Index index = (Index)theEObject;
Object result = caseIndex(index);
if (result == null) result = defaultCase(theEObject);
return result;
}
case RTIndexPackage.NAME: {
Name name = (Name)theEObject;
Object result = caseName(name);
if (result == null) result = defaultCase(theEObject);
return result;
}
default: return defaultCase(theEObject);
}
}
/**
* Returns the result of interpretting the object as an instance of 'Description'.
*
* This implementation returns null;
* returning a non-null result will terminate the switch.
*
* @param object the target of the switch.
* @return the result of interpretting the object as an instance of 'Description'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public Object caseDescription(Description object) {
return null;
}
/**
* Returns the result of interpretting the object as an instance of 'Document Root'.
*
* This implementation returns null;
* returning a non-null result will terminate the switch.
*
* @param object the target of the switch.
* @return the result of interpretting the object as an instance of 'Document Root'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public Object caseDocumentRoot(DocumentRoot object) {
return null;
}
/**
* Returns the result of interpretting the object as an instance of 'Index'.
*
* This implementation returns null;
* returning a non-null result will terminate the switch.
*
* @param object the target of the switch.
* @return the result of interpretting the object as an instance of 'Index'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public Object caseIndex(Index object) {
return null;
}
/**
* Returns the result of interpretting the object as an instance of 'Name'.
*
* This implementation returns null;
* returning a non-null result will terminate the switch.
*
* @param object the target of the switch.
* @return the result of interpretting the object as an instance of 'Name'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public Object caseName(Name object) {
return null;
}
/**
* Returns the result of interpretting 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.
*
* @param object the target of the switch.
* @return the result of interpretting the object as an instance of 'EObject'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject)
* @generated
*/
public Object defaultCase(EObject object) {
return null;
}
} //RTIndexSwitch