From 09b1255f11ee17828da706f682e33f50316887fe Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Mon, 6 May 2019 18:42:22 -0400 Subject: Trying to implement spacecraft case study --- .../satellite/util/SatelliteAdapterFactory.java | 328 ++++++++++++++++++ .../ecore-gen/satellite/util/SatelliteSwitch.java | 374 +++++++++++++++++++++ 2 files changed, 702 insertions(+) create mode 100644 Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/util/SatelliteAdapterFactory.java create mode 100644 Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/util/SatelliteSwitch.java (limited to 'Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/util') diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/util/SatelliteAdapterFactory.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/util/SatelliteAdapterFactory.java new file mode 100644 index 00000000..1ecf7b19 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/util/SatelliteAdapterFactory.java @@ -0,0 +1,328 @@ +/** + */ +package satellite.util; + +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notifier; + +import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; + +import org.eclipse.emf.ecore.EObject; + +import satellite.*; + +/** + * + * The Adapter Factory for the model. + * It provides an adapter createXXX method for each class of the model. + * + * @see satellite.SatellitePackage + * @generated + */ +public class SatelliteAdapterFactory extends AdapterFactoryImpl { + /** + * The cached model package. + * + * + * @generated + */ + protected static SatellitePackage modelPackage; + + /** + * Creates an instance of the adapter factory. + * + * + * @generated + */ + public SatelliteAdapterFactory() { + if (modelPackage == null) { + modelPackage = SatellitePackage.eINSTANCE; + } + } + + /** + * Returns whether this factory is applicable for the type of the object. + * + * This implementation returns true if the object is either the model's package or is an instance object of the model. + * + * @return whether this factory is applicable for the type of the object. + * @generated + */ + @Override + public boolean isFactoryForType(Object object) { + if (object == modelPackage) { + return true; + } + if (object instanceof EObject) { + return ((EObject) object).eClass().getEPackage() == modelPackage; + } + return false; + } + + /** + * The switch that delegates to the createXXX methods. + * + * + * @generated + */ + protected SatelliteSwitch modelSwitch = new SatelliteSwitch() { + @Override + public Adapter caseConstellationMission(ConstellationMission object) { + return createConstellationMissionAdapter(); + } + + @Override + public Adapter caseInterferometryMission(InterferometryMission object) { + return createInterferometryMissionAdapter(); + } + + @Override + public Adapter caseCommunicatingElement(CommunicatingElement object) { + return createCommunicatingElementAdapter(); + } + + @Override + public Adapter caseGroundStationNetwork(GroundStationNetwork object) { + return createGroundStationNetworkAdapter(); + } + + @Override + public Adapter caseSpacecraft(Spacecraft object) { + return createSpacecraftAdapter(); + } + + @Override + public Adapter caseCommSubsystem(CommSubsystem object) { + return createCommSubsystemAdapter(); + } + + @Override + public Adapter caseDirectedCommunicationLink(DirectedCommunicationLink object) { + return createDirectedCommunicationLinkAdapter(); + } + + @Override + public Adapter casePayload(Payload object) { + return createPayloadAdapter(); + } + + @Override + public Adapter caseInterferometryPayload(InterferometryPayload object) { + return createInterferometryPayloadAdapter(); + } + + @Override + public Adapter caseCubeSat3U(CubeSat3U object) { + return createCubeSat3UAdapter(); + } + + @Override + public Adapter caseCubeSat6U(CubeSat6U object) { + return createCubeSat6UAdapter(); + } + + @Override + public Adapter caseSmallSat(SmallSat object) { + return createSmallSatAdapter(); + } + + @Override + public Adapter defaultCase(EObject object) { + return createEObjectAdapter(); + } + }; + + /** + * Creates an adapter for the target. + * + * + * @param target the object to adapt. + * @return the adapter for the target. + * @generated + */ + @Override + public Adapter createAdapter(Notifier target) { + return modelSwitch.doSwitch((EObject) target); + } + + /** + * Creates a new adapter for an object of class '{@link satellite.ConstellationMission Constellation Mission}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see satellite.ConstellationMission + * @generated + */ + public Adapter createConstellationMissionAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link satellite.InterferometryMission Interferometry Mission}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see satellite.InterferometryMission + * @generated + */ + public Adapter createInterferometryMissionAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link satellite.CommunicatingElement Communicating Element}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see satellite.CommunicatingElement + * @generated + */ + public Adapter createCommunicatingElementAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link satellite.GroundStationNetwork Ground Station Network}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see satellite.GroundStationNetwork + * @generated + */ + public Adapter createGroundStationNetworkAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link satellite.Spacecraft Spacecraft}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see satellite.Spacecraft + * @generated + */ + public Adapter createSpacecraftAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link satellite.CommSubsystem Comm Subsystem}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see satellite.CommSubsystem + * @generated + */ + public Adapter createCommSubsystemAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link satellite.DirectedCommunicationLink Directed Communication Link}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see satellite.DirectedCommunicationLink + * @generated + */ + public Adapter createDirectedCommunicationLinkAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link satellite.Payload Payload}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see satellite.Payload + * @generated + */ + public Adapter createPayloadAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link satellite.InterferometryPayload Interferometry Payload}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see satellite.InterferometryPayload + * @generated + */ + public Adapter createInterferometryPayloadAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link satellite.CubeSat3U Cube Sat3 U}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see satellite.CubeSat3U + * @generated + */ + public Adapter createCubeSat3UAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link satellite.CubeSat6U Cube Sat6 U}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see satellite.CubeSat6U + * @generated + */ + public Adapter createCubeSat6UAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link satellite.SmallSat Small Sat}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see satellite.SmallSat + * @generated + */ + public Adapter createSmallSatAdapter() { + return null; + } + + /** + * Creates a new adapter for the default case. + * + * This default implementation returns null. + * + * @return the new adapter. + * @generated + */ + public Adapter createEObjectAdapter() { + return null; + } + +} //SatelliteAdapterFactory diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/util/SatelliteSwitch.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/util/SatelliteSwitch.java new file mode 100644 index 00000000..3eb78d75 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/util/SatelliteSwitch.java @@ -0,0 +1,374 @@ +/** + */ +package satellite.util; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.util.Switch; + +import satellite.*; + +/** + * + * The Switch for the model's inheritance hierarchy. + * It supports the call {@link #doSwitch(EObject) doSwitch(object)} + * to invoke the caseXXX 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. + * + * @see satellite.SatellitePackage + * @generated + */ +public class SatelliteSwitch extends Switch { + /** + * The cached model package + * + * + * @generated + */ + protected static SatellitePackage modelPackage; + + /** + * Creates an instance of the switch. + * + * + * @generated + */ + public SatelliteSwitch() { + if (modelPackage == null) { + modelPackage = SatellitePackage.eINSTANCE; + } + } + + /** + * Checks whether this is a switch for the given package. + * + * + * @param 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 caseXXX for each class of the model until one returns a non null result; it yields that result. + * + * + * @return the first non-null result returned by a caseXXX call. + * @generated + */ + @Override + protected T doSwitch(int classifierID, EObject theEObject) { + switch (classifierID) { + case SatellitePackage.CONSTELLATION_MISSION: { + ConstellationMission constellationMission = (ConstellationMission) theEObject; + T result = caseConstellationMission(constellationMission); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case SatellitePackage.INTERFEROMETRY_MISSION: { + InterferometryMission interferometryMission = (InterferometryMission) theEObject; + T result = caseInterferometryMission(interferometryMission); + if (result == null) + result = caseConstellationMission(interferometryMission); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case SatellitePackage.COMMUNICATING_ELEMENT: { + CommunicatingElement communicatingElement = (CommunicatingElement) theEObject; + T result = caseCommunicatingElement(communicatingElement); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case SatellitePackage.GROUND_STATION_NETWORK: { + GroundStationNetwork groundStationNetwork = (GroundStationNetwork) theEObject; + T result = caseGroundStationNetwork(groundStationNetwork); + if (result == null) + result = caseCommunicatingElement(groundStationNetwork); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case SatellitePackage.SPACECRAFT: { + Spacecraft spacecraft = (Spacecraft) theEObject; + T result = caseSpacecraft(spacecraft); + if (result == null) + result = caseCommunicatingElement(spacecraft); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case SatellitePackage.COMM_SUBSYSTEM: { + CommSubsystem commSubsystem = (CommSubsystem) theEObject; + T result = caseCommSubsystem(commSubsystem); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case SatellitePackage.DIRECTED_COMMUNICATION_LINK: { + DirectedCommunicationLink directedCommunicationLink = (DirectedCommunicationLink) theEObject; + T result = caseDirectedCommunicationLink(directedCommunicationLink); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case SatellitePackage.PAYLOAD: { + Payload payload = (Payload) theEObject; + T result = casePayload(payload); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case SatellitePackage.INTERFEROMETRY_PAYLOAD: { + InterferometryPayload interferometryPayload = (InterferometryPayload) theEObject; + T result = caseInterferometryPayload(interferometryPayload); + if (result == null) + result = casePayload(interferometryPayload); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case SatellitePackage.CUBE_SAT3_U: { + CubeSat3U cubeSat3U = (CubeSat3U) theEObject; + T result = caseCubeSat3U(cubeSat3U); + if (result == null) + result = caseSpacecraft(cubeSat3U); + if (result == null) + result = caseCommunicatingElement(cubeSat3U); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case SatellitePackage.CUBE_SAT6_U: { + CubeSat6U cubeSat6U = (CubeSat6U) theEObject; + T result = caseCubeSat6U(cubeSat6U); + if (result == null) + result = caseSpacecraft(cubeSat6U); + if (result == null) + result = caseCommunicatingElement(cubeSat6U); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case SatellitePackage.SMALL_SAT: { + SmallSat smallSat = (SmallSat) theEObject; + T result = caseSmallSat(smallSat); + if (result == null) + result = caseSpacecraft(smallSat); + if (result == null) + result = caseCommunicatingElement(smallSat); + if (result == null) + result = defaultCase(theEObject); + return result; + } + default: + return defaultCase(theEObject); + } + } + + /** + * Returns the result of interpreting the object as an instance of 'Constellation Mission'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Constellation Mission'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseConstellationMission(ConstellationMission object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Interferometry Mission'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Interferometry Mission'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseInterferometryMission(InterferometryMission object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Communicating Element'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Communicating Element'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseCommunicatingElement(CommunicatingElement object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Ground Station Network'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Ground Station Network'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseGroundStationNetwork(GroundStationNetwork object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Spacecraft'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Spacecraft'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseSpacecraft(Spacecraft object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Comm Subsystem'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Comm Subsystem'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseCommSubsystem(CommSubsystem object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Directed Communication Link'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Directed Communication Link'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseDirectedCommunicationLink(DirectedCommunicationLink object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Payload'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Payload'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T casePayload(Payload object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Interferometry Payload'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Interferometry Payload'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseInterferometryPayload(InterferometryPayload object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Cube Sat3 U'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Cube Sat3 U'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseCubeSat3U(CubeSat3U object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Cube Sat6 U'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Cube Sat6 U'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseCubeSat6U(CubeSat6U object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Small Sat'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Small Sat'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseSmallSat(SmallSat object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'EObject'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch, but this is the last case anyway. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'EObject'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) + * @generated + */ + @Override + public T defaultCase(EObject object) { + return null; + } + +} //SatelliteSwitch -- cgit v1.2.3-70-g09d2