| /** |
| */ |
| package nestedcondition.impl; |
| |
| import graph.Graph; |
| |
| import laxcondition.Quantifier; |
| |
| import nestedcondition.Morphism; |
| import nestedcondition.NestedCondition; |
| import nestedcondition.NestedconditionPackage; |
| import nestedcondition.QuantifiedCondition; |
| |
| 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; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Quantified Condition</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link nestedcondition.impl.QuantifiedConditionImpl#getQuantifier <em>Quantifier</em>}</li> |
| * <li>{@link nestedcondition.impl.QuantifiedConditionImpl#getCondition <em>Condition</em>}</li> |
| * <li>{@link nestedcondition.impl.QuantifiedConditionImpl#getMorphism <em>Morphism</em>}</li> |
| * <li>{@link nestedcondition.impl.QuantifiedConditionImpl#getCodomain <em>Codomain</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class QuantifiedConditionImpl extends NestedConditionImpl implements QuantifiedCondition { |
| /** |
| * The default value of the '{@link #getQuantifier() <em>Quantifier</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getQuantifier() |
| * @generated |
| * @ordered |
| */ |
| protected static final Quantifier QUANTIFIER_EDEFAULT = Quantifier.EXISTS; |
| |
| /** |
| * The cached value of the '{@link #getQuantifier() <em>Quantifier</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getQuantifier() |
| * @generated |
| * @ordered |
| */ |
| protected Quantifier quantifier = QUANTIFIER_EDEFAULT; |
| |
| /** |
| * The cached value of the '{@link #getCondition() <em>Condition</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getCondition() |
| * @generated |
| * @ordered |
| */ |
| protected NestedCondition condition; |
| |
| /** |
| * The cached value of the '{@link #getMorphism() <em>Morphism</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getMorphism() |
| * @generated |
| * @ordered |
| */ |
| protected Morphism morphism; |
| |
| /** |
| * The cached value of the '{@link #getCodomain() <em>Codomain</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getCodomain() |
| * @generated |
| * @ordered |
| */ |
| protected Graph codomain; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected QuantifiedConditionImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return NestedconditionPackage.Literals.QUANTIFIED_CONDITION; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Quantifier getQuantifier() { |
| return quantifier; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setQuantifier(Quantifier newQuantifier) { |
| Quantifier oldQuantifier = quantifier; |
| quantifier = newQuantifier == null ? QUANTIFIER_EDEFAULT : newQuantifier; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, NestedconditionPackage.QUANTIFIED_CONDITION__QUANTIFIER, oldQuantifier, quantifier)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NestedCondition getCondition() { |
| return condition; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetCondition(NestedCondition newCondition, NotificationChain msgs) { |
| NestedCondition oldCondition = condition; |
| condition = newCondition; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, NestedconditionPackage.QUANTIFIED_CONDITION__CONDITION, oldCondition, newCondition); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setCondition(NestedCondition newCondition) { |
| if (newCondition != condition) { |
| NotificationChain msgs = null; |
| if (condition != null) |
| msgs = ((InternalEObject)condition).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - NestedconditionPackage.QUANTIFIED_CONDITION__CONDITION, null, msgs); |
| if (newCondition != null) |
| msgs = ((InternalEObject)newCondition).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - NestedconditionPackage.QUANTIFIED_CONDITION__CONDITION, null, msgs); |
| msgs = basicSetCondition(newCondition, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, NestedconditionPackage.QUANTIFIED_CONDITION__CONDITION, newCondition, newCondition)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Morphism getMorphism() { |
| return morphism; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetMorphism(Morphism newMorphism, NotificationChain msgs) { |
| Morphism oldMorphism = morphism; |
| morphism = newMorphism; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, NestedconditionPackage.QUANTIFIED_CONDITION__MORPHISM, oldMorphism, newMorphism); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setMorphism(Morphism newMorphism) { |
| if (newMorphism != morphism) { |
| NotificationChain msgs = null; |
| if (morphism != null) |
| msgs = ((InternalEObject)morphism).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - NestedconditionPackage.QUANTIFIED_CONDITION__MORPHISM, null, msgs); |
| if (newMorphism != null) |
| msgs = ((InternalEObject)newMorphism).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - NestedconditionPackage.QUANTIFIED_CONDITION__MORPHISM, null, msgs); |
| msgs = basicSetMorphism(newMorphism, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, NestedconditionPackage.QUANTIFIED_CONDITION__MORPHISM, newMorphism, newMorphism)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Graph getCodomain() { |
| return codomain; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetCodomain(Graph newCodomain, NotificationChain msgs) { |
| Graph oldCodomain = codomain; |
| codomain = newCodomain; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, NestedconditionPackage.QUANTIFIED_CONDITION__CODOMAIN, oldCodomain, newCodomain); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setCodomain(Graph newCodomain) { |
| if (newCodomain != codomain) { |
| NotificationChain msgs = null; |
| if (codomain != null) |
| msgs = ((InternalEObject)codomain).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - NestedconditionPackage.QUANTIFIED_CONDITION__CODOMAIN, null, msgs); |
| if (newCodomain != null) |
| msgs = ((InternalEObject)newCodomain).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - NestedconditionPackage.QUANTIFIED_CONDITION__CODOMAIN, null, msgs); |
| msgs = basicSetCodomain(newCodomain, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, NestedconditionPackage.QUANTIFIED_CONDITION__CODOMAIN, newCodomain, newCodomain)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case NestedconditionPackage.QUANTIFIED_CONDITION__CONDITION: |
| return basicSetCondition(null, msgs); |
| case NestedconditionPackage.QUANTIFIED_CONDITION__MORPHISM: |
| return basicSetMorphism(null, msgs); |
| case NestedconditionPackage.QUANTIFIED_CONDITION__CODOMAIN: |
| return basicSetCodomain(null, msgs); |
| } |
| return super.eInverseRemove(otherEnd, featureID, msgs); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case NestedconditionPackage.QUANTIFIED_CONDITION__QUANTIFIER: |
| return getQuantifier(); |
| case NestedconditionPackage.QUANTIFIED_CONDITION__CONDITION: |
| return getCondition(); |
| case NestedconditionPackage.QUANTIFIED_CONDITION__MORPHISM: |
| return getMorphism(); |
| case NestedconditionPackage.QUANTIFIED_CONDITION__CODOMAIN: |
| return getCodomain(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case NestedconditionPackage.QUANTIFIED_CONDITION__QUANTIFIER: |
| setQuantifier((Quantifier)newValue); |
| return; |
| case NestedconditionPackage.QUANTIFIED_CONDITION__CONDITION: |
| setCondition((NestedCondition)newValue); |
| return; |
| case NestedconditionPackage.QUANTIFIED_CONDITION__MORPHISM: |
| setMorphism((Morphism)newValue); |
| return; |
| case NestedconditionPackage.QUANTIFIED_CONDITION__CODOMAIN: |
| setCodomain((Graph)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case NestedconditionPackage.QUANTIFIED_CONDITION__QUANTIFIER: |
| setQuantifier(QUANTIFIER_EDEFAULT); |
| return; |
| case NestedconditionPackage.QUANTIFIED_CONDITION__CONDITION: |
| setCondition((NestedCondition)null); |
| return; |
| case NestedconditionPackage.QUANTIFIED_CONDITION__MORPHISM: |
| setMorphism((Morphism)null); |
| return; |
| case NestedconditionPackage.QUANTIFIED_CONDITION__CODOMAIN: |
| setCodomain((Graph)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case NestedconditionPackage.QUANTIFIED_CONDITION__QUANTIFIER: |
| return quantifier != QUANTIFIER_EDEFAULT; |
| case NestedconditionPackage.QUANTIFIED_CONDITION__CONDITION: |
| return condition != null; |
| case NestedconditionPackage.QUANTIFIED_CONDITION__MORPHISM: |
| return morphism != null; |
| case NestedconditionPackage.QUANTIFIED_CONDITION__CODOMAIN: |
| return codomain != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| if (eIsProxy()) return super.toString(); |
| |
| StringBuffer result = new StringBuffer(super.toString()); |
| result.append(" (quantifier: "); |
| result.append(quantifier); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //QuantifiedConditionImpl |