/**
* <copyright>
* </copyright>
*
*/
package at.bestsolution.efxclipse.tooling.svgpath.svgPath.impl;
import at.bestsolution.efxclipse.tooling.svgpath.svgPath.SvgPathPackage;
import at.bestsolution.efxclipse.tooling.svgpath.svgPath.coordinate;
import at.bestsolution.efxclipse.tooling.svgpath.svgPath.coordinate_pair;
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.impl.MinimalEObjectImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>coordinate pair</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link at.bestsolution.efxclipse.tooling.svgpath.svgPath.impl.coordinate_pairImpl#getC1 <em>C1</em>}</li>
* <li>{@link at.bestsolution.efxclipse.tooling.svgpath.svgPath.impl.coordinate_pairImpl#getC2 <em>C2</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class coordinate_pairImpl extends MinimalEObjectImpl.Container implements coordinate_pair
{
/**
* The cached value of the '{@link #getC1() <em>C1</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getC1()
* @generated
* @ordered
*/
protected coordinate c1;
/**
* The cached value of the '{@link #getC2() <em>C2</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getC2()
* @generated
* @ordered
*/
protected coordinate c2;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected coordinate_pairImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return SvgPathPackage.Literals.COORDINATE_PAIR;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public coordinate getC1()
{
return c1;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetC1(coordinate newC1, NotificationChain msgs)
{
coordinate oldC1 = c1;
c1 = newC1;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SvgPathPackage.COORDINATE_PAIR__C1, oldC1, newC1);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setC1(coordinate newC1)
{
if (newC1 != c1)
{
NotificationChain msgs = null;
if (c1 != null)
msgs = ((InternalEObject)c1).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - SvgPathPackage.COORDINATE_PAIR__C1, null, msgs);
if (newC1 != null)
msgs = ((InternalEObject)newC1).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - SvgPathPackage.COORDINATE_PAIR__C1, null, msgs);
msgs = basicSetC1(newC1, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SvgPathPackage.COORDINATE_PAIR__C1, newC1, newC1));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public coordinate getC2()
{
return c2;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetC2(coordinate newC2, NotificationChain msgs)
{
coordinate oldC2 = c2;
c2 = newC2;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SvgPathPackage.COORDINATE_PAIR__C2, oldC2, newC2);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setC2(coordinate newC2)
{
if (newC2 != c2)
{
NotificationChain msgs = null;
if (c2 != null)
msgs = ((InternalEObject)c2).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - SvgPathPackage.COORDINATE_PAIR__C2, null, msgs);
if (newC2 != null)
msgs = ((InternalEObject)newC2).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - SvgPathPackage.COORDINATE_PAIR__C2, null, msgs);
msgs = basicSetC2(newC2, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SvgPathPackage.COORDINATE_PAIR__C2, newC2, newC2));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case SvgPathPackage.COORDINATE_PAIR__C1:
return basicSetC1(null, msgs);
case SvgPathPackage.COORDINATE_PAIR__C2:
return basicSetC2(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 SvgPathPackage.COORDINATE_PAIR__C1:
return getC1();
case SvgPathPackage.COORDINATE_PAIR__C2:
return getC2();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case SvgPathPackage.COORDINATE_PAIR__C1:
setC1((coordinate)newValue);
return;
case SvgPathPackage.COORDINATE_PAIR__C2:
setC2((coordinate)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case SvgPathPackage.COORDINATE_PAIR__C1:
setC1((coordinate)null);
return;
case SvgPathPackage.COORDINATE_PAIR__C2:
setC2((coordinate)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case SvgPathPackage.COORDINATE_PAIR__C1:
return c1 != null;
case SvgPathPackage.COORDINATE_PAIR__C2:
return c2 != null;
}
return super.eIsSet(featureID);
}
} //coordinate_pairImpl