/**
* <copyright>
* </copyright>
*
* $Id$
*/
package net.sf.orcc.df.util;
import java.util.Map;
import net.sf.orcc.df.Action;
import net.sf.orcc.df.Actor;
import net.sf.orcc.df.Argument;
import net.sf.orcc.df.Connection;
import net.sf.orcc.df.DfPackage;
import net.sf.orcc.df.Entity;
import net.sf.orcc.df.FSM;
import net.sf.orcc.df.Instance;
import net.sf.orcc.df.Network;
import net.sf.orcc.df.Pattern;
import net.sf.orcc.df.Port;
import net.sf.orcc.df.State;
import net.sf.orcc.df.Tag;
import net.sf.orcc.df.Transition;
import net.sf.orcc.df.Unit;
import net.sf.orcc.graph.Edge;
import net.sf.orcc.graph.Graph;
import net.sf.orcc.graph.Vertex;
import net.sf.orcc.ir.Var;
import net.sf.orcc.util.Adaptable;
import net.sf.orcc.util.Attributable;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.util.Switch;
/**
* <!-- 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 net.sf.orcc.df.DfPackage
* @generated
*/
public class DfSwitch<T> extends Switch<T> {
/**
* The cached model package
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected static DfPackage modelPackage;
/**
* Creates an instance of the switch.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public DfSwitch() {
if (modelPackage == null) {
modelPackage = DfPackage.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 DfPackage.UNIT: {
Unit unit = (Unit) theEObject;
T result = caseUnit(unit);
if (result == null)
result = caseAttributable(unit);
if (result == null)
result = defaultCase(theEObject);
return result;
}
case DfPackage.PORT: {
Port port = (Port) theEObject;
T result = casePort(port);
if (result == null)
result = caseVertex(port);
if (result == null)
result = caseAttributable(port);
if (result == null)
result = caseAdaptable(port);
if (result == null)
result = defaultCase(theEObject);
return result;
}
case DfPackage.INSTANCE: {
Instance instance = (Instance) theEObject;
T result = caseInstance(instance);
if (result == null)
result = caseVertex(instance);
if (result == null)
result = caseAttributable(instance);
if (result == null)
result = caseAdaptable(instance);
if (result == null)
result = defaultCase(theEObject);
return result;
}
case DfPackage.ENTITY: {
Entity entity = (Entity) theEObject;
T result = caseEntity(entity);
if (result == null)
result = caseAttributable(entity);
if (result == null)
result = caseAdaptable(entity);
if (result == null)
result = defaultCase(theEObject);
return result;
}
case DfPackage.ACTOR: {
Actor actor = (Actor) theEObject;
T result = caseActor(actor);
if (result == null)
result = caseVertex(actor);
if (result == null)
result = caseAttributable(actor);
if (result == null)
result = caseAdaptable(actor);
if (result == null)
result = defaultCase(theEObject);
return result;
}
case DfPackage.NETWORK: {
Network network = (Network) theEObject;
T result = caseNetwork(network);
if (result == null)
result = caseGraph(network);
if (result == null)
result = caseVertex(network);
if (result == null)
result = caseAttributable(network);
if (result == null)
result = caseAdaptable(network);
if (result == null)
result = defaultCase(theEObject);
return result;
}
case DfPackage.CONNECTION: {
Connection connection = (Connection) theEObject;
T result = caseConnection(connection);
if (result == null)
result = caseEdge(connection);
if (result == null)
result = caseAttributable(connection);
if (result == null)
result = defaultCase(theEObject);
return result;
}
case DfPackage.ACTION: {
Action action = (Action) theEObject;
T result = caseAction(action);
if (result == null)
result = caseAttributable(action);
if (result == null)
result = defaultCase(theEObject);
return result;
}
case DfPackage.FSM: {
FSM fsm = (FSM) theEObject;
T result = caseFSM(fsm);
if (result == null)
result = caseGraph(fsm);
if (result == null)
result = caseVertex(fsm);
if (result == null)
result = caseAttributable(fsm);
if (result == null)
result = caseAdaptable(fsm);
if (result == null)
result = defaultCase(theEObject);
return result;
}
case DfPackage.PATTERN: {
Pattern pattern = (Pattern) theEObject;
T result = casePattern(pattern);
if (result == null)
result = defaultCase(theEObject);
return result;
}
case DfPackage.STATE: {
State state = (State) theEObject;
T result = caseState(state);
if (result == null)
result = caseVertex(state);
if (result == null)
result = caseAttributable(state);
if (result == null)
result = caseAdaptable(state);
if (result == null)
result = defaultCase(theEObject);
return result;
}
case DfPackage.TAG: {
Tag tag = (Tag) theEObject;
T result = caseTag(tag);
if (result == null)
result = defaultCase(theEObject);
return result;
}
case DfPackage.TRANSITION: {
Transition transition = (Transition) theEObject;
T result = caseTransition(transition);
if (result == null)
result = caseEdge(transition);
if (result == null)
result = caseAttributable(transition);
if (result == null)
result = defaultCase(theEObject);
return result;
}
case DfPackage.PORT_TO_EINTEGER_OBJECT_MAP_ENTRY: {
@SuppressWarnings("unchecked")
Map.Entry<Port, Integer> portToEIntegerObjectMapEntry = (Map.Entry<Port, Integer>) theEObject;
T result = casePortToEIntegerObjectMapEntry(portToEIntegerObjectMapEntry);
if (result == null)
result = defaultCase(theEObject);
return result;
}
case DfPackage.PORT_TO_VAR_MAP_ENTRY: {
@SuppressWarnings("unchecked")
Map.Entry<Port, Var> portToVarMapEntry = (Map.Entry<Port, Var>) theEObject;
T result = casePortToVarMapEntry(portToVarMapEntry);
if (result == null)
result = defaultCase(theEObject);
return result;
}
case DfPackage.VAR_TO_PORT_MAP_ENTRY: {
@SuppressWarnings("unchecked")
Map.Entry<Var, Port> varToPortMapEntry = (Map.Entry<Var, Port>) theEObject;
T result = caseVarToPortMapEntry(varToPortMapEntry);
if (result == null)
result = defaultCase(theEObject);
return result;
}
case DfPackage.ARGUMENT: {
Argument argument = (Argument) theEObject;
T result = caseArgument(argument);
if (result == null)
result = defaultCase(theEObject);
return result;
}
default:
return defaultCase(theEObject);
}
}
/**
* Returns the result of interpreting the object as an instance of '<em>Network</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>Network</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseNetwork(Network 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>Instance</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>Instance</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseInstance(Instance object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Entity</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>Entity</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseEntity(Entity object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Vertex</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>Vertex</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseVertex(Vertex object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Adaptable</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>Adaptable</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseAdaptable(Adaptable 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>Action</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>Action</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseAction(Action object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Actor</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>Actor</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseActor(Actor object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>FSM</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>FSM</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseFSM(FSM object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Pattern</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>Pattern</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T casePattern(Pattern 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>State</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>State</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseState(State object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Tag</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>Tag</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseTag(Tag object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Transition</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>Transition</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseTransition(Transition object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Port To EInteger Object Map Entry</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 To EInteger Object Map Entry</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T casePortToEIntegerObjectMapEntry(Map.Entry<Port, Integer> object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Port To Var Map Entry</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 To Var Map Entry</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T casePortToVarMapEntry(Map.Entry<Port, Var> object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Var To Port Map Entry</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>Var To Port Map Entry</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseVarToPortMapEntry(Map.Entry<Var, Port> object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Argument</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>Argument</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseArgument(Argument object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Attributable</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>Attributable</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseAttributable(Attributable 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>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>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;
}
} //DfSwitch