/**
*/
package hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.impl;
import hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.Ecore2logicannotationsPackage;
import hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.MultiplicityAssertion;
import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Relation;
import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.impl.AssertionAnnotationImpl;
import org.eclipse.emf.common.notify.Notification;
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 'Multiplicity Assertion'.
*
*
* The following features are implemented:
*
*
* - {@link hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.impl.MultiplicityAssertionImpl#getRelation Relation}
*
*
* @generated
*/
public class MultiplicityAssertionImpl extends AssertionAnnotationImpl implements MultiplicityAssertion {
/**
* The cached value of the '{@link #getRelation() Relation}' reference.
*
*
* @see #getRelation()
* @generated
* @ordered
*/
protected Relation relation;
/**
*
*
* @generated
*/
protected MultiplicityAssertionImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return Ecore2logicannotationsPackage.Literals.MULTIPLICITY_ASSERTION;
}
/**
*
*
* @generated
*/
public Relation getRelation() {
if (relation != null && relation.eIsProxy()) {
InternalEObject oldRelation = (InternalEObject)relation;
relation = (Relation)eResolveProxy(oldRelation);
if (relation != oldRelation) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, Ecore2logicannotationsPackage.MULTIPLICITY_ASSERTION__RELATION, oldRelation, relation));
}
}
return relation;
}
/**
*
*
* @generated
*/
public Relation basicGetRelation() {
return relation;
}
/**
*
*
* @generated
*/
public void setRelation(Relation newRelation) {
Relation oldRelation = relation;
relation = newRelation;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Ecore2logicannotationsPackage.MULTIPLICITY_ASSERTION__RELATION, oldRelation, relation));
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case Ecore2logicannotationsPackage.MULTIPLICITY_ASSERTION__RELATION:
if (resolve) return getRelation();
return basicGetRelation();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case Ecore2logicannotationsPackage.MULTIPLICITY_ASSERTION__RELATION:
setRelation((Relation)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case Ecore2logicannotationsPackage.MULTIPLICITY_ASSERTION__RELATION:
setRelation((Relation)null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case Ecore2logicannotationsPackage.MULTIPLICITY_ASSERTION__RELATION:
return relation != null;
}
return super.eIsSet(featureID);
}
} //MultiplicityAssertionImpl