diff options
Diffstat (limited to 'rba.model.core/src/rba/core/impl/ContentStateImpl.java')
-rw-r--r-- | rba.model.core/src/rba/core/impl/ContentStateImpl.java | 256 |
1 files changed, 256 insertions, 0 deletions
diff --git a/rba.model.core/src/rba/core/impl/ContentStateImpl.java b/rba.model.core/src/rba/core/impl/ContentStateImpl.java new file mode 100644 index 0000000..f744899 --- /dev/null +++ b/rba.model.core/src/rba/core/impl/ContentStateImpl.java @@ -0,0 +1,256 @@ +/** + */ +package rba.core.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EcoreUtil; + +import rba.core.Content; +import rba.core.ContentState; +import rba.core.Expression; +import rba.core.RBACorePackage; + +/** + * <!-- begin-user-doc --> An implementation of the model object '<em><b>Content State</b></em>'. <!-- end-user-doc --> + * <p> + * The following features are implemented: + * </p> + * <ul> + * <li>{@link rba.core.impl.ContentStateImpl#getValue <em>Value</em>}</li> + * <li>{@link rba.core.impl.ContentStateImpl#getOwner <em>Owner</em>}</li> + * </ul> + * + * @generated + */ +public abstract class ContentStateImpl extends RuleObjectImpl implements ContentState { + /** + * The cached value of the '{@link #getValue() <em>Value</em>}' containment reference. + * <!-- begin-user-doc --> <!-- + * end-user-doc --> + * @see #getValue() + * @generated + * @ordered + */ + protected Expression value; + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + protected ContentStateImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() { + return RBACorePackage.Literals.CONTENT_STATE; + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + public Expression getValue() { + return value; + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + public NotificationChain basicSetValue(Expression newValue, NotificationChain msgs) { + Expression oldValue = value; + value = newValue; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + RBACorePackage.CONTENT_STATE__VALUE, oldValue, newValue); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + public void setValue(Expression newValue) { + if (newValue != value) { + NotificationChain msgs = null; + if (value != null) + msgs = ((InternalEObject) value).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - RBACorePackage.CONTENT_STATE__VALUE, null, msgs); + if (newValue != null) + msgs = ((InternalEObject) newValue).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - RBACorePackage.CONTENT_STATE__VALUE, null, msgs); + msgs = basicSetValue(newValue, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, RBACorePackage.CONTENT_STATE__VALUE, newValue, + newValue)); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + public Content getOwner() { + if (eContainerFeatureID() != RBACorePackage.CONTENT_STATE__OWNER) + return null; + return (Content) eInternalContainer(); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + public NotificationChain basicSetOwner(Content newOwner, NotificationChain msgs) { + msgs = eBasicSetContainer((InternalEObject) newOwner, RBACorePackage.CONTENT_STATE__OWNER, msgs); + return msgs; + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + public void setOwner(Content newOwner) { + if (newOwner != eInternalContainer() + || (eContainerFeatureID() != RBACorePackage.CONTENT_STATE__OWNER && newOwner != null)) { + if (EcoreUtil.isAncestor(this, newOwner)) + throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); + NotificationChain msgs = null; + if (eInternalContainer() != null) + msgs = eBasicRemoveFromContainer(msgs); + if (newOwner != null) + msgs = ((InternalEObject) newOwner).eInverseAdd(this, RBACorePackage.CONTENT__STATES, Content.class, + msgs); + msgs = basicSetOwner(newOwner, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, RBACorePackage.CONTENT_STATE__OWNER, newOwner, + newOwner)); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case RBACorePackage.CONTENT_STATE__OWNER: + if (eInternalContainer() != null) + msgs = eBasicRemoveFromContainer(msgs); + return basicSetOwner((Content) otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case RBACorePackage.CONTENT_STATE__VALUE: + return basicSetValue(null, msgs); + case RBACorePackage.CONTENT_STATE__OWNER: + return basicSetOwner(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + @Override + public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { + switch (eContainerFeatureID()) { + case RBACorePackage.CONTENT_STATE__OWNER: + return eInternalContainer().eInverseRemove(this, RBACorePackage.CONTENT__STATES, Content.class, msgs); + } + return super.eBasicRemoveFromContainerFeature(msgs); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case RBACorePackage.CONTENT_STATE__VALUE: + return getValue(); + case RBACorePackage.CONTENT_STATE__OWNER: + return getOwner(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case RBACorePackage.CONTENT_STATE__VALUE: + setValue((Expression) newValue); + return; + case RBACorePackage.CONTENT_STATE__OWNER: + setOwner((Content) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case RBACorePackage.CONTENT_STATE__VALUE: + setValue((Expression) null); + return; + case RBACorePackage.CONTENT_STATE__OWNER: + setOwner((Content) null); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case RBACorePackage.CONTENT_STATE__VALUE: + return value != null; + case RBACorePackage.CONTENT_STATE__OWNER: + return getOwner() != null; + } + return super.eIsSet(featureID); + } + +} // ContentStateImpl |