/** */ package fr.inria.atlanmod.collaboro.history.impl; import fr.inria.atlanmod.collaboro.history.HistoryPackage; import fr.inria.atlanmod.collaboro.history.MetaInfo; import fr.inria.atlanmod.collaboro.history.Proposal; 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.EObjectImpl; import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; import org.eclipse.emf.ecore.util.EcoreUtil; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Meta Info</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link fr.inria.atlanmod.collaboro.history.impl.MetaInfoImpl#getProposal <em>Proposal</em>}</li> * </ul> * </p> * * @generated */ public abstract class MetaInfoImpl extends EObjectImpl implements MetaInfo { /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected MetaInfoImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return HistoryPackage.Literals.META_INFO; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Proposal getProposal() { if (eContainerFeatureID() != HistoryPackage.META_INFO__PROPOSAL) return null; return (Proposal)eInternalContainer(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetProposal(Proposal newProposal, NotificationChain msgs) { msgs = eBasicSetContainer((InternalEObject)newProposal, HistoryPackage.META_INFO__PROPOSAL, msgs); return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setProposal(Proposal newProposal) { if (newProposal != eInternalContainer() || (eContainerFeatureID() != HistoryPackage.META_INFO__PROPOSAL && newProposal != null)) { if (EcoreUtil.isAncestor(this, newProposal)) throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); NotificationChain msgs = null; if (eInternalContainer() != null) msgs = eBasicRemoveFromContainer(msgs); if (newProposal != null) msgs = ((InternalEObject)newProposal).eInverseAdd(this, HistoryPackage.PROPOSAL__META, Proposal.class, msgs); msgs = basicSetProposal(newProposal, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, HistoryPackage.META_INFO__PROPOSAL, newProposal, newProposal)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case HistoryPackage.META_INFO__PROPOSAL: if (eInternalContainer() != null) msgs = eBasicRemoveFromContainer(msgs); return basicSetProposal((Proposal)otherEnd, msgs); } return super.eInverseAdd(otherEnd, featureID, msgs); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case HistoryPackage.META_INFO__PROPOSAL: return basicSetProposal(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { switch (eContainerFeatureID()) { case HistoryPackage.META_INFO__PROPOSAL: return eInternalContainer().eInverseRemove(this, HistoryPackage.PROPOSAL__META, Proposal.class, msgs); } return super.eBasicRemoveFromContainerFeature(msgs); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case HistoryPackage.META_INFO__PROPOSAL: return getProposal(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case HistoryPackage.META_INFO__PROPOSAL: setProposal((Proposal)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case HistoryPackage.META_INFO__PROPOSAL: setProposal((Proposal)null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case HistoryPackage.META_INFO__PROPOSAL: return getProposal() != null; } return super.eIsSet(featureID); } } //MetaInfoImpl