| package org.eclipse.stem.tests.util.labels.util; |
| |
| /******************************************************************************* |
| * Copyright (c) 2006 IBM Corporation and others. |
| * 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: |
| * IBM Corporation - initial API and implementation |
| *******************************************************************************/ |
| |
| import java.util.List; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.EObject; |
| import org.eclipse.stem.core.common.Identifiable; |
| import org.eclipse.stem.core.common.SanityChecker; |
| import org.eclipse.stem.core.graph.DynamicEdgeLabel; |
| import org.eclipse.stem.core.graph.DynamicLabel; |
| import org.eclipse.stem.core.graph.DynamicNodeLabel; |
| import org.eclipse.stem.core.graph.EdgeLabel; |
| import org.eclipse.stem.core.graph.Label; |
| import org.eclipse.stem.core.graph.LabelValue; |
| import org.eclipse.stem.core.graph.NodeLabel; |
| import org.eclipse.stem.core.graph.StaticEdgeLabel; |
| import org.eclipse.stem.core.graph.StaticLabel; |
| import org.eclipse.stem.core.graph.StaticNodeLabel; |
| import org.eclipse.stem.core.modifier.Modifiable; |
| import org.eclipse.stem.tests.util.labels.LabelsPackage; |
| import org.eclipse.stem.tests.util.labels.TestDynamicEdgeLabel; |
| import org.eclipse.stem.tests.util.labels.TestDynamicLabel1; |
| import org.eclipse.stem.tests.util.labels.TestDynamicNodeLabel; |
| import org.eclipse.stem.tests.util.labels.TestIntegerLabelValue; |
| import org.eclipse.stem.tests.util.labels.TestLabel; |
| import org.eclipse.stem.tests.util.labels.TestStaticEdgeLabel; |
| import org.eclipse.stem.tests.util.labels.TestStaticNodeLabel; |
| |
| |
| |
| /** |
| * <!-- 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.stem.tests.util.labels.LabelsPackage |
| * @generated |
| */ |
| public class LabelsSwitch<T1> { |
| /** |
| * The cached model package |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected static LabelsPackage modelPackage; |
| |
| /** |
| * Creates an instance of the switch. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public LabelsSwitch() { |
| if (modelPackage == null) { |
| modelPackage = LabelsPackage.eINSTANCE; |
| } |
| } |
| |
| /** |
| * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result. |
| * <!-- begin-user-doc --> |
| * |
| * @param theEObject |
| * @return the first non-null result returned by a <code>caseXXX</code> call. |
| * |
| * <!-- end-user-doc --> |
| * @return the first non-null result returned by a <code>caseXXX</code> call. |
| * @generated |
| */ |
| public T1 doSwitch(EObject theEObject) { |
| return doSwitch(theEObject.eClass(), theEObject); |
| } |
| |
| /** |
| * 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 |
| */ |
| protected T1 doSwitch(EClass theEClass, EObject theEObject) { |
| if (theEClass.eContainer() == modelPackage) { |
| return doSwitch(theEClass.getClassifierID(), theEObject); |
| } |
| else { |
| List<EClass> eSuperTypes = theEClass.getESuperTypes(); |
| return |
| eSuperTypes.isEmpty() ? |
| defaultCase(theEObject) : |
| doSwitch(eSuperTypes.get(0), theEObject); |
| } |
| } |
| |
| /** |
| * 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 |
| */ |
| protected T1 doSwitch(int classifierID, EObject theEObject) { |
| switch (classifierID) { |
| case LabelsPackage.TEST_DYNAMIC_EDGE_LABEL: { |
| TestDynamicEdgeLabel testDynamicEdgeLabel = (TestDynamicEdgeLabel)theEObject; |
| T1 result = caseTestDynamicEdgeLabel(testDynamicEdgeLabel); |
| if (result == null) result = caseDynamicEdgeLabel(testDynamicEdgeLabel); |
| if (result == null) result = caseDynamicLabel(testDynamicEdgeLabel); |
| if (result == null) result = caseEdgeLabel(testDynamicEdgeLabel); |
| if (result == null) result = caseLabel(testDynamicEdgeLabel); |
| if (result == null) result = caseIdentifiable(testDynamicEdgeLabel); |
| if (result == null) result = caseComparable(testDynamicEdgeLabel); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case LabelsPackage.TEST_DYNAMIC_LABEL1: { |
| TestDynamicLabel1 testDynamicLabel1 = (TestDynamicLabel1)theEObject; |
| T1 result = caseTestDynamicLabel1(testDynamicLabel1); |
| if (result == null) result = caseDynamicLabel(testDynamicLabel1); |
| if (result == null) result = caseLabel(testDynamicLabel1); |
| if (result == null) result = caseIdentifiable(testDynamicLabel1); |
| if (result == null) result = caseComparable(testDynamicLabel1); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case LabelsPackage.TEST_DYNAMIC_NODE_LABEL: { |
| TestDynamicNodeLabel testDynamicNodeLabel = (TestDynamicNodeLabel)theEObject; |
| T1 result = caseTestDynamicNodeLabel(testDynamicNodeLabel); |
| if (result == null) result = caseDynamicNodeLabel(testDynamicNodeLabel); |
| if (result == null) result = caseDynamicLabel(testDynamicNodeLabel); |
| if (result == null) result = caseNodeLabel(testDynamicNodeLabel); |
| if (result == null) result = caseLabel(testDynamicNodeLabel); |
| if (result == null) result = caseIdentifiable(testDynamicNodeLabel); |
| if (result == null) result = caseComparable(testDynamicNodeLabel); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case LabelsPackage.TEST_INTEGER_LABEL_VALUE: { |
| TestIntegerLabelValue testIntegerLabelValue = (TestIntegerLabelValue)theEObject; |
| T1 result = caseTestIntegerLabelValue(testIntegerLabelValue); |
| if (result == null) result = caseLabelValue(testIntegerLabelValue); |
| if (result == null) result = caseSanityChecker(testIntegerLabelValue); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case LabelsPackage.TEST_LABEL: { |
| TestLabel testLabel = (TestLabel)theEObject; |
| T1 result = caseTestLabel(testLabel); |
| if (result == null) result = caseLabel(testLabel); |
| if (result == null) result = caseIdentifiable(testLabel); |
| if (result == null) result = caseComparable(testLabel); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case LabelsPackage.TEST_STATIC_EDGE_LABEL: { |
| TestStaticEdgeLabel testStaticEdgeLabel = (TestStaticEdgeLabel)theEObject; |
| T1 result = caseTestStaticEdgeLabel(testStaticEdgeLabel); |
| if (result == null) result = caseStaticEdgeLabel(testStaticEdgeLabel); |
| if (result == null) result = caseEdgeLabel(testStaticEdgeLabel); |
| if (result == null) result = caseStaticLabel(testStaticEdgeLabel); |
| if (result == null) result = caseModifiable(testStaticEdgeLabel); |
| if (result == null) result = caseLabel(testStaticEdgeLabel); |
| if (result == null) result = caseIdentifiable(testStaticEdgeLabel); |
| if (result == null) result = caseComparable(testStaticEdgeLabel); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case LabelsPackage.TEST_STATIC_NODE_LABEL: { |
| TestStaticNodeLabel testStaticNodeLabel = (TestStaticNodeLabel)theEObject; |
| T1 result = caseTestStaticNodeLabel(testStaticNodeLabel); |
| if (result == null) result = caseStaticNodeLabel(testStaticNodeLabel); |
| if (result == null) result = caseNodeLabel(testStaticNodeLabel); |
| if (result == null) result = caseStaticLabel(testStaticNodeLabel); |
| if (result == null) result = caseModifiable(testStaticNodeLabel); |
| if (result == null) result = caseLabel(testStaticNodeLabel); |
| if (result == null) result = caseIdentifiable(testStaticNodeLabel); |
| if (result == null) result = caseComparable(testStaticNodeLabel); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| default: return defaultCase(theEObject); |
| } |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Test Dynamic Label1</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>Test Dynamic Label1</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T1 caseTestDynamicLabel1(TestDynamicLabel1 object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Test Integer Label 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>Test Integer Label Value</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T1 caseTestIntegerLabelValue(TestIntegerLabelValue object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Test Label</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>Test Label</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T1 caseTestLabel(TestLabel object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Test Static Node Label</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>Test Static Node Label</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T1 caseTestStaticNodeLabel(TestStaticNodeLabel object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Comparable</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>Comparable</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public <T> T1 caseComparable(Comparable<T> object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Test Dynamic Edge Label</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>Test Dynamic Edge Label</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T1 caseTestDynamicEdgeLabel(TestDynamicEdgeLabel object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Test Static Edge Label</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>Test Static Edge Label</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T1 caseTestStaticEdgeLabel(TestStaticEdgeLabel object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Test Dynamic Node Label</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>Test Dynamic Node Label</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T1 caseTestDynamicNodeLabel(TestDynamicNodeLabel object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Identifiable</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>Identifiable</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T1 caseIdentifiable(Identifiable object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Label</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>Label</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T1 caseLabel(Label object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Dynamic Label</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>Dynamic Label</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T1 caseDynamicLabel(DynamicLabel object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Label 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>Label Value</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T1 caseLabelValue(LabelValue object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Static Label</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>Static Label</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T1 caseStaticLabel(StaticLabel object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Modifiable</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>Modifiable</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T1 caseModifiable(Modifiable object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Node Label</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 Label</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T1 caseNodeLabel(NodeLabel object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Static Node Label</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>Static Node Label</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T1 caseStaticNodeLabel(StaticNodeLabel object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Edge Label</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 Label</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T1 caseEdgeLabel(EdgeLabel object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Dynamic Edge Label</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>Dynamic Edge Label</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T1 caseDynamicEdgeLabel(DynamicEdgeLabel object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Static Edge Label</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>Static Edge Label</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T1 caseStaticEdgeLabel(StaticEdgeLabel object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Dynamic Node Label</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>Dynamic Node Label</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T1 caseDynamicNodeLabel(DynamicNodeLabel object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Sanity Checker</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>Sanity Checker</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T1 caseSanityChecker(SanityChecker 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 |
| */ |
| public T1 defaultCase(EObject object) { |
| return null; |
| } |
| |
| } //LabelsSwitch |