/** * <copyright> * </copyright> * * $Id$ */ package net.opengis.gml.impl; import net.opengis.gml.DirectPositionType; import net.opengis.gml.GmlPackage; import net.opengis.gml.PointType; 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>Point Type</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link net.opengis.gml.impl.PointTypeImpl#getPos <em>Pos</em>}</li> * </ul> * </p> * * @generated */ public class PointTypeImpl extends AbstractGeometryTypeImpl implements PointType { /** * The cached value of the '{@link #getPos() <em>Pos</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getPos() * @generated * @ordered */ protected DirectPositionType pos; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected PointTypeImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected EClass eStaticClass() { return GmlPackage.Literals.POINT_TYPE; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public DirectPositionType getPos() { return pos; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetPos(DirectPositionType newPos, NotificationChain msgs) { DirectPositionType oldPos = pos; pos = newPos; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GmlPackage.POINT_TYPE__POS, oldPos, newPos); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setPos(DirectPositionType newPos) { if (newPos != pos) { NotificationChain msgs = null; if (pos != null) msgs = ((InternalEObject)pos).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - GmlPackage.POINT_TYPE__POS, null, msgs); if (newPos != null) msgs = ((InternalEObject)newPos).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - GmlPackage.POINT_TYPE__POS, null, msgs); msgs = basicSetPos(newPos, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, GmlPackage.POINT_TYPE__POS, newPos, newPos)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case GmlPackage.POINT_TYPE__POS: return basicSetPos(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case GmlPackage.POINT_TYPE__POS: return getPos(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void eSet(int featureID, Object newValue) { switch (featureID) { case GmlPackage.POINT_TYPE__POS: setPos((DirectPositionType)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void eUnset(int featureID) { switch (featureID) { case GmlPackage.POINT_TYPE__POS: setPos((DirectPositionType)null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public boolean eIsSet(int featureID) { switch (featureID) { case GmlPackage.POINT_TYPE__POS: return pos != null; } return super.eIsSet(featureID); } } //PointTypeImpl