blob: 8d5a4e12ee4cd116873d5c096b22eb995da8f4ac [file] [log] [blame]
/**
* Copyright (c) 2014 Fraunhofer FOKUS
* 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:
* Max Bureck
* Marc-Florian Wendland
*/
package org.eclipse.upr.depl.components.util;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.util.Switch;
import org.eclipse.upr.depl.components.*;
/**
* <!-- 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.upr.depl.components.ComponentsPackage
* @generated
*/
public class ComponentsSwitch<T> extends Switch<T> {
/**
* The cached model package
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected static ComponentsPackage modelPackage;
/**
* Creates an instance of the switch.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ComponentsSwitch() {
if (modelPackage == null) {
modelPackage = ComponentsPackage.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 ComponentsPackage.COMPONENT: {
Component component = (Component)theEObject;
T result = caseComponent(component);
if (result == null) result = defaultCase(theEObject);
return result;
}
case ComponentsPackage.PORT: {
Port port = (Port)theEObject;
T result = casePort(port);
if (result == null) result = defaultCase(theEObject);
return result;
}
case ComponentsPackage.COMPONENT_IMPLEMENTATION: {
ComponentImplementation componentImplementation = (ComponentImplementation)theEObject;
T result = caseComponentImplementation(componentImplementation);
if (result == null) result = defaultCase(theEObject);
return result;
}
case ComponentsPackage.CAPABILITY: {
Capability capability = (Capability)theEObject;
T result = caseCapability(capability);
if (result == null) result = defaultCase(theEObject);
return result;
}
case ComponentsPackage.REQUIREMENT: {
Requirement requirement = (Requirement)theEObject;
T result = caseRequirement(requirement);
if (result == null) result = defaultCase(theEObject);
return result;
}
case ComponentsPackage.PROPERTY: {
Property property = (Property)theEObject;
T result = caseProperty(property);
if (result == null) result = defaultCase(theEObject);
return result;
}
case ComponentsPackage.COMPONENT_ASSEMBLY: {
ComponentAssembly componentAssembly = (ComponentAssembly)theEObject;
T result = caseComponentAssembly(componentAssembly);
if (result == null) result = caseComponentImplementation(componentAssembly);
if (result == null) result = defaultCase(theEObject);
return result;
}
case ComponentsPackage.PROPERTY_CONNECTOR: {
PropertyConnector propertyConnector = (PropertyConnector)theEObject;
T result = casePropertyConnector(propertyConnector);
if (result == null) result = defaultCase(theEObject);
return result;
}
case ComponentsPackage.PORT_CONNECTOR: {
PortConnector portConnector = (PortConnector)theEObject;
T result = casePortConnector(portConnector);
if (result == null) result = defaultCase(theEObject);
return result;
}
case ComponentsPackage.EXTERNAL_REFERENCE: {
ExternalReference externalReference = (ExternalReference)theEObject;
T result = caseExternalReference(externalReference);
if (result == null) result = defaultCase(theEObject);
return result;
}
case ComponentsPackage.MONOLITHIC_IMPLEMENTATION: {
MonolithicImplementation monolithicImplementation = (MonolithicImplementation)theEObject;
T result = caseMonolithicImplementation(monolithicImplementation);
if (result == null) result = caseComponentImplementation(monolithicImplementation);
if (result == null) result = defaultCase(theEObject);
return result;
}
default: return defaultCase(theEObject);
}
}
/**
* Returns the result of interpreting the object as an instance of '<em>Component</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>Component</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseComponent(Component object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Port</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>Port</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T casePort(Port object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Component Implementation</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>Component Implementation</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseComponentImplementation(ComponentImplementation object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Capability</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>Capability</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseCapability(Capability object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Requirement</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>Requirement</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseRequirement(Requirement object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Property</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>Property</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseProperty(Property object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Component Assembly</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>Component Assembly</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseComponentAssembly(ComponentAssembly object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Property Connector</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>Property Connector</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T casePropertyConnector(PropertyConnector object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Port Connector</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>Port Connector</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T casePortConnector(PortConnector object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>External Reference</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>External Reference</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseExternalReference(ExternalReference object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Monolithic Implementation</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>Monolithic Implementation</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseMonolithicImplementation(MonolithicImplementation 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;
}
} //ComponentsSwitch