/******************************************************************************* | |
* CHESS core plugin | |
* | |
* Copyright (C) 2011-2015 | |
* Mälardalen University, Sweden | |
* | |
* | |
* 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-v20.html | |
*******************************************************************************/ | |
/** | |
*/ | |
package org.polarsys.chess.fla.flaxml.util; | |
import org.eclipse.emf.ecore.EObject; | |
import org.eclipse.emf.ecore.EPackage; | |
import org.eclipse.emf.ecore.util.Switch; | |
import org.polarsys.chess.fla.flaxml.Component; | |
import org.polarsys.chess.fla.flaxml.Components; | |
import org.polarsys.chess.fla.flaxml.CompositeComponent; | |
import org.polarsys.chess.fla.flaxml.Connection; | |
import org.polarsys.chess.fla.flaxml.Connections; | |
import org.polarsys.chess.fla.flaxml.DocumentRoot; | |
import org.polarsys.chess.fla.flaxml.Failure; | |
import org.polarsys.chess.fla.flaxml.FlaxmlPackage; | |
import org.polarsys.chess.fla.flaxml.FptcRules; | |
import org.polarsys.chess.fla.flaxml.InputPort; | |
import org.polarsys.chess.fla.flaxml.InputPorts; | |
import org.polarsys.chess.fla.flaxml.NamedElement; | |
import org.polarsys.chess.fla.flaxml.OutputPort; | |
import org.polarsys.chess.fla.flaxml.OutputPorts; | |
import org.polarsys.chess.fla.flaxml.RuleString; | |
import org.polarsys.chess.fla.flaxml.SimpleComponent; | |
/** | |
* <!-- 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.polarsys.chess.fla.flaxml.FlaxmlPackage | |
* @generated | |
*/ | |
public class FlaxmlSwitch<T> extends Switch<T> { | |
/** | |
* The cached model package | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
protected static FlaxmlPackage modelPackage; | |
/** | |
* Creates an instance of the switch. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public FlaxmlSwitch() { | |
if (modelPackage == null) { | |
modelPackage = FlaxmlPackage.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 FlaxmlPackage.COMPONENT: { | |
Component component = (Component)theEObject; | |
T result = caseComponent(component); | |
if (result == null) result = caseNamedElement(component); | |
if (result == null) result = defaultCase(theEObject); | |
return result; | |
} | |
case FlaxmlPackage.COMPONENTS: { | |
Components components = (Components)theEObject; | |
T result = caseComponents(components); | |
if (result == null) result = defaultCase(theEObject); | |
return result; | |
} | |
case FlaxmlPackage.COMPOSITE_COMPONENT: { | |
CompositeComponent compositeComponent = (CompositeComponent)theEObject; | |
T result = caseCompositeComponent(compositeComponent); | |
if (result == null) result = caseComponent(compositeComponent); | |
if (result == null) result = caseNamedElement(compositeComponent); | |
if (result == null) result = defaultCase(theEObject); | |
return result; | |
} | |
case FlaxmlPackage.CONNECTION: { | |
Connection connection = (Connection)theEObject; | |
T result = caseConnection(connection); | |
if (result == null) result = defaultCase(theEObject); | |
return result; | |
} | |
case FlaxmlPackage.CONNECTIONS: { | |
Connections connections = (Connections)theEObject; | |
T result = caseConnections(connections); | |
if (result == null) result = defaultCase(theEObject); | |
return result; | |
} | |
case FlaxmlPackage.DOCUMENT_ROOT: { | |
DocumentRoot documentRoot = (DocumentRoot)theEObject; | |
T result = caseDocumentRoot(documentRoot); | |
if (result == null) result = defaultCase(theEObject); | |
return result; | |
} | |
case FlaxmlPackage.FAILURE: { | |
Failure failure = (Failure)theEObject; | |
T result = caseFailure(failure); | |
if (result == null) result = defaultCase(theEObject); | |
return result; | |
} | |
case FlaxmlPackage.FPTC_RULES: { | |
FptcRules fptcRules = (FptcRules)theEObject; | |
T result = caseFptcRules(fptcRules); | |
if (result == null) result = defaultCase(theEObject); | |
return result; | |
} | |
case FlaxmlPackage.INPUT_PORT: { | |
InputPort inputPort = (InputPort)theEObject; | |
T result = caseInputPort(inputPort); | |
if (result == null) result = caseNamedElement(inputPort); | |
if (result == null) result = defaultCase(theEObject); | |
return result; | |
} | |
case FlaxmlPackage.INPUT_PORTS: { | |
InputPorts inputPorts = (InputPorts)theEObject; | |
T result = caseInputPorts(inputPorts); | |
if (result == null) result = defaultCase(theEObject); | |
return result; | |
} | |
case FlaxmlPackage.NAMED_ELEMENT: { | |
NamedElement namedElement = (NamedElement)theEObject; | |
T result = caseNamedElement(namedElement); | |
if (result == null) result = defaultCase(theEObject); | |
return result; | |
} | |
case FlaxmlPackage.OUTPUT_PORT: { | |
OutputPort outputPort = (OutputPort)theEObject; | |
T result = caseOutputPort(outputPort); | |
if (result == null) result = caseNamedElement(outputPort); | |
if (result == null) result = defaultCase(theEObject); | |
return result; | |
} | |
case FlaxmlPackage.OUTPUT_PORTS: { | |
OutputPorts outputPorts = (OutputPorts)theEObject; | |
T result = caseOutputPorts(outputPorts); | |
if (result == null) result = defaultCase(theEObject); | |
return result; | |
} | |
case FlaxmlPackage.RULE_STRING: { | |
RuleString ruleString = (RuleString)theEObject; | |
T result = caseRuleString(ruleString); | |
if (result == null) result = defaultCase(theEObject); | |
return result; | |
} | |
case FlaxmlPackage.SIMPLE_COMPONENT: { | |
SimpleComponent simpleComponent = (SimpleComponent)theEObject; | |
T result = caseSimpleComponent(simpleComponent); | |
if (result == null) result = caseComponent(simpleComponent); | |
if (result == null) result = caseNamedElement(simpleComponent); | |
if (result == null) result = defaultCase(theEObject); | |
return result; | |
} | |
case FlaxmlPackage.SYSTEM: { | |
org.polarsys.chess.fla.flaxml.System system = (org.polarsys.chess.fla.flaxml.System)theEObject; | |
T result = caseSystem(system); | |
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>Components</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>Components</em>'. | |
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | |
* @generated | |
*/ | |
public T caseComponents(Components object) { | |
return null; | |
} | |
/** | |
* Returns the result of interpreting the object as an instance of '<em>Composite 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>Composite Component</em>'. | |
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | |
* @generated | |
*/ | |
public T caseCompositeComponent(CompositeComponent object) { | |
return null; | |
} | |
/** | |
* Returns the result of interpreting the object as an instance of '<em>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>Connection</em>'. | |
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | |
* @generated | |
*/ | |
public T caseConnection(Connection object) { | |
return null; | |
} | |
/** | |
* Returns the result of interpreting the object as an instance of '<em>Connections</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>Connections</em>'. | |
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | |
* @generated | |
*/ | |
public T caseConnections(Connections object) { | |
return null; | |
} | |
/** | |
* Returns the result of interpreting the object as an instance of '<em>Document Root</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>Document Root</em>'. | |
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | |
* @generated | |
*/ | |
public T caseDocumentRoot(DocumentRoot object) { | |
return null; | |
} | |
/** | |
* Returns the result of interpreting the object as an instance of '<em>Failure</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>Failure</em>'. | |
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | |
* @generated | |
*/ | |
public T caseFailure(Failure object) { | |
return null; | |
} | |
/** | |
* Returns the result of interpreting the object as an instance of '<em>Fptc Rules</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>Fptc Rules</em>'. | |
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | |
* @generated | |
*/ | |
public T caseFptcRules(FptcRules object) { | |
return null; | |
} | |
/** | |
* Returns the result of interpreting the object as an instance of '<em>Input 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>Input Port</em>'. | |
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | |
* @generated | |
*/ | |
public T caseInputPort(InputPort object) { | |
return null; | |
} | |
/** | |
* Returns the result of interpreting the object as an instance of '<em>Input Ports</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>Input Ports</em>'. | |
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | |
* @generated | |
*/ | |
public T caseInputPorts(InputPorts 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>Output 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>Output Port</em>'. | |
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | |
* @generated | |
*/ | |
public T caseOutputPort(OutputPort object) { | |
return null; | |
} | |
/** | |
* Returns the result of interpreting the object as an instance of '<em>Output Ports</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>Output Ports</em>'. | |
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | |
* @generated | |
*/ | |
public T caseOutputPorts(OutputPorts object) { | |
return null; | |
} | |
/** | |
* Returns the result of interpreting the object as an instance of '<em>Rule String</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 String</em>'. | |
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | |
* @generated | |
*/ | |
public T caseRuleString(RuleString object) { | |
return null; | |
} | |
/** | |
* Returns the result of interpreting the object as an instance of '<em>Simple 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>Simple Component</em>'. | |
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | |
* @generated | |
*/ | |
public T caseSimpleComponent(SimpleComponent object) { | |
return null; | |
} | |
/** | |
* Returns the result of interpreting the object as an instance of '<em>System</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>System</em>'. | |
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | |
* @generated | |
*/ | |
public T caseSystem(org.polarsys.chess.fla.flaxml.System 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; | |
} | |
} //FlaxmlSwitch |