/*******************************************************************************
* Copyright (c) 2010-2015 Henshin developers. 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:
* TU Berlin, University of Luxembourg, SES S.A.
*******************************************************************************/
package de.tub.tfs.henshin.tgg.util;
import de.tub.tfs.henshin.tgg.*;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.util.Switch;
import org.eclipse.emf.henshin.model.Attribute;
import org.eclipse.emf.henshin.model.Edge;
import org.eclipse.emf.henshin.model.Graph;
import org.eclipse.emf.henshin.model.GraphElement;
import org.eclipse.emf.henshin.model.ModelElement;
import org.eclipse.emf.henshin.model.Module;
import org.eclipse.emf.henshin.model.NamedElement;
import org.eclipse.emf.henshin.model.Node;
import org.eclipse.emf.henshin.model.Rule;
import org.eclipse.emf.henshin.model.Unit;
/**
* <!-- 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 de.tub.tfs.henshin.tgg.TggPackage
* @generated
*/
public class TggSwitch<T> extends Switch<T> {
/**
* The cached model package
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected static TggPackage modelPackage;
/**
* Creates an instance of the switch.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public TggSwitch() {
if (modelPackage == null) {
modelPackage = TggPackage.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 TggPackage.TGG: {
TGG tgg = (TGG)theEObject;
T result = caseTGG(tgg);
if (result == null) result = caseModule(tgg);
if (result == null) result = caseNamedElement(tgg);
if (result == null) result = caseModelElement(tgg);
if (result == null) result = defaultCase(theEObject);
return result;
}
case TggPackage.NODE_LAYOUT: {
NodeLayout nodeLayout = (NodeLayout)theEObject;
T result = caseNodeLayout(nodeLayout);
if (result == null) result = defaultCase(theEObject);
return result;
}
case TggPackage.ATTRIBUTE_LAYOUT: {
AttributeLayout attributeLayout = (AttributeLayout)theEObject;
T result = caseAttributeLayout(attributeLayout);
if (result == null) result = defaultCase(theEObject);
return result;
}
case TggPackage.EDGE_LAYOUT: {
EdgeLayout edgeLayout = (EdgeLayout)theEObject;
T result = caseEdgeLayout(edgeLayout);
if (result == null) result = defaultCase(theEObject);
return result;
}
case TggPackage.GRAPH_LAYOUT: {
GraphLayout graphLayout = (GraphLayout)theEObject;
T result = caseGraphLayout(graphLayout);
if (result == null) result = defaultCase(theEObject);
return result;
}
case TggPackage.TRULE: {
TRule tRule = (TRule)theEObject;
T result = caseTRule(tRule);
if (result == null) result = defaultCase(theEObject);
return result;
}
case TggPackage.CRIT_PAIR: {
CritPair critPair = (CritPair)theEObject;
T result = caseCritPair(critPair);
if (result == null) result = defaultCase(theEObject);
return result;
}
case TggPackage.IMPORTED_PACKAGE: {
ImportedPackage importedPackage = (ImportedPackage)theEObject;
T result = caseImportedPackage(importedPackage);
if (result == null) result = defaultCase(theEObject);
return result;
}
case TggPackage.TRIPLE_GRAPH: {
TripleGraph tripleGraph = (TripleGraph)theEObject;
T result = caseTripleGraph(tripleGraph);
if (result == null) result = caseGraph(tripleGraph);
if (result == null) result = caseNamedElement(tripleGraph);
if (result == null) result = caseModelElement(tripleGraph);
if (result == null) result = defaultCase(theEObject);
return result;
}
case TggPackage.TNODE: {
TNode tNode = (TNode)theEObject;
T result = caseTNode(tNode);
if (result == null) result = caseNode(tNode);
if (result == null) result = caseNamedElement(tNode);
if (result == null) result = caseGraphElement(tNode);
if (result == null) result = caseModelElement(tNode);
if (result == null) result = defaultCase(theEObject);
return result;
}
case TggPackage.TGG_RULE: {
TGGRule tggRule = (TGGRule)theEObject;
T result = caseTGGRule(tggRule);
if (result == null) result = caseRule(tggRule);
if (result == null) result = caseUnit(tggRule);
if (result == null) result = caseNamedElement(tggRule);
if (result == null) result = caseModelElement(tggRule);
if (result == null) result = defaultCase(theEObject);
return result;
}
case TggPackage.TEDGE: {
TEdge tEdge = (TEdge)theEObject;
T result = caseTEdge(tEdge);
if (result == null) result = caseEdge(tEdge);
if (result == null) result = caseModelElement(tEdge);
if (result == null) result = caseGraphElement(tEdge);
if (result == null) result = defaultCase(theEObject);
return result;
}
case TggPackage.TATTRIBUTE: {
TAttribute tAttribute = (TAttribute)theEObject;
T result = caseTAttribute(tAttribute);
if (result == null) result = caseAttribute(tAttribute);
if (result == null) result = caseModelElement(tAttribute);
if (result == null) result = caseGraphElement(tAttribute);
if (result == null) result = defaultCase(theEObject);
return result;
}
default: return defaultCase(theEObject);
}
}
/**
* Returns the result of interpreting the object as an instance of '<em>TGG</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>TGG</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseTGG(TGG object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Node Layout</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>Node Layout</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseNodeLayout(NodeLayout object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Attribute Layout</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>Attribute Layout</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseAttributeLayout(AttributeLayout object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Edge Layout</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>Edge Layout</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseEdgeLayout(EdgeLayout object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Graph Layout</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>Graph Layout</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseGraphLayout(GraphLayout object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>TRule</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>TRule</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseTRule(TRule object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Crit Pair</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>Crit Pair</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseCritPair(CritPair object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Imported 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>Imported Package</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseImportedPackage(ImportedPackage object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Triple Graph</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>Triple Graph</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseTripleGraph(TripleGraph object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>TNode</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>TNode</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseTNode(TNode object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>TGG Rule</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>TGG Rule</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseTGGRule(TGGRule object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>TEdge</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>TEdge</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseTEdge(TEdge object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>TAttribute</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>TAttribute</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseTAttribute(TAttribute 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>Named 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>Named Element</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseNamedElement(NamedElement object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Module</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>Module</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseModule(Module object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Graph</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>Graph</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseGraph(Graph object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Graph 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>Graph Element</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseGraphElement(GraphElement object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>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>Node</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseNode(Node object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Unit</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>Unit</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseUnit(Unit object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Rule</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>Rule</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseRule(Rule object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Edge</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>Edge</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseEdge(Edge object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Attribute</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>Attribute</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseAttribute(Attribute 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;
}
} //TggSwitch