diff options
Diffstat (limited to 'plugins/org.eclipse.m2m.atl.common/src/org/eclipse/m2m/atl/common/ATL/ForEachOutPatternElement.java')
-rw-r--r-- | plugins/org.eclipse.m2m.atl.common/src/org/eclipse/m2m/atl/common/ATL/ForEachOutPatternElement.java | 276 |
1 files changed, 276 insertions, 0 deletions
diff --git a/plugins/org.eclipse.m2m.atl.common/src/org/eclipse/m2m/atl/common/ATL/ForEachOutPatternElement.java b/plugins/org.eclipse.m2m.atl.common/src/org/eclipse/m2m/atl/common/ATL/ForEachOutPatternElement.java new file mode 100644 index 00000000..9fc1bdb9 --- /dev/null +++ b/plugins/org.eclipse.m2m.atl.common/src/org/eclipse/m2m/atl/common/ATL/ForEachOutPatternElement.java @@ -0,0 +1,276 @@ +/** + * Copyright (c) 2008, 2012, 2015 Obeo. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Obeo - initial API and implementation + * Dennis Wagelaar (Vrije Universiteit Brussel) + */ +package org.eclipse.m2m.atl.common.ATL; + +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.m2m.atl.common.OCL.Iterator; +import org.eclipse.m2m.atl.common.OCL.OclExpression; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>For Each Out Pattern Element</b></em>'. + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * </p> + * <ul> + * <li>{@link org.eclipse.m2m.atl.common.ATL.ForEachOutPatternElement#getCollection <em>Collection</em>}</li> + * <li>{@link org.eclipse.m2m.atl.common.ATL.ForEachOutPatternElement#getIterator <em>Iterator</em>}</li> + * </ul> + * + * @see org.eclipse.m2m.atl.common.ATL.ATLPackage#getForEachOutPatternElement() + * @model kind="class" + * @generated + */ +public class ForEachOutPatternElement extends OutPatternElement { + /** + * The cached value of the '{@link #getCollection() <em>Collection</em>}' containment reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getCollection() + * @generated + * @ordered + */ + protected OclExpression collection; + + /** + * The cached value of the '{@link #getIterator() <em>Iterator</em>}' containment reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getIterator() + * @generated + * @ordered + */ + protected Iterator iterator; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected ForEachOutPatternElement() { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() { + return ATLPackage.Literals.FOR_EACH_OUT_PATTERN_ELEMENT; + } + + /** + * Returns the value of the '<em><b>Collection</b></em>' containment reference. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Collection</em>' containment reference isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Collection</em>' containment reference. + * @see #setCollection(OclExpression) + * @see org.eclipse.m2m.atl.common.ATL.ATLPackage#getForEachOutPatternElement_Collection() + * @model containment="true" required="true" ordered="false" + * @generated + */ + public OclExpression getCollection() { + return collection; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public NotificationChain basicSetCollection(OclExpression newCollection, NotificationChain msgs) { + OclExpression oldCollection = collection; + collection = newCollection; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ATLPackage.FOR_EACH_OUT_PATTERN_ELEMENT__COLLECTION, oldCollection, newCollection); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * Sets the value of the '{@link org.eclipse.m2m.atl.common.ATL.ForEachOutPatternElement#getCollection <em>Collection</em>}' containment reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Collection</em>' containment reference. + * @see #getCollection() + * @generated + */ + public void setCollection(OclExpression newCollection) { + if (newCollection != collection) { + NotificationChain msgs = null; + if (collection != null) + msgs = ((InternalEObject)collection).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ATLPackage.FOR_EACH_OUT_PATTERN_ELEMENT__COLLECTION, null, msgs); + if (newCollection != null) + msgs = ((InternalEObject)newCollection).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ATLPackage.FOR_EACH_OUT_PATTERN_ELEMENT__COLLECTION, null, msgs); + msgs = basicSetCollection(newCollection, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ATLPackage.FOR_EACH_OUT_PATTERN_ELEMENT__COLLECTION, newCollection, newCollection)); + } + + /** + * Returns the value of the '<em><b>Iterator</b></em>' containment reference. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Iterator</em>' containment reference isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Iterator</em>' containment reference. + * @see #setIterator(Iterator) + * @see org.eclipse.m2m.atl.common.ATL.ATLPackage#getForEachOutPatternElement_Iterator() + * @model containment="true" required="true" ordered="false" + * @generated + */ + public Iterator getIterator() { + return iterator; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public NotificationChain basicSetIterator(Iterator newIterator, NotificationChain msgs) { + Iterator oldIterator = iterator; + iterator = newIterator; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ATLPackage.FOR_EACH_OUT_PATTERN_ELEMENT__ITERATOR, oldIterator, newIterator); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * Sets the value of the '{@link org.eclipse.m2m.atl.common.ATL.ForEachOutPatternElement#getIterator <em>Iterator</em>}' containment reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Iterator</em>' containment reference. + * @see #getIterator() + * @generated + */ + public void setIterator(Iterator newIterator) { + if (newIterator != iterator) { + NotificationChain msgs = null; + if (iterator != null) + msgs = ((InternalEObject)iterator).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ATLPackage.FOR_EACH_OUT_PATTERN_ELEMENT__ITERATOR, null, msgs); + if (newIterator != null) + msgs = ((InternalEObject)newIterator).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ATLPackage.FOR_EACH_OUT_PATTERN_ELEMENT__ITERATOR, null, msgs); + msgs = basicSetIterator(newIterator, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ATLPackage.FOR_EACH_OUT_PATTERN_ELEMENT__ITERATOR, newIterator, newIterator)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case ATLPackage.FOR_EACH_OUT_PATTERN_ELEMENT__COLLECTION: + return basicSetCollection(null, msgs); + case ATLPackage.FOR_EACH_OUT_PATTERN_ELEMENT__ITERATOR: + return basicSetIterator(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 ATLPackage.FOR_EACH_OUT_PATTERN_ELEMENT__COLLECTION: + return getCollection(); + case ATLPackage.FOR_EACH_OUT_PATTERN_ELEMENT__ITERATOR: + return getIterator(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case ATLPackage.FOR_EACH_OUT_PATTERN_ELEMENT__COLLECTION: + setCollection((OclExpression)newValue); + return; + case ATLPackage.FOR_EACH_OUT_PATTERN_ELEMENT__ITERATOR: + setIterator((Iterator)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case ATLPackage.FOR_EACH_OUT_PATTERN_ELEMENT__COLLECTION: + setCollection((OclExpression)null); + return; + case ATLPackage.FOR_EACH_OUT_PATTERN_ELEMENT__ITERATOR: + setIterator((Iterator)null); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case ATLPackage.FOR_EACH_OUT_PATTERN_ELEMENT__COLLECTION: + return collection != null; + case ATLPackage.FOR_EACH_OUT_PATTERN_ELEMENT__ITERATOR: + return iterator != null; + } + return super.eIsSet(featureID); + } + +} // ForEachOutPatternElement |