/** * <copyright> * </copyright> * * $Id: TimingDSwitch.java,v 1.1 2008/09/09 17:00:33 mgolubev Exp $ */ package org.eclipse.uml2.diagram.timing.model.timingd.util; import java.util.List; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EObject; import org.eclipse.uml2.diagram.timing.model.timingd.*; import org.eclipse.uml2.diagram.timing.model.timingd.DBlock; import org.eclipse.uml2.diagram.timing.model.timingd.DFrame; import org.eclipse.uml2.diagram.timing.model.timingd.DFrameContainer; import org.eclipse.uml2.diagram.timing.model.timingd.DInterval; import org.eclipse.uml2.diagram.timing.model.timingd.DMessage; import org.eclipse.uml2.diagram.timing.model.timingd.DPointConstraint; import org.eclipse.uml2.diagram.timing.model.timingd.DSegment; import org.eclipse.uml2.diagram.timing.model.timingd.DSegmentElement; import org.eclipse.uml2.diagram.timing.model.timingd.DSegmentEnd; import org.eclipse.uml2.diagram.timing.model.timingd.DSegmentMiddlePoint; import org.eclipse.uml2.diagram.timing.model.timingd.DSegmentStart; import org.eclipse.uml2.diagram.timing.model.timingd.DStateSwitch; import org.eclipse.uml2.diagram.timing.model.timingd.DValueLine; import org.eclipse.uml2.diagram.timing.model.timingd.TimingDPackage; import org.eclipse.uml2.uml.Constraint; import org.eclipse.uml2.uml.DurationConstraint; import org.eclipse.uml2.uml.Interaction; import org.eclipse.uml2.uml.Lifeline; import org.eclipse.uml2.uml.Message; import org.eclipse.uml2.uml.OccurrenceSpecification; import org.eclipse.uml2.uml.StateInvariant; /** * <!-- 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.uml2.diagram.timing.model.timingd.TimingDPackage * @generated */ public class TimingDSwitch<T> { /** * The cached model package * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected static TimingDPackage modelPackage; /** * Creates an instance of the switch. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public TimingDSwitch() { if (modelPackage == null) { modelPackage = TimingDPackage.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 T 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 T 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 T doSwitch(int classifierID, EObject theEObject) { switch (classifierID) { case TimingDPackage.DFRAME_CONTAINER: { DFrameContainer dFrameContainer = (DFrameContainer)theEObject; T result = caseDFrameContainer(dFrameContainer); if (result == null) result = defaultCase(theEObject); return result; } case TimingDPackage.DFRAME: { DFrame dFrame = (DFrame)theEObject; T result = caseDFrame(dFrame); if (result == null) result = defaultCase(theEObject); return result; } case TimingDPackage.DBLOCK: { DBlock dBlock = (DBlock)theEObject; T result = caseDBlock(dBlock); if (result == null) result = defaultCase(theEObject); return result; } case TimingDPackage.DVALUE_LINE: { DValueLine dValueLine = (DValueLine)theEObject; T result = caseDValueLine(dValueLine); if (result == null) result = defaultCase(theEObject); return result; } case TimingDPackage.DSEGMENT: { DSegment dSegment = (DSegment)theEObject; T result = caseDSegment(dSegment); if (result == null) result = defaultCase(theEObject); return result; } case TimingDPackage.DSEGMENT_ELEMENT: { DSegmentElement dSegmentElement = (DSegmentElement)theEObject; T result = caseDSegmentElement(dSegmentElement); if (result == null) result = defaultCase(theEObject); return result; } case TimingDPackage.DSEGMENT_MIDDLE_POINT: { DSegmentMiddlePoint dSegmentMiddlePoint = (DSegmentMiddlePoint)theEObject; T result = caseDSegmentMiddlePoint(dSegmentMiddlePoint); if (result == null) result = caseDSegmentElement(dSegmentMiddlePoint); if (result == null) result = defaultCase(theEObject); return result; } case TimingDPackage.DSEGMENT_START: { DSegmentStart dSegmentStart = (DSegmentStart)theEObject; T result = caseDSegmentStart(dSegmentStart); if (result == null) result = caseDSegmentElement(dSegmentStart); if (result == null) result = defaultCase(theEObject); return result; } case TimingDPackage.DSEGMENT_END: { DSegmentEnd dSegmentEnd = (DSegmentEnd)theEObject; T result = caseDSegmentEnd(dSegmentEnd); if (result == null) result = caseDSegmentElement(dSegmentEnd); if (result == null) result = defaultCase(theEObject); return result; } case TimingDPackage.DSTATE_SWITCH: { DStateSwitch dStateSwitch = (DStateSwitch)theEObject; T result = caseDStateSwitch(dStateSwitch); if (result == null) result = defaultCase(theEObject); return result; } case TimingDPackage.DMESSAGE: { DMessage dMessage = (DMessage)theEObject; T result = caseDMessage(dMessage); if (result == null) result = defaultCase(theEObject); return result; } case TimingDPackage.DINTERVAL: { DInterval dInterval = (DInterval)theEObject; T result = caseDInterval(dInterval); if (result == null) result = defaultCase(theEObject); return result; } case TimingDPackage.DPOINT_CONSTRAINT: { DPointConstraint dPointConstraint = (DPointConstraint)theEObject; T result = caseDPointConstraint(dPointConstraint); if (result == null) result = defaultCase(theEObject); return result; } case TimingDPackage.DTICK: { DTick dTick = (DTick)theEObject; T result = caseDTick(dTick); if (result == null) result = defaultCase(theEObject); return result; } default: return defaultCase(theEObject); } } /** * Returns the result of interpreting the object as an instance of '<em>DFrame Container</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>DFrame Container</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseDFrameContainer(DFrameContainer object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>DFrame</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>DFrame</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseDFrame(DFrame object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>DBlock</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>DBlock</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseDBlock(DBlock object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>DValue Line</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>DValue Line</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseDValueLine(DValueLine object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>DSegment</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>DSegment</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseDSegment(DSegment object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>DSegment 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>DSegment Element</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseDSegmentElement(DSegmentElement object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>DSegment Middle Point</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>DSegment Middle Point</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseDSegmentMiddlePoint(DSegmentMiddlePoint object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>DSegment Start</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>DSegment Start</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseDSegmentStart(DSegmentStart object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>DSegment End</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>DSegment End</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseDSegmentEnd(DSegmentEnd object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>DState Switch</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>DState Switch</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseDStateSwitch(DStateSwitch object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>DMessage</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>DMessage</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseDMessage(DMessage object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>DInterval</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>DInterval</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseDInterval(DInterval object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>DPoint Constraint</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>DPoint Constraint</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseDPointConstraint(DPointConstraint object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>DTick</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>DTick</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseDTick(DTick object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>UML Constraint</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>UML Constraint</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseUMLConstraint(Constraint object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>UML State Invariant</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>UML State Invariant</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseUMLStateInvariant(StateInvariant object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>UML Interaction</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>UML Interaction</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseUMLInteraction(Interaction object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>UML Package</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>UML Package</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseUMLPackage(org.eclipse.uml2.uml.Package object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>UML Lifeline</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>UML Lifeline</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseUMLLifeline(Lifeline object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>UML Occurrence Specification</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>UML Occurrence Specification</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseUMLOccurrenceSpecification(OccurrenceSpecification object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>UML Message</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>UML Message</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseUMLMessage(Message object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>UML Duration Constraint</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>UML Duration Constraint</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseUMLDurationConstraint(DurationConstraint 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 T defaultCase(EObject object) { return null; } } //TimingDSwitch