blob: 32034e6795bec735d717d4415582f7d58f79be70 [file] [log] [blame]
/**
* <copyright>
* </copyright>
*
* $Id$
*/
package org.eclipse.stem.loggers.util;
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.logger.Logger;
import org.eclipse.stem.jobs.simulation.ISimulationListener;
import org.eclipse.stem.loggers.*;
/**
* <!-- 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.loggers.SimulationLoggerPackage
* @generated
*/
public class SimulationLoggerSwitch<T1> {
/**
* The cached model package
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected static SimulationLoggerPackage modelPackage;
/**
* Creates an instance of the switch.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public SimulationLoggerSwitch() {
if (modelPackage == null) {
modelPackage = SimulationLoggerPackage.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 -->
* <!-- 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 SimulationLoggerPackage.SIMULATION_LOGGER: {
SimulationLogger simulationLogger = (SimulationLogger)theEObject;
T1 result = caseSimulationLogger(simulationLogger);
if (result == null) result = caseLogger(simulationLogger);
if (result == null) result = caseIdentifiable(simulationLogger);
if (result == null) result = caseComparable(simulationLogger);
if (result == null) result = defaultCase(theEObject);
return result;
}
case SimulationLoggerPackage.SYNCHRONOUS_LOGGER: {
SynchronousLogger synchronousLogger = (SynchronousLogger)theEObject;
T1 result = caseSynchronousLogger(synchronousLogger);
if (result == null) result = caseSimulationLogger(synchronousLogger);
if (result == null) result = caseLogger(synchronousLogger);
if (result == null) result = caseIdentifiable(synchronousLogger);
if (result == null) result = caseComparable(synchronousLogger);
if (result == null) result = defaultCase(theEObject);
return result;
}
case SimulationLoggerPackage.ASYNCHRONOUS_LOGGER: {
AsynchronousLogger asynchronousLogger = (AsynchronousLogger)theEObject;
T1 result = caseAsynchronousLogger(asynchronousLogger);
if (result == null) result = caseSimulationLogger(asynchronousLogger);
if (result == null) result = caseLogger(asynchronousLogger);
if (result == null) result = caseIdentifiable(asynchronousLogger);
if (result == null) result = caseComparable(asynchronousLogger);
if (result == null) result = defaultCase(theEObject);
return result;
}
case SimulationLoggerPackage.SIMULATION_LOGGER_EVENT: {
SimulationLoggerEvent simulationLoggerEvent = (SimulationLoggerEvent)theEObject;
T1 result = caseSimulationLoggerEvent(simulationLoggerEvent);
if (result == null) result = defaultCase(theEObject);
return result;
}
default: return defaultCase(theEObject);
}
}
/**
* Returns the result of interpreting the object as an instance of '<em>Simulation Logger</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>Simulation Logger</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T1 caseSimulationLogger(SimulationLogger object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Synchronous Logger</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>Synchronous Logger</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T1 caseSynchronousLogger(SynchronousLogger object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>ISimulation Listener</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>ISimulation Listener</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T1 caseISimulationListener(ISimulationListener object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Asynchronous Logger</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>Asynchronous Logger</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T1 caseAsynchronousLogger(AsynchronousLogger object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Event</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>Event</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T1 caseSimulationLoggerEvent(SimulationLoggerEvent 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>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>Logger</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>Logger</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T1 caseLogger(Logger 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;
}
} //SimulationLoggerSwitch