blob: 603949b36371c64fcb0805ff6aec740e607cb90a [file] [log] [blame]
/*******************************************************************************
* <copyright>
*
* Copyright (c) 2013, 2013 SAP AG.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* SAP AG - initial API, implementation and documentation
*
* </copyright>
*
*******************************************************************************/
package org.eclipse.fmc.mm.util;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.util.Switch;
import org.eclipse.fmc.mm.*;
/**
* <!-- 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 org.eclipse.fmc.mm.FmcPackage
* @generated
*/
public class FmcSwitch<T> extends Switch<T> {
/**
* The cached model package
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected static FmcPackage modelPackage;
/**
* Creates an instance of the switch.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public FmcSwitch() {
if (modelPackage == null) {
modelPackage = FmcPackage.eINSTANCE;
}
}
/**
* Checks whether this is a switch for the given package.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @parameter ePackage the package in question.
* @return whether this is a switch for the given package.
* @generated
*/
@Override
protected boolean isSwitchFor(EPackage ePackage) {
return ePackage == modelPackage;
}
/**
* 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
*/
@Override
protected T doSwitch(int classifierID, EObject theEObject) {
switch (classifierID) {
case FmcPackage.AGENT: {
Agent agent = (Agent)theEObject;
T result = caseAgent(agent);
if (result == null) result = caseFMCNode(agent);
if (result == null) result = caseFMCElement(agent);
if (result == null) result = defaultCase(theEObject);
return result;
}
case FmcPackage.CHANNEL: {
Channel channel = (Channel)theEObject;
T result = caseChannel(channel);
if (result == null) result = caseFMCConnection(channel);
if (result == null) result = caseFMCElement(channel);
if (result == null) result = defaultCase(theEObject);
return result;
}
case FmcPackage.STORAGE: {
Storage storage = (Storage)theEObject;
T result = caseStorage(storage);
if (result == null) result = caseAccessTarget(storage);
if (result == null) result = caseFMCNode(storage);
if (result == null) result = caseFMCElement(storage);
if (result == null) result = defaultCase(theEObject);
return result;
}
case FmcPackage.FMC_NODE: {
FMCNode fmcNode = (FMCNode)theEObject;
T result = caseFMCNode(fmcNode);
if (result == null) result = caseFMCElement(fmcNode);
if (result == null) result = defaultCase(theEObject);
return result;
}
case FmcPackage.FMC_CONNECTION: {
FMCConnection fmcConnection = (FMCConnection)theEObject;
T result = caseFMCConnection(fmcConnection);
if (result == null) result = caseFMCElement(fmcConnection);
if (result == null) result = defaultCase(theEObject);
return result;
}
case FmcPackage.ACCESS: {
Access access = (Access)theEObject;
T result = caseAccess(access);
if (result == null) result = caseFMCConnection(access);
if (result == null) result = caseFMCElement(access);
if (result == null) result = defaultCase(theEObject);
return result;
}
case FmcPackage.FMC_MODEL: {
FMCModel fmcModel = (FMCModel)theEObject;
T result = caseFMCModel(fmcModel);
if (result == null) result = defaultCase(theEObject);
return result;
}
case FmcPackage.STRUCTURE_VARIANCE: {
StructureVariance structureVariance = (StructureVariance)theEObject;
T result = caseStructureVariance(structureVariance);
if (result == null) result = caseAccessTarget(structureVariance);
if (result == null) result = caseFMCNode(structureVariance);
if (result == null) result = caseFMCElement(structureVariance);
if (result == null) result = defaultCase(theEObject);
return result;
}
case FmcPackage.METADATA: {
Metadata metadata = (Metadata)theEObject;
T result = caseMetadata(metadata);
if (result == null) result = defaultCase(theEObject);
return result;
}
case FmcPackage.ACCESS_TARGET: {
AccessTarget accessTarget = (AccessTarget)theEObject;
T result = caseAccessTarget(accessTarget);
if (result == null) result = caseFMCNode(accessTarget);
if (result == null) result = caseFMCElement(accessTarget);
if (result == null) result = defaultCase(theEObject);
return result;
}
case FmcPackage.COMMENT: {
Comment comment = (Comment)theEObject;
T result = caseComment(comment);
if (result == null) result = caseFMCElement(comment);
if (result == null) result = defaultCase(theEObject);
return result;
}
case FmcPackage.FMC_ELEMENT: {
FMCElement fmcElement = (FMCElement)theEObject;
T result = caseFMCElement(fmcElement);
if (result == null) result = defaultCase(theEObject);
return result;
}
case FmcPackage.STEREOTYPE: {
Stereotype stereotype = (Stereotype)theEObject;
T result = caseStereotype(stereotype);
if (result == null) result = defaultCase(theEObject);
return result;
}
case FmcPackage.STEREOTYPE_VALUE: {
StereotypeValue stereotypeValue = (StereotypeValue)theEObject;
T result = caseStereotypeValue(stereotypeValue);
if (result == null) result = defaultCase(theEObject);
return result;
}
case FmcPackage.IFMC_ELEMENT_VISITOR: {
IFMCElementVisitor ifmcElementVisitor = (IFMCElementVisitor)theEObject;
T result = caseIFMCElementVisitor(ifmcElementVisitor);
if (result == null) result = defaultCase(theEObject);
return result;
}
default: return defaultCase(theEObject);
}
}
/**
* Returns the result of interpreting the object as an instance of '<em>Agent</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>Agent</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseAgent(Agent object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Channel</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>Channel</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseChannel(Channel object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Storage</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>Storage</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseStorage(Storage object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>FMC Node</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>FMC Node</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseFMCNode(FMCNode object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>FMC Connection</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>FMC Connection</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseFMCConnection(FMCConnection object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Access</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>Access</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseAccess(Access object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>FMC Model</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>FMC Model</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseFMCModel(FMCModel object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Structure Variance</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>Structure Variance</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseStructureVariance(StructureVariance object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Metadata</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>Metadata</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseMetadata(Metadata object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Access Target</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>Access Target</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseAccessTarget(AccessTarget object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Comment</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>Comment</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseComment(Comment object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>FMC 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>FMC Element</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseFMCElement(FMCElement object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Stereotype</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>Stereotype</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseStereotype(Stereotype object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Stereotype Value</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>Stereotype Value</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseStereotypeValue(StereotypeValue object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>IFMC Element Visitor</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>IFMC Element Visitor</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseIFMCElementVisitor(IFMCElementVisitor 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
*/
@Override
public T defaultCase(EObject object) {
return null;
}
} //FmcSwitch