/**
*/
package hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.impl;
import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.InstanceOf;
import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.LogiclanguagePackage;
import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Term;
import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.TypeReference;
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 'Instance Of'.
*
*
* The following features are implemented:
*
*
* - {@link hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.impl.InstanceOfImpl#getValue Value}
* - {@link hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.impl.InstanceOfImpl#getRange Range}
*
*
* @generated
*/
public class InstanceOfImpl extends TermImpl implements InstanceOf {
/**
* The cached value of the '{@link #getValue() Value}' containment reference.
*
*
* @see #getValue()
* @generated
* @ordered
*/
protected Term value;
/**
* The cached value of the '{@link #getRange() Range}' containment reference.
*
*
* @see #getRange()
* @generated
* @ordered
*/
protected TypeReference range;
/**
*
*
* @generated
*/
protected InstanceOfImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return LogiclanguagePackage.Literals.INSTANCE_OF;
}
/**
*
*
* @generated
*/
public Term getValue() {
return value;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetValue(Term newValue, NotificationChain msgs) {
Term oldValue = value;
value = newValue;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, LogiclanguagePackage.INSTANCE_OF__VALUE, oldValue, newValue);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
public void setValue(Term newValue) {
if (newValue != value) {
NotificationChain msgs = null;
if (value != null)
msgs = ((InternalEObject)value).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - LogiclanguagePackage.INSTANCE_OF__VALUE, null, msgs);
if (newValue != null)
msgs = ((InternalEObject)newValue).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - LogiclanguagePackage.INSTANCE_OF__VALUE, null, msgs);
msgs = basicSetValue(newValue, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, LogiclanguagePackage.INSTANCE_OF__VALUE, newValue, newValue));
}
/**
*
*
* @generated
*/
public TypeReference getRange() {
return range;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetRange(TypeReference newRange, NotificationChain msgs) {
TypeReference oldRange = range;
range = newRange;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, LogiclanguagePackage.INSTANCE_OF__RANGE, oldRange, newRange);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
public void setRange(TypeReference newRange) {
if (newRange != range) {
NotificationChain msgs = null;
if (range != null)
msgs = ((InternalEObject)range).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - LogiclanguagePackage.INSTANCE_OF__RANGE, null, msgs);
if (newRange != null)
msgs = ((InternalEObject)newRange).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - LogiclanguagePackage.INSTANCE_OF__RANGE, null, msgs);
msgs = basicSetRange(newRange, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, LogiclanguagePackage.INSTANCE_OF__RANGE, newRange, newRange));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case LogiclanguagePackage.INSTANCE_OF__VALUE:
return basicSetValue(null, msgs);
case LogiclanguagePackage.INSTANCE_OF__RANGE:
return basicSetRange(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case LogiclanguagePackage.INSTANCE_OF__VALUE:
return getValue();
case LogiclanguagePackage.INSTANCE_OF__RANGE:
return getRange();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case LogiclanguagePackage.INSTANCE_OF__VALUE:
setValue((Term)newValue);
return;
case LogiclanguagePackage.INSTANCE_OF__RANGE:
setRange((TypeReference)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case LogiclanguagePackage.INSTANCE_OF__VALUE:
setValue((Term)null);
return;
case LogiclanguagePackage.INSTANCE_OF__RANGE:
setRange((TypeReference)null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case LogiclanguagePackage.INSTANCE_OF__VALUE:
return value != null;
case LogiclanguagePackage.INSTANCE_OF__RANGE:
return range != null;
}
return super.eIsSet(featureID);
}
} //InstanceOfImpl