/**
*/
package org.eclipse.viatra.solver.language.solverLanguage.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.viatra.solver.language.solverLanguage.Aggregation;
import org.eclipse.viatra.solver.language.solverLanguage.Expression;
import org.eclipse.viatra.solver.language.solverLanguage.SolverLanguagePackage;
import org.eclipse.viatra.solver.language.solverLanguage.Symbol;
/**
*
* An implementation of the model object 'Aggregation'.
*
*
* The following features are implemented:
*
*
* - {@link org.eclipse.viatra.solver.language.solverLanguage.impl.AggregationImpl#getValue Value}
* - {@link org.eclipse.viatra.solver.language.solverLanguage.impl.AggregationImpl#getOp Op}
*
*
* @generated
*/
public class AggregationImpl extends AggregateExpressionImpl implements Aggregation {
/**
* The cached value of the '{@link #getValue() Value}' containment reference.
*
*
* @see #getValue()
* @generated
* @ordered
*/
protected Expression value;
/**
* The cached value of the '{@link #getOp() Op}' reference.
*
*
* @see #getOp()
* @generated
* @ordered
*/
protected Symbol op;
/**
*
*
* @generated
*/
protected AggregationImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return SolverLanguagePackage.Literals.AGGREGATION;
}
/**
*
*
* @generated
*/
public Expression getValue() {
return value;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetValue(Expression newValue, NotificationChain msgs) {
Expression oldValue = value;
value = newValue;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET,
SolverLanguagePackage.AGGREGATION__VALUE, oldValue, newValue);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
public void setValue(Expression newValue) {
if (newValue != value) {
NotificationChain msgs = null;
if (value != null)
msgs = ((InternalEObject) value).eInverseRemove(this,
EOPPOSITE_FEATURE_BASE - SolverLanguagePackage.AGGREGATION__VALUE, null, msgs);
if (newValue != null)
msgs = ((InternalEObject) newValue).eInverseAdd(this,
EOPPOSITE_FEATURE_BASE - SolverLanguagePackage.AGGREGATION__VALUE, null, msgs);
msgs = basicSetValue(newValue, msgs);
if (msgs != null)
msgs.dispatch();
} else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SolverLanguagePackage.AGGREGATION__VALUE, newValue,
newValue));
}
/**
*
*
* @generated
*/
public Symbol getOp() {
if (op != null && op.eIsProxy()) {
InternalEObject oldOp = (InternalEObject) op;
op = (Symbol) eResolveProxy(oldOp);
if (op != oldOp) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, SolverLanguagePackage.AGGREGATION__OP,
oldOp, op));
}
}
return op;
}
/**
*
*
* @generated
*/
public Symbol basicGetOp() {
return op;
}
/**
*
*
* @generated
*/
public void setOp(Symbol newOp) {
Symbol oldOp = op;
op = newOp;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SolverLanguagePackage.AGGREGATION__OP, oldOp, op));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case SolverLanguagePackage.AGGREGATION__VALUE:
return basicSetValue(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case SolverLanguagePackage.AGGREGATION__VALUE:
return getValue();
case SolverLanguagePackage.AGGREGATION__OP:
if (resolve)
return getOp();
return basicGetOp();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case SolverLanguagePackage.AGGREGATION__VALUE:
setValue((Expression) newValue);
return;
case SolverLanguagePackage.AGGREGATION__OP:
setOp((Symbol) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case SolverLanguagePackage.AGGREGATION__VALUE:
setValue((Expression) null);
return;
case SolverLanguagePackage.AGGREGATION__OP:
setOp((Symbol) null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case SolverLanguagePackage.AGGREGATION__VALUE:
return value != null;
case SolverLanguagePackage.AGGREGATION__OP:
return op != null;
}
return super.eIsSet(featureID);
}
} //AggregationImpl