/**
*/
package hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.impl;
import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.LogiclanguagePackage;
import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Not;
import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Term;
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;
/**
*
* An implementation of the model object 'Not'.
*
*
* The following features are implemented:
*
*
* - {@link hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.impl.NotImpl#getOperand Operand}
*
*
* @generated
*/
public class NotImpl extends BoolOperationImpl implements Not {
/**
* The cached value of the '{@link #getOperand() Operand}' containment reference.
*
*
* @see #getOperand()
* @generated
* @ordered
*/
protected Term operand;
/**
*
*
* @generated
*/
protected NotImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return LogiclanguagePackage.Literals.NOT;
}
/**
*
*
* @generated
*/
@Override
public Term getOperand() {
return operand;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetOperand(Term newOperand, NotificationChain msgs) {
Term oldOperand = operand;
operand = newOperand;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, LogiclanguagePackage.NOT__OPERAND, oldOperand, newOperand);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
@Override
public void setOperand(Term newOperand) {
if (newOperand != operand) {
NotificationChain msgs = null;
if (operand != null)
msgs = ((InternalEObject)operand).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - LogiclanguagePackage.NOT__OPERAND, null, msgs);
if (newOperand != null)
msgs = ((InternalEObject)newOperand).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - LogiclanguagePackage.NOT__OPERAND, null, msgs);
msgs = basicSetOperand(newOperand, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, LogiclanguagePackage.NOT__OPERAND, newOperand, newOperand));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case LogiclanguagePackage.NOT__OPERAND:
return basicSetOperand(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case LogiclanguagePackage.NOT__OPERAND:
return getOperand();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case LogiclanguagePackage.NOT__OPERAND:
setOperand((Term)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case LogiclanguagePackage.NOT__OPERAND:
setOperand((Term)null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case LogiclanguagePackage.NOT__OPERAND:
return operand != null;
}
return super.eIsSet(featureID);
}
} //NotImpl