/**
* <copyright>
* </copyright>
*
*/
package urban.kappa.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.impl.MinimalEObjectImpl;
import urban.kappa.Concentration;
import urban.kappa.KappaPackage;
import urban.kappa.ValueCalc;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Concentration</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link urban.kappa.impl.ConcentrationImpl#getLhs <em>Lhs</em>}</li>
* <li>{@link urban.kappa.impl.ConcentrationImpl#getOp <em>Op</em>}</li>
* <li>{@link urban.kappa.impl.ConcentrationImpl#getRhs <em>Rhs</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class ConcentrationImpl extends MinimalEObjectImpl.Container implements Concentration
{
/**
* The cached value of the '{@link #getLhs() <em>Lhs</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLhs()
* @generated
* @ordered
*/
protected ValueCalc lhs;
/**
* The default value of the '{@link #getOp() <em>Op</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getOp()
* @generated
* @ordered
*/
protected static final String OP_EDEFAULT = null;
/**
* The cached value of the '{@link #getOp() <em>Op</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getOp()
* @generated
* @ordered
*/
protected String op = OP_EDEFAULT;
/**
* The cached value of the '{@link #getRhs() <em>Rhs</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getRhs()
* @generated
* @ordered
*/
protected ValueCalc rhs;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ConcentrationImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return KappaPackage.Literals.CONCENTRATION;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ValueCalc getLhs()
{
return lhs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetLhs(ValueCalc newLhs, NotificationChain msgs)
{
ValueCalc oldLhs = lhs;
lhs = newLhs;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, KappaPackage.CONCENTRATION__LHS, oldLhs, newLhs);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setLhs(ValueCalc newLhs)
{
if (newLhs != lhs)
{
NotificationChain msgs = null;
if (lhs != null)
msgs = ((InternalEObject)lhs).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - KappaPackage.CONCENTRATION__LHS, null, msgs);
if (newLhs != null)
msgs = ((InternalEObject)newLhs).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - KappaPackage.CONCENTRATION__LHS, null, msgs);
msgs = basicSetLhs(newLhs, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, KappaPackage.CONCENTRATION__LHS, newLhs, newLhs));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getOp()
{
return op;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setOp(String newOp)
{
String oldOp = op;
op = newOp;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, KappaPackage.CONCENTRATION__OP, oldOp, op));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ValueCalc getRhs()
{
return rhs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetRhs(ValueCalc newRhs, NotificationChain msgs)
{
ValueCalc oldRhs = rhs;
rhs = newRhs;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, KappaPackage.CONCENTRATION__RHS, oldRhs, newRhs);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setRhs(ValueCalc newRhs)
{
if (newRhs != rhs)
{
NotificationChain msgs = null;
if (rhs != null)
msgs = ((InternalEObject)rhs).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - KappaPackage.CONCENTRATION__RHS, null, msgs);
if (newRhs != null)
msgs = ((InternalEObject)newRhs).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - KappaPackage.CONCENTRATION__RHS, null, msgs);
msgs = basicSetRhs(newRhs, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, KappaPackage.CONCENTRATION__RHS, newRhs, newRhs));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case KappaPackage.CONCENTRATION__LHS:
return basicSetLhs(null, msgs);
case KappaPackage.CONCENTRATION__RHS:
return basicSetRhs(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 KappaPackage.CONCENTRATION__LHS:
return getLhs();
case KappaPackage.CONCENTRATION__OP:
return getOp();
case KappaPackage.CONCENTRATION__RHS:
return getRhs();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case KappaPackage.CONCENTRATION__LHS:
setLhs((ValueCalc)newValue);
return;
case KappaPackage.CONCENTRATION__OP:
setOp((String)newValue);
return;
case KappaPackage.CONCENTRATION__RHS:
setRhs((ValueCalc)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case KappaPackage.CONCENTRATION__LHS:
setLhs((ValueCalc)null);
return;
case KappaPackage.CONCENTRATION__OP:
setOp(OP_EDEFAULT);
return;
case KappaPackage.CONCENTRATION__RHS:
setRhs((ValueCalc)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case KappaPackage.CONCENTRATION__LHS:
return lhs != null;
case KappaPackage.CONCENTRATION__OP:
return OP_EDEFAULT == null ? op != null : !OP_EDEFAULT.equals(op);
case KappaPackage.CONCENTRATION__RHS:
return rhs != 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(" (op: ");
result.append(op);
result.append(')');
return result.toString();
}
} //ConcentrationImpl