blob: d0e0f7e5ad97630208cc5f0894603bc64a6a7a1a [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2011 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
*******************************************************************************/
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.common.SanityChecker;
import org.eclipse.stem.core.logger.Logger;
import org.eclipse.stem.jobs.simulation.ISimulationListener;
import org.eclipse.stem.loggers.AsynchronousLogger;
import org.eclipse.stem.loggers.IdentifierProperty;
import org.eclipse.stem.loggers.SimulationLogger;
import org.eclipse.stem.loggers.SimulationLoggerEvent;
import org.eclipse.stem.loggers.SimulationLoggerPackage;
import org.eclipse.stem.loggers.SynchronousDecoratorPropertyLogger;
import org.eclipse.stem.loggers.SynchronousLogger;
/**
* <!-- 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> {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static final String copyright = "Copyright (c) 2011 IBM Corporation and others.\nAll rights reserved. This program and the accompanying materials\nare made available under the terms of the Eclipse Public License v1.0\nwhich accompanies this distribution, and is available at\nhttp://www.eclipse.org/legal/epl-v10.html\n\nContributors:\n IBM Corporation - initial API and implementation";
/**
* 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 = caseSanityChecker(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 = caseSanityChecker(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 = caseSanityChecker(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;
}
case SimulationLoggerPackage.SYNCHRONOUS_DECORATOR_PROPERTY_LOGGER: {
SynchronousDecoratorPropertyLogger synchronousDecoratorPropertyLogger = (SynchronousDecoratorPropertyLogger)theEObject;
T1 result = caseSynchronousDecoratorPropertyLogger(synchronousDecoratorPropertyLogger);
if (result == null) result = caseSynchronousLogger(synchronousDecoratorPropertyLogger);
if (result == null) result = caseSimulationLogger(synchronousDecoratorPropertyLogger);
if (result == null) result = caseLogger(synchronousDecoratorPropertyLogger);
if (result == null) result = caseIdentifiable(synchronousDecoratorPropertyLogger);
if (result == null) result = caseComparable(synchronousDecoratorPropertyLogger);
if (result == null) result = caseSanityChecker(synchronousDecoratorPropertyLogger);
if (result == null) result = defaultCase(theEObject);
return result;
}
case SimulationLoggerPackage.IDENTIFIER_PROPERTY: {
IdentifierProperty identifierProperty = (IdentifierProperty)theEObject;
T1 result = caseIdentifierProperty(identifierProperty);
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>Synchronous Decorator Property 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 Decorator Property Logger</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T1 caseSynchronousDecoratorPropertyLogger(SynchronousDecoratorPropertyLogger object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Identifier Property</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>Identifier Property</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T1 caseIdentifierProperty(IdentifierProperty 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>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>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