/* license-start * * Copyright (C) 2008 - 2013 Crispico, <http://www.crispico.com/>. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation version 3. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details, at <http://www.gnu.org/licenses/>. * * Contributors: * Crispico - Initial API and implementation * * license-end */ /** * <copyright> * </copyright> * * $Id$ */ package org.flowerplatform.emf_model.notation.util; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.util.Switch; import org.flowerplatform.emf_model.notation.*; /** * <!-- 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.flowerplatform.emf_model.notation.NotationPackage * @generated */ public class NotationSwitch<T> extends Switch<T> { /** * The cached model package * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected static NotationPackage modelPackage; /** * Creates an instance of the switch. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotationSwitch() { if (modelPackage == null) { modelPackage = NotationPackage.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 NotationPackage.NOTATION_ELEMENT: { NotationElement notationElement = (NotationElement)theEObject; T result = caseNotationElement(notationElement); if (result == null) result = defaultCase(theEObject); return result; } case NotationPackage.VIEW: { View view = (View)theEObject; T result = caseView(view); if (result == null) result = caseNotationElement(view); if (result == null) result = defaultCase(theEObject); return result; } case NotationPackage.NODE: { Node node = (Node)theEObject; T result = caseNode(node); if (result == null) result = caseView(node); if (result == null) result = caseNotationElement(node); if (result == null) result = defaultCase(theEObject); return result; } case NotationPackage.CATEGORY_SEPARATOR: { CategorySeparator categorySeparator = (CategorySeparator)theEObject; T result = caseCategorySeparator(categorySeparator); if (result == null) result = caseNode(categorySeparator); if (result == null) result = caseView(categorySeparator); if (result == null) result = caseNotationElement(categorySeparator); if (result == null) result = defaultCase(theEObject); return result; } case NotationPackage.EDGE: { Edge edge = (Edge)theEObject; T result = caseEdge(edge); if (result == null) result = caseView(edge); if (result == null) result = caseNotationElement(edge); if (result == null) result = defaultCase(theEObject); return result; } case NotationPackage.DIAGRAM: { Diagram diagram = (Diagram)theEObject; T result = caseDiagram(diagram); if (result == null) result = caseView(diagram); if (result == null) result = caseNotationElement(diagram); if (result == null) result = defaultCase(theEObject); return result; } case NotationPackage.LAYOUT_CONSTRAINT: { LayoutConstraint layoutConstraint = (LayoutConstraint)theEObject; T result = caseLayoutConstraint(layoutConstraint); if (result == null) result = defaultCase(theEObject); return result; } case NotationPackage.LOCATION: { Location location = (Location)theEObject; T result = caseLocation(location); if (result == null) result = caseNotationElement(location); if (result == null) result = caseLayoutConstraint(location); if (result == null) result = defaultCase(theEObject); return result; } case NotationPackage.BOUNDS: { Bounds bounds = (Bounds)theEObject; T result = caseBounds(bounds); if (result == null) result = caseLocation(bounds); if (result == null) result = caseNotationElement(bounds); if (result == null) result = caseLayoutConstraint(bounds); if (result == null) result = defaultCase(theEObject); return result; } case NotationPackage.NOTE: { Note note = (Note)theEObject; T result = caseNote(note); if (result == null) result = caseNode(note); if (result == null) result = caseView(note); if (result == null) result = caseNotationElement(note); if (result == null) result = defaultCase(theEObject); return result; } case NotationPackage.MIND_MAP_NODE: { MindMapNode mindMapNode = (MindMapNode)theEObject; T result = caseMindMapNode(mindMapNode); if (result == null) result = caseNode(mindMapNode); if (result == null) result = caseView(mindMapNode); if (result == null) result = caseNotationElement(mindMapNode); if (result == null) result = defaultCase(theEObject); return result; } case NotationPackage.EXPANDABLE_NODE: { ExpandableNode expandableNode = (ExpandableNode)theEObject; T result = caseExpandableNode(expandableNode); if (result == null) result = caseNode(expandableNode); if (result == null) result = caseView(expandableNode); if (result == null) result = caseNotationElement(expandableNode); if (result == null) result = defaultCase(theEObject); return result; } default: return defaultCase(theEObject); } } /** * 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 caseNotationElement(NotationElement object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>View</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>View</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseView(View 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>Category Separator</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>Category Separator</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseCategorySeparator(CategorySeparator 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>Diagram</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>Diagram</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseDiagram(Diagram object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Layout Constraint</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>Layout Constraint</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseLayoutConstraint(LayoutConstraint object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Location</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>Location</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseLocation(Location object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Bounds</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>Bounds</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseBounds(Bounds object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Note</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>Note</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseNote(Note object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Mind Map 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>Mind Map Node</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseMindMapNode(MindMapNode object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Expandable 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>Expandable Node</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseExpandableNode(ExpandableNode 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; } } //NotationSwitch