blob: 7e1bbd335c1873fcb683ce92a3df46764eab04f4 [file] [log] [blame]
/**
* <copyright>
* </copyright>
*
* $Id: FleetSwitch.java,v 1.1 2008/04/17 11:33:39 mtaal Exp $
*/
package fleet.util;
import fleet.*;
import java.util.List;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import temporal.Temporal;
/**
* <!-- 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 fleet.FleetPackage
* @generated
*/
public class FleetSwitch {
/**
* The cached model package <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
protected static FleetPackage modelPackage;
/**
* Creates an instance of the switch. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public FleetSwitch() {
if (modelPackage == null) {
modelPackage = FleetPackage.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 Object 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 Object doSwitch(EClass theEClass, EObject theEObject) {
if (theEClass.eContainer() == modelPackage) {
return doSwitch(theEClass.getClassifierID(), theEObject);
} else {
List eSuperTypes = theEClass.getESuperTypes();
return eSuperTypes.isEmpty() ? defaultCase(theEObject) : doSwitch(
(EClass) 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 Object doSwitch(int classifierID, EObject theEObject) {
switch (classifierID) {
case FleetPackage.VEHICLE: {
Vehicle vehicle = (Vehicle) theEObject;
Object result = caseVehicle(vehicle);
if (result == null)
result = defaultCase(theEObject);
return result;
}
case FleetPackage.PERSON: {
Person person = (Person) theEObject;
Object result = casePerson(person);
if (result == null)
result = caseTemporal(person);
if (result == null)
result = defaultCase(theEObject);
return result;
}
case FleetPackage.ADDRESS: {
Address address = (Address) theEObject;
Object result = caseAddress(address);
if (result == null)
result = caseTemporal(address);
if (result == null)
result = defaultCase(theEObject);
return result;
}
case FleetPackage.VEHICLE_INFO: {
VehicleInfo vehicleInfo = (VehicleInfo) theEObject;
Object result = caseVehicleInfo(vehicleInfo);
if (result == null)
result = defaultCase(theEObject);
return result;
}
case FleetPackage.MANUFACTURING_PLANT: {
ManufacturingPlant manufacturingPlant = (ManufacturingPlant) theEObject;
Object result = caseManufacturingPlant(manufacturingPlant);
if (result == null)
result = defaultCase(theEObject);
return result;
}
case FleetPackage.FLEET: {
Fleet fleet = (Fleet) theEObject;
Object result = caseFleet(fleet);
if (result == null)
result = caseTemporal(fleet);
if (result == null)
result = defaultCase(theEObject);
return result;
}
case FleetPackage.GARAGE: {
Garage garage = (Garage) theEObject;
Object result = caseGarage(garage);
if (result == null)
result = caseTemporal(garage);
if (result == null)
result = defaultCase(theEObject);
return result;
}
case FleetPackage.TIRE: {
Tire tire = (Tire) theEObject;
Object result = caseTire(tire);
if (result == null)
result = defaultCase(theEObject);
return result;
}
case FleetPackage.HYBRID: {
Hybrid hybrid = (Hybrid) theEObject;
Object result = caseHybrid(hybrid);
if (result == null)
result = caseCar(hybrid);
if (result == null)
result = casePassengerVehicle(hybrid);
if (result == null)
result = caseVehicle(hybrid);
if (result == null)
result = caseTemporal(hybrid);
if (result == null)
result = defaultCase(theEObject);
return result;
}
case FleetPackage.CAR: {
Car car = (Car) theEObject;
Object result = caseCar(car);
if (result == null)
result = casePassengerVehicle(car);
if (result == null)
result = caseVehicle(car);
if (result == null)
result = caseTemporal(car);
if (result == null)
result = defaultCase(theEObject);
return result;
}
case FleetPackage.PASSENGER_VEHICLE: {
PassengerVehicle passengerVehicle = (PassengerVehicle) theEObject;
Object result = casePassengerVehicle(passengerVehicle);
if (result == null)
result = defaultCase(theEObject);
return result;
}
case FleetPackage.ENGINE_FACTORY: {
EngineFactory engineFactory = (EngineFactory) theEObject;
Object result = caseEngineFactory(engineFactory);
if (result == null)
result = caseManufacturingPlant(engineFactory);
if (result == null)
result = defaultCase(theEObject);
return result;
}
case FleetPackage.US_ADDRESS: {
USAddress usAddress = (USAddress) theEObject;
Object result = caseUSAddress(usAddress);
if (result == null)
result = caseAddress(usAddress);
if (result == null)
result = caseTemporal(usAddress);
if (result == null)
result = defaultCase(theEObject);
return result;
}
case FleetPackage.VIN: {
Vin vin = (Vin) theEObject;
Object result = caseVin(vin);
if (result == null)
result = defaultCase(theEObject);
return result;
}
case FleetPackage.TRANSPORTATION_DEVICE: {
TransportationDevice transportationDevice = (TransportationDevice) theEObject;
Object result = caseTransportationDevice(transportationDevice);
if (result == null)
result = defaultCase(theEObject);
return result;
}
default:
return defaultCase(theEObject);
}
}
/**
* Returns the result of interpreting the object as an instance of '<em>Vehicle</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>Vehicle</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public Object caseVehicle(Vehicle object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Person</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>Person</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public Object casePerson(Person object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Address</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>Address</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public Object caseAddress(Address object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Vehicle Info</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>Vehicle Info</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public Object caseVehicleInfo(VehicleInfo object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Manufacturing Plant</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>Manufacturing Plant</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public Object caseManufacturingPlant(ManufacturingPlant object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Fleet</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>Fleet</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public Object caseFleet(Fleet object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Garage</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>Garage</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public Object caseGarage(Garage object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Tire</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>Tire</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public Object caseTire(Tire object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Hybrid</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>Hybrid</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public Object caseHybrid(Hybrid object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Car</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>Car</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public Object caseCar(Car object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Passenger Vehicle</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>Passenger Vehicle</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public Object casePassengerVehicle(PassengerVehicle object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Engine Factory</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>Engine Factory</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public Object caseEngineFactory(EngineFactory object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>US Address</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>US Address</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public Object caseUSAddress(USAddress object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Vin</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>Vin</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public Object caseVin(Vin object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Transportation Device</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>Transportation Device</em>
* '.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public Object caseTransportationDevice(TransportationDevice object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Temporal</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>Temporal</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public Object caseTemporal(Temporal 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 Object defaultCase(EObject object) {
return null;
}
} // FleetSwitch