| 1 | /** |
| 2 | * Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany |
| 3 | * |
| 4 | * $Id$ |
| 5 | */ |
| 6 | package de.uka.ipd.sdq.pcm.seff.impl; |
| 7 | |
| 8 | import de.uka.ipd.sdq.identifier.impl.IdentifierImpl; |
| 9 | import java.util.Collection; |
| 10 | import java.util.Map; |
| 11 | |
| 12 | import org.eclipse.emf.common.notify.Notification; |
| 13 | import org.eclipse.emf.common.notify.NotificationChain; |
| 14 | import org.eclipse.emf.common.util.BasicDiagnostic; |
| 15 | import org.eclipse.emf.common.util.Diagnostic; |
| 16 | import org.eclipse.emf.common.util.DiagnosticChain; |
| 17 | import org.eclipse.emf.common.util.EList; |
| 18 | import org.eclipse.emf.ecore.EClass; |
| 19 | import org.eclipse.emf.ecore.InternalEObject; |
| 20 | import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| 21 | import org.eclipse.emf.ecore.impl.EObjectImpl; |
| 22 | import org.eclipse.emf.ecore.plugin.EcorePlugin; |
| 23 | import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList; |
| 24 | import org.eclipse.emf.ecore.util.EObjectValidator; |
| 25 | import org.eclipse.emf.ecore.util.EcoreUtil; |
| 26 | import org.eclipse.emf.ecore.util.InternalEList; |
| 27 | import org.eclipse.ocl.ParserException; |
| 28 | import org.eclipse.ocl.ecore.Constraint; |
| 29 | import org.eclipse.ocl.ecore.OCL; |
| 30 | |
| 31 | import de.uka.ipd.sdq.pcm.seff.AbstractAction; |
| 32 | import de.uka.ipd.sdq.pcm.seff.AbstractBranchTransition; |
| 33 | import de.uka.ipd.sdq.pcm.seff.AbstractLoopAction; |
| 34 | import de.uka.ipd.sdq.pcm.seff.ResourceDemandingBehaviour; |
| 35 | import de.uka.ipd.sdq.pcm.seff.SeffPackage; |
| 36 | import de.uka.ipd.sdq.pcm.seff.util.SeffValidator; |
| 37 | |
| 38 | /** |
| 39 | * <!-- begin-user-doc --> |
| 40 | * An implementation of the model object '<em><b>Resource Demanding Behaviour</b></em>'. |
| 41 | * <!-- end-user-doc --> |
| 42 | * <p> |
| 43 | * The following features are implemented: |
| 44 | * <ul> |
| 45 | * <li>{@link de.uka.ipd.sdq.pcm.seff.impl.ResourceDemandingBehaviourImpl#getAbstractLoopAction_ResourceDemandingBehaviour <em>Abstract Loop Action Resource Demanding Behaviour</em>}</li> |
| 46 | * <li>{@link de.uka.ipd.sdq.pcm.seff.impl.ResourceDemandingBehaviourImpl#getAbstractBranchTransition_ResourceDemandingBehaviour <em>Abstract Branch Transition Resource Demanding Behaviour</em>}</li> |
| 47 | * <li>{@link de.uka.ipd.sdq.pcm.seff.impl.ResourceDemandingBehaviourImpl#getSteps_Behaviour <em>Steps Behaviour</em>}</li> |
| 48 | * </ul> |
| 49 | * </p> |
| 50 | * |
| 51 | * @generated |
| 52 | */ |
| 53 | public class ResourceDemandingBehaviourImpl extends IdentifierImpl implements ResourceDemandingBehaviour { |
| 54 | /** |
| 55 | * <!-- begin-user-doc --> |
| 56 | * <!-- end-user-doc --> |
| 57 | * @generated |
| 58 | */ |
| 59 | public static final String copyright = "Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany"; |
| 60 | |
| 61 | /** |
| 62 | * The cached value of the '{@link #getSteps_Behaviour() <em>Steps Behaviour</em>}' containment reference list. |
| 63 | * <!-- begin-user-doc --> |
| 64 | * <!-- end-user-doc --> |
| 65 | * @see #getSteps_Behaviour() |
| 66 | * @generated |
| 67 | * @ordered |
| 68 | */ |
| 69 | protected EList<AbstractAction> steps_Behaviour; |
| 70 | |
| 71 | /** |
| 72 | * <!-- begin-user-doc --> |
| 73 | * <!-- end-user-doc --> |
| 74 | * @generated |
| 75 | */ |
| 76 | protected ResourceDemandingBehaviourImpl() { |
| 77 | super(); |
| 78 | } |
| 79 | |
| 80 | /** |
| 81 | * <!-- begin-user-doc --> |
| 82 | * <!-- end-user-doc --> |
| 83 | * @generated |
| 84 | */ |
| 85 | @Override |
| 86 | protected EClass eStaticClass() { |
| 87 | return SeffPackage.Literals.RESOURCE_DEMANDING_BEHAVIOUR; |
| 88 | } |
| 89 | |
| 90 | /** |
| 91 | * <!-- begin-user-doc --> |
| 92 | * <!-- end-user-doc --> |
| 93 | * @generated |
| 94 | */ |
| 95 | public AbstractLoopAction getAbstractLoopAction_ResourceDemandingBehaviour() { |
| 96 | if (eContainerFeatureID() != SeffPackage.RESOURCE_DEMANDING_BEHAVIOUR__ABSTRACT_LOOP_ACTION_RESOURCE_DEMANDING_BEHAVIOUR) return null; |
| 97 | return (AbstractLoopAction)eContainer(); |
| 98 | } |
| 99 | |
| 100 | /** |
| 101 | * <!-- begin-user-doc --> |
| 102 | * <!-- end-user-doc --> |
| 103 | * @generated |
| 104 | */ |
| 105 | public NotificationChain basicSetAbstractLoopAction_ResourceDemandingBehaviour(AbstractLoopAction newAbstractLoopAction_ResourceDemandingBehaviour, NotificationChain msgs) { |
| 106 | msgs = eBasicSetContainer((InternalEObject)newAbstractLoopAction_ResourceDemandingBehaviour, SeffPackage.RESOURCE_DEMANDING_BEHAVIOUR__ABSTRACT_LOOP_ACTION_RESOURCE_DEMANDING_BEHAVIOUR, msgs); |
| 107 | return msgs; |
| 108 | } |
| 109 | |
| 110 | /** |
| 111 | * <!-- begin-user-doc --> |
| 112 | * <!-- end-user-doc --> |
| 113 | * @generated |
| 114 | */ |
| 115 | public void setAbstractLoopAction_ResourceDemandingBehaviour(AbstractLoopAction newAbstractLoopAction_ResourceDemandingBehaviour) { |
| 116 | if (newAbstractLoopAction_ResourceDemandingBehaviour != eInternalContainer() || (eContainerFeatureID() != SeffPackage.RESOURCE_DEMANDING_BEHAVIOUR__ABSTRACT_LOOP_ACTION_RESOURCE_DEMANDING_BEHAVIOUR && newAbstractLoopAction_ResourceDemandingBehaviour != null)) { |
| 117 | if (EcoreUtil.isAncestor(this, newAbstractLoopAction_ResourceDemandingBehaviour)) |
| 118 | throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); |
| 119 | NotificationChain msgs = null; |
| 120 | if (eInternalContainer() != null) |
| 121 | msgs = eBasicRemoveFromContainer(msgs); |
| 122 | if (newAbstractLoopAction_ResourceDemandingBehaviour != null) |
| 123 | msgs = ((InternalEObject)newAbstractLoopAction_ResourceDemandingBehaviour).eInverseAdd(this, SeffPackage.ABSTRACT_LOOP_ACTION__BODY_BEHAVIOUR_LOOP, AbstractLoopAction.class, msgs); |
| 124 | msgs = basicSetAbstractLoopAction_ResourceDemandingBehaviour(newAbstractLoopAction_ResourceDemandingBehaviour, msgs); |
| 125 | if (msgs != null) msgs.dispatch(); |
| 126 | } |
| 127 | else if (eNotificationRequired()) |
| 128 | eNotify(new ENotificationImpl(this, Notification.SET, SeffPackage.RESOURCE_DEMANDING_BEHAVIOUR__ABSTRACT_LOOP_ACTION_RESOURCE_DEMANDING_BEHAVIOUR, newAbstractLoopAction_ResourceDemandingBehaviour, newAbstractLoopAction_ResourceDemandingBehaviour)); |
| 129 | } |
| 130 | |
| 131 | /** |
| 132 | * <!-- begin-user-doc --> |
| 133 | * <!-- end-user-doc --> |
| 134 | * @generated |
| 135 | */ |
| 136 | public AbstractBranchTransition getAbstractBranchTransition_ResourceDemandingBehaviour() { |
| 137 | if (eContainerFeatureID() != SeffPackage.RESOURCE_DEMANDING_BEHAVIOUR__ABSTRACT_BRANCH_TRANSITION_RESOURCE_DEMANDING_BEHAVIOUR) return null; |
| 138 | return (AbstractBranchTransition)eContainer(); |
| 139 | } |
| 140 | |
| 141 | /** |
| 142 | * <!-- begin-user-doc --> |
| 143 | * <!-- end-user-doc --> |
| 144 | * @generated |
| 145 | */ |
| 146 | public NotificationChain basicSetAbstractBranchTransition_ResourceDemandingBehaviour(AbstractBranchTransition newAbstractBranchTransition_ResourceDemandingBehaviour, NotificationChain msgs) { |
| 147 | msgs = eBasicSetContainer((InternalEObject)newAbstractBranchTransition_ResourceDemandingBehaviour, SeffPackage.RESOURCE_DEMANDING_BEHAVIOUR__ABSTRACT_BRANCH_TRANSITION_RESOURCE_DEMANDING_BEHAVIOUR, msgs); |
| 148 | return msgs; |
| 149 | } |
| 150 | |
| 151 | /** |
| 152 | * <!-- begin-user-doc --> |
| 153 | * <!-- end-user-doc --> |
| 154 | * @generated |
| 155 | */ |
| 156 | public void setAbstractBranchTransition_ResourceDemandingBehaviour(AbstractBranchTransition newAbstractBranchTransition_ResourceDemandingBehaviour) { |
| 157 | if (newAbstractBranchTransition_ResourceDemandingBehaviour != eInternalContainer() || (eContainerFeatureID() != SeffPackage.RESOURCE_DEMANDING_BEHAVIOUR__ABSTRACT_BRANCH_TRANSITION_RESOURCE_DEMANDING_BEHAVIOUR && newAbstractBranchTransition_ResourceDemandingBehaviour != null)) { |
| 158 | if (EcoreUtil.isAncestor(this, newAbstractBranchTransition_ResourceDemandingBehaviour)) |
| 159 | throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); |
| 160 | NotificationChain msgs = null; |
| 161 | if (eInternalContainer() != null) |
| 162 | msgs = eBasicRemoveFromContainer(msgs); |
| 163 | if (newAbstractBranchTransition_ResourceDemandingBehaviour != null) |
| 164 | msgs = ((InternalEObject)newAbstractBranchTransition_ResourceDemandingBehaviour).eInverseAdd(this, SeffPackage.ABSTRACT_BRANCH_TRANSITION__BRANCH_BEHAVIOUR_BRANCH_TRANSITION, AbstractBranchTransition.class, msgs); |
| 165 | msgs = basicSetAbstractBranchTransition_ResourceDemandingBehaviour(newAbstractBranchTransition_ResourceDemandingBehaviour, msgs); |
| 166 | if (msgs != null) msgs.dispatch(); |
| 167 | } |
| 168 | else if (eNotificationRequired()) |
| 169 | eNotify(new ENotificationImpl(this, Notification.SET, SeffPackage.RESOURCE_DEMANDING_BEHAVIOUR__ABSTRACT_BRANCH_TRANSITION_RESOURCE_DEMANDING_BEHAVIOUR, newAbstractBranchTransition_ResourceDemandingBehaviour, newAbstractBranchTransition_ResourceDemandingBehaviour)); |
| 170 | } |
| 171 | |
| 172 | /** |
| 173 | * <!-- begin-user-doc --> |
| 174 | * <!-- end-user-doc --> |
| 175 | * @generated |
| 176 | */ |
| 177 | public EList<AbstractAction> getSteps_Behaviour() { |
| 178 | if (steps_Behaviour == null) { |
| 179 | steps_Behaviour = new EObjectContainmentWithInverseEList<AbstractAction>(AbstractAction.class, this, SeffPackage.RESOURCE_DEMANDING_BEHAVIOUR__STEPS_BEHAVIOUR, SeffPackage.ABSTRACT_ACTION__RESOURCE_DEMANDING_BEHAVIOUR_ABSTRACT_ACTION); |
| 180 | } |
| 181 | return steps_Behaviour; |
| 182 | } |
| 183 | |
| 184 | /** |
| 185 | * The cached OCL expression body for the '{@link #ExactlyOneStopAction(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Exactly One Stop Action</em>}' operation. |
| 186 | * <!-- begin-user-doc --> |
| 187 | * <!-- end-user-doc --> |
| 188 | * @see #ExactlyOneStopAction(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) |
| 189 | * @generated |
| 190 | * @ordered |
| 191 | */ |
| 192 | protected static final String EXACTLY_ONE_STOP_ACTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP = "self.steps_Behaviour->select(s|s.oclIsTypeOf(StopAction))->size() = 1"; |
| 193 | |
| 194 | /** |
| 195 | * The cached OCL invariant for the '{@link #ExactlyOneStopAction(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Exactly One Stop Action</em>}' invariant operation. |
| 196 | * <!-- begin-user-doc --> |
| 197 | * <!-- end-user-doc --> |
| 198 | * @see #ExactlyOneStopAction(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) |
| 199 | * @generated |
| 200 | * @ordered |
| 201 | */ |
| 202 | protected static Constraint EXACTLY_ONE_STOP_ACTION__DIAGNOSTIC_CHAIN_MAP__EOCL_INV; |
| 203 | |
| 204 | /** |
| 205 | * <!-- begin-user-doc --> |
| 206 | * <!-- end-user-doc --> |
| 207 | * @generated |
| 208 | */ |
| 209 | public boolean ExactlyOneStopAction(DiagnosticChain diagnostics, Map<Object, Object> context) { |
| 210 | if (EXACTLY_ONE_STOP_ACTION__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) { |
| 211 | OCL.Helper helper = EOCL_ENV.createOCLHelper(); |
| 212 | helper.setContext(SeffPackage.Literals.RESOURCE_DEMANDING_BEHAVIOUR); |
| 213 | try { |
| 214 | EXACTLY_ONE_STOP_ACTION__DIAGNOSTIC_CHAIN_MAP__EOCL_INV = helper.createInvariant(EXACTLY_ONE_STOP_ACTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP); |
| 215 | } |
| 216 | catch (ParserException pe) { |
| 217 | throw new UnsupportedOperationException(pe.getLocalizedMessage()); |
| 218 | } |
| 219 | } |
| 220 | if (!EOCL_ENV.createQuery(EXACTLY_ONE_STOP_ACTION__DIAGNOSTIC_CHAIN_MAP__EOCL_INV).check(this)) { |
| 221 | if (diagnostics != null) { |
| 222 | diagnostics.add |
| 223 | (new BasicDiagnostic |
| 224 | (Diagnostic.ERROR, |
| 225 | SeffValidator.DIAGNOSTIC_SOURCE, |
| 226 | SeffValidator.RESOURCE_DEMANDING_BEHAVIOUR__EXACTLY_ONE_STOP_ACTION, |
| 227 | EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "ExactlyOneStopAction", EObjectValidator.getObjectLabel(this, context) }), |
| 228 | new Object [] { this })); |
| 229 | } |
| 230 | return false; |
| 231 | } |
| 232 | return true; |
| 233 | } |
| 234 | |
| 235 | /** |
| 236 | * The cached OCL expression body for the '{@link #ExactlyOneStartAction(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Exactly One Start Action</em>}' operation. |
| 237 | * <!-- begin-user-doc --> |
| 238 | * <!-- end-user-doc --> |
| 239 | * @see #ExactlyOneStartAction(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) |
| 240 | * @generated |
| 241 | * @ordered |
| 242 | */ |
| 243 | protected static final String EXACTLY_ONE_START_ACTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP = "self.steps_Behaviour->select(s|s.oclIsTypeOf(StartAction))->size() = 1"; |
| 244 | |
| 245 | /** |
| 246 | * The cached OCL invariant for the '{@link #ExactlyOneStartAction(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Exactly One Start Action</em>}' invariant operation. |
| 247 | * <!-- begin-user-doc --> |
| 248 | * <!-- end-user-doc --> |
| 249 | * @see #ExactlyOneStartAction(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) |
| 250 | * @generated |
| 251 | * @ordered |
| 252 | */ |
| 253 | protected static Constraint EXACTLY_ONE_START_ACTION__DIAGNOSTIC_CHAIN_MAP__EOCL_INV; |
| 254 | |
| 255 | /** |
| 256 | * <!-- begin-user-doc --> |
| 257 | * <!-- end-user-doc --> |
| 258 | * @generated |
| 259 | */ |
| 260 | public boolean ExactlyOneStartAction(DiagnosticChain diagnostics, Map<Object, Object> context) { |
| 261 | if (EXACTLY_ONE_START_ACTION__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) { |
| 262 | OCL.Helper helper = EOCL_ENV.createOCLHelper(); |
| 263 | helper.setContext(SeffPackage.Literals.RESOURCE_DEMANDING_BEHAVIOUR); |
| 264 | try { |
| 265 | EXACTLY_ONE_START_ACTION__DIAGNOSTIC_CHAIN_MAP__EOCL_INV = helper.createInvariant(EXACTLY_ONE_START_ACTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP); |
| 266 | } |
| 267 | catch (ParserException pe) { |
| 268 | throw new UnsupportedOperationException(pe.getLocalizedMessage()); |
| 269 | } |
| 270 | } |
| 271 | if (!EOCL_ENV.createQuery(EXACTLY_ONE_START_ACTION__DIAGNOSTIC_CHAIN_MAP__EOCL_INV).check(this)) { |
| 272 | if (diagnostics != null) { |
| 273 | diagnostics.add |
| 274 | (new BasicDiagnostic |
| 275 | (Diagnostic.ERROR, |
| 276 | SeffValidator.DIAGNOSTIC_SOURCE, |
| 277 | SeffValidator.RESOURCE_DEMANDING_BEHAVIOUR__EXACTLY_ONE_START_ACTION, |
| 278 | EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "ExactlyOneStartAction", EObjectValidator.getObjectLabel(this, context) }), |
| 279 | new Object [] { this })); |
| 280 | } |
| 281 | return false; |
| 282 | } |
| 283 | return true; |
| 284 | } |
| 285 | |
| 286 | /** |
| 287 | * The cached OCL expression body for the '{@link #EachActionExceptStartActionandStopActionMustHhaveAPredecessorAndSuccessor(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Each Action Except Start Actionand Stop Action Must Hhave APredecessor And Successor</em>}' operation. |
| 288 | * <!-- begin-user-doc --> |
| 289 | * <!-- end-user-doc --> |
| 290 | * @see #EachActionExceptStartActionandStopActionMustHhaveAPredecessorAndSuccessor(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) |
| 291 | * @generated |
| 292 | * @ordered |
| 293 | */ |
| 294 | protected static final String EACH_ACTION_EXCEPT_START_ACTIONAND_STOP_ACTION_MUST_HHAVE_APREDECESSOR_AND_SUCCESSOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP = "not self.steps_Behaviour->select(s|not s.oclIsTypeOf(StartAction) and not s.oclIsTypeOf(StopAction))->exists(a|a.oclAsType(AbstractAction).predecessor_AbstractAction.oclIsUndefined()) and not self.steps_Behaviour->select(s|not s.oclIsTypeOf(StartAction) and not s.oclIsTypeOf(StopAction))->exists(a|a.oclAsType(AbstractAction).successor_AbstractAction.oclIsUndefined())"; |
| 295 | |
| 296 | /** |
| 297 | * The cached OCL invariant for the '{@link #EachActionExceptStartActionandStopActionMustHhaveAPredecessorAndSuccessor(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Each Action Except Start Actionand Stop Action Must Hhave APredecessor And Successor</em>}' invariant operation. |
| 298 | * <!-- begin-user-doc --> |
| 299 | * <!-- end-user-doc --> |
| 300 | * @see #EachActionExceptStartActionandStopActionMustHhaveAPredecessorAndSuccessor(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) |
| 301 | * @generated |
| 302 | * @ordered |
| 303 | */ |
| 304 | protected static Constraint EACH_ACTION_EXCEPT_START_ACTIONAND_STOP_ACTION_MUST_HHAVE_APREDECESSOR_AND_SUCCESSOR__DIAGNOSTIC_CHAIN_MAP__EOCL_INV; |
| 305 | |
| 306 | /** |
| 307 | * <!-- begin-user-doc --> |
| 308 | * <!-- end-user-doc --> |
| 309 | * @generated |
| 310 | */ |
| 311 | public boolean EachActionExceptStartActionandStopActionMustHhaveAPredecessorAndSuccessor(DiagnosticChain diagnostics, Map<Object, Object> context) { |
| 312 | if (EACH_ACTION_EXCEPT_START_ACTIONAND_STOP_ACTION_MUST_HHAVE_APREDECESSOR_AND_SUCCESSOR__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) { |
| 313 | OCL.Helper helper = EOCL_ENV.createOCLHelper(); |
| 314 | helper.setContext(SeffPackage.Literals.RESOURCE_DEMANDING_BEHAVIOUR); |
| 315 | try { |
| 316 | EACH_ACTION_EXCEPT_START_ACTIONAND_STOP_ACTION_MUST_HHAVE_APREDECESSOR_AND_SUCCESSOR__DIAGNOSTIC_CHAIN_MAP__EOCL_INV = helper.createInvariant(EACH_ACTION_EXCEPT_START_ACTIONAND_STOP_ACTION_MUST_HHAVE_APREDECESSOR_AND_SUCCESSOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP); |
| 317 | } |
| 318 | catch (ParserException pe) { |
| 319 | throw new UnsupportedOperationException(pe.getLocalizedMessage()); |
| 320 | } |
| 321 | } |
| 322 | if (!EOCL_ENV.createQuery(EACH_ACTION_EXCEPT_START_ACTIONAND_STOP_ACTION_MUST_HHAVE_APREDECESSOR_AND_SUCCESSOR__DIAGNOSTIC_CHAIN_MAP__EOCL_INV).check(this)) { |
| 323 | if (diagnostics != null) { |
| 324 | diagnostics.add |
| 325 | (new BasicDiagnostic |
| 326 | (Diagnostic.ERROR, |
| 327 | SeffValidator.DIAGNOSTIC_SOURCE, |
| 328 | SeffValidator.RESOURCE_DEMANDING_BEHAVIOUR__EACH_ACTION_EXCEPT_START_ACTIONAND_STOP_ACTION_MUST_HHAVE_APREDECESSOR_AND_SUCCESSOR, |
| 329 | EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "EachActionExceptStartActionandStopActionMustHhaveAPredecessorAndSuccessor", EObjectValidator.getObjectLabel(this, context) }), |
| 330 | new Object [] { this })); |
| 331 | } |
| 332 | return false; |
| 333 | } |
| 334 | return true; |
| 335 | } |
| 336 | |
| 337 | /** |
| 338 | * <!-- begin-user-doc --> |
| 339 | * <!-- end-user-doc --> |
| 340 | * @generated |
| 341 | */ |
| 342 | @SuppressWarnings("unchecked") |
| 343 | @Override |
| 344 | public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| 345 | switch (featureID) { |
| 346 | case SeffPackage.RESOURCE_DEMANDING_BEHAVIOUR__ABSTRACT_LOOP_ACTION_RESOURCE_DEMANDING_BEHAVIOUR: |
| 347 | if (eInternalContainer() != null) |
| 348 | msgs = eBasicRemoveFromContainer(msgs); |
| 349 | return basicSetAbstractLoopAction_ResourceDemandingBehaviour((AbstractLoopAction)otherEnd, msgs); |
| 350 | case SeffPackage.RESOURCE_DEMANDING_BEHAVIOUR__ABSTRACT_BRANCH_TRANSITION_RESOURCE_DEMANDING_BEHAVIOUR: |
| 351 | if (eInternalContainer() != null) |
| 352 | msgs = eBasicRemoveFromContainer(msgs); |
| 353 | return basicSetAbstractBranchTransition_ResourceDemandingBehaviour((AbstractBranchTransition)otherEnd, msgs); |
| 354 | case SeffPackage.RESOURCE_DEMANDING_BEHAVIOUR__STEPS_BEHAVIOUR: |
| 355 | return ((InternalEList<InternalEObject>)(InternalEList<?>)getSteps_Behaviour()).basicAdd(otherEnd, msgs); |
| 356 | } |
| 357 | return super.eInverseAdd(otherEnd, featureID, msgs); |
| 358 | } |
| 359 | |
| 360 | /** |
| 361 | * <!-- begin-user-doc --> |
| 362 | * <!-- end-user-doc --> |
| 363 | * @generated |
| 364 | */ |
| 365 | @Override |
| 366 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| 367 | switch (featureID) { |
| 368 | case SeffPackage.RESOURCE_DEMANDING_BEHAVIOUR__ABSTRACT_LOOP_ACTION_RESOURCE_DEMANDING_BEHAVIOUR: |
| 369 | return basicSetAbstractLoopAction_ResourceDemandingBehaviour(null, msgs); |
| 370 | case SeffPackage.RESOURCE_DEMANDING_BEHAVIOUR__ABSTRACT_BRANCH_TRANSITION_RESOURCE_DEMANDING_BEHAVIOUR: |
| 371 | return basicSetAbstractBranchTransition_ResourceDemandingBehaviour(null, msgs); |
| 372 | case SeffPackage.RESOURCE_DEMANDING_BEHAVIOUR__STEPS_BEHAVIOUR: |
| 373 | return ((InternalEList<?>)getSteps_Behaviour()).basicRemove(otherEnd, msgs); |
| 374 | } |
| 375 | return super.eInverseRemove(otherEnd, featureID, msgs); |
| 376 | } |
| 377 | |
| 378 | /** |
| 379 | * <!-- begin-user-doc --> |
| 380 | * <!-- end-user-doc --> |
| 381 | * @generated |
| 382 | */ |
| 383 | @Override |
| 384 | public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { |
| 385 | switch (eContainerFeatureID()) { |
| 386 | case SeffPackage.RESOURCE_DEMANDING_BEHAVIOUR__ABSTRACT_LOOP_ACTION_RESOURCE_DEMANDING_BEHAVIOUR: |
| 387 | return eInternalContainer().eInverseRemove(this, SeffPackage.ABSTRACT_LOOP_ACTION__BODY_BEHAVIOUR_LOOP, AbstractLoopAction.class, msgs); |
| 388 | case SeffPackage.RESOURCE_DEMANDING_BEHAVIOUR__ABSTRACT_BRANCH_TRANSITION_RESOURCE_DEMANDING_BEHAVIOUR: |
| 389 | return eInternalContainer().eInverseRemove(this, SeffPackage.ABSTRACT_BRANCH_TRANSITION__BRANCH_BEHAVIOUR_BRANCH_TRANSITION, AbstractBranchTransition.class, msgs); |
| 390 | } |
| 391 | return super.eBasicRemoveFromContainerFeature(msgs); |
| 392 | } |
| 393 | |
| 394 | /** |
| 395 | * <!-- begin-user-doc --> |
| 396 | * <!-- end-user-doc --> |
| 397 | * @generated |
| 398 | */ |
| 399 | @Override |
| 400 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| 401 | switch (featureID) { |
| 402 | case SeffPackage.RESOURCE_DEMANDING_BEHAVIOUR__ABSTRACT_LOOP_ACTION_RESOURCE_DEMANDING_BEHAVIOUR: |
| 403 | return getAbstractLoopAction_ResourceDemandingBehaviour(); |
| 404 | case SeffPackage.RESOURCE_DEMANDING_BEHAVIOUR__ABSTRACT_BRANCH_TRANSITION_RESOURCE_DEMANDING_BEHAVIOUR: |
| 405 | return getAbstractBranchTransition_ResourceDemandingBehaviour(); |
| 406 | case SeffPackage.RESOURCE_DEMANDING_BEHAVIOUR__STEPS_BEHAVIOUR: |
| 407 | return getSteps_Behaviour(); |
| 408 | } |
| 409 | return super.eGet(featureID, resolve, coreType); |
| 410 | } |
| 411 | |
| 412 | /** |
| 413 | * <!-- begin-user-doc --> |
| 414 | * <!-- end-user-doc --> |
| 415 | * @generated |
| 416 | */ |
| 417 | @SuppressWarnings("unchecked") |
| 418 | @Override |
| 419 | public void eSet(int featureID, Object newValue) { |
| 420 | switch (featureID) { |
| 421 | case SeffPackage.RESOURCE_DEMANDING_BEHAVIOUR__ABSTRACT_LOOP_ACTION_RESOURCE_DEMANDING_BEHAVIOUR: |
| 422 | setAbstractLoopAction_ResourceDemandingBehaviour((AbstractLoopAction)newValue); |
| 423 | return; |
| 424 | case SeffPackage.RESOURCE_DEMANDING_BEHAVIOUR__ABSTRACT_BRANCH_TRANSITION_RESOURCE_DEMANDING_BEHAVIOUR: |
| 425 | setAbstractBranchTransition_ResourceDemandingBehaviour((AbstractBranchTransition)newValue); |
| 426 | return; |
| 427 | case SeffPackage.RESOURCE_DEMANDING_BEHAVIOUR__STEPS_BEHAVIOUR: |
| 428 | getSteps_Behaviour().clear(); |
| 429 | getSteps_Behaviour().addAll((Collection<? extends AbstractAction>)newValue); |
| 430 | return; |
| 431 | } |
| 432 | super.eSet(featureID, newValue); |
| 433 | } |
| 434 | |
| 435 | /** |
| 436 | * <!-- begin-user-doc --> |
| 437 | * <!-- end-user-doc --> |
| 438 | * @generated |
| 439 | */ |
| 440 | @Override |
| 441 | public void eUnset(int featureID) { |
| 442 | switch (featureID) { |
| 443 | case SeffPackage.RESOURCE_DEMANDING_BEHAVIOUR__ABSTRACT_LOOP_ACTION_RESOURCE_DEMANDING_BEHAVIOUR: |
| 444 | setAbstractLoopAction_ResourceDemandingBehaviour((AbstractLoopAction)null); |
| 445 | return; |
| 446 | case SeffPackage.RESOURCE_DEMANDING_BEHAVIOUR__ABSTRACT_BRANCH_TRANSITION_RESOURCE_DEMANDING_BEHAVIOUR: |
| 447 | setAbstractBranchTransition_ResourceDemandingBehaviour((AbstractBranchTransition)null); |
| 448 | return; |
| 449 | case SeffPackage.RESOURCE_DEMANDING_BEHAVIOUR__STEPS_BEHAVIOUR: |
| 450 | getSteps_Behaviour().clear(); |
| 451 | return; |
| 452 | } |
| 453 | super.eUnset(featureID); |
| 454 | } |
| 455 | |
| 456 | /** |
| 457 | * <!-- begin-user-doc --> |
| 458 | * <!-- end-user-doc --> |
| 459 | * @generated |
| 460 | */ |
| 461 | @Override |
| 462 | public boolean eIsSet(int featureID) { |
| 463 | switch (featureID) { |
| 464 | case SeffPackage.RESOURCE_DEMANDING_BEHAVIOUR__ABSTRACT_LOOP_ACTION_RESOURCE_DEMANDING_BEHAVIOUR: |
| 465 | return getAbstractLoopAction_ResourceDemandingBehaviour() != null; |
| 466 | case SeffPackage.RESOURCE_DEMANDING_BEHAVIOUR__ABSTRACT_BRANCH_TRANSITION_RESOURCE_DEMANDING_BEHAVIOUR: |
| 467 | return getAbstractBranchTransition_ResourceDemandingBehaviour() != null; |
| 468 | case SeffPackage.RESOURCE_DEMANDING_BEHAVIOUR__STEPS_BEHAVIOUR: |
| 469 | return steps_Behaviour != null && !steps_Behaviour.isEmpty(); |
| 470 | } |
| 471 | return super.eIsSet(featureID); |
| 472 | } |
| 473 | |
| 474 | /** |
| 475 | * The cached environment for evaluating OCL expressions. |
| 476 | * <!-- begin-user-doc --> |
| 477 | * <!-- end-user-doc --> |
| 478 | * @generated |
| 479 | * @ordered |
| 480 | */ |
| 481 | protected static final OCL EOCL_ENV = OCL.newInstance(); |
| 482 | |
| 483 | } //ResourceDemandingBehaviourImpl |