/** */ package net.certware.intent.intentSpecification.impl; import net.certware.intent.intentSpecification.DocItem; import net.certware.intent.intentSpecification.DocItemType; import net.certware.intent.intentSpecification.IntentSpecificationPackage; 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.MinimalEObjectImpl; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Doc Item</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * </p> * <ul> * <li>{@link net.certware.intent.intentSpecification.impl.DocItemImpl#getType <em>Type</em>}</li> * <li>{@link net.certware.intent.intentSpecification.impl.DocItemImpl#getName <em>Name</em>}</li> * <li>{@link net.certware.intent.intentSpecification.impl.DocItemImpl#getRef <em>Ref</em>}</li> * </ul> * * @generated */ public class DocItemImpl extends MinimalEObjectImpl.Container implements DocItem { /** * The cached value of the '{@link #getType() <em>Type</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getType() * @generated * @ordered */ protected DocItemType type; /** * The default value of the '{@link #getName() <em>Name</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getName() * @generated * @ordered */ protected static final String NAME_EDEFAULT = null; /** * The cached value of the '{@link #getName() <em>Name</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getName() * @generated * @ordered */ protected String name = NAME_EDEFAULT; /** * The default value of the '{@link #getRef() <em>Ref</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getRef() * @generated * @ordered */ protected static final String REF_EDEFAULT = null; /** * The cached value of the '{@link #getRef() <em>Ref</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getRef() * @generated * @ordered */ protected String ref = REF_EDEFAULT; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected DocItemImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return IntentSpecificationPackage.Literals.DOC_ITEM; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public DocItemType getType() { return type; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetType(DocItemType newType, NotificationChain msgs) { DocItemType oldType = type; type = newType; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, IntentSpecificationPackage.DOC_ITEM__TYPE, oldType, newType); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setType(DocItemType newType) { if (newType != type) { NotificationChain msgs = null; if (type != null) msgs = ((InternalEObject)type).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - IntentSpecificationPackage.DOC_ITEM__TYPE, null, msgs); if (newType != null) msgs = ((InternalEObject)newType).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - IntentSpecificationPackage.DOC_ITEM__TYPE, null, msgs); msgs = basicSetType(newType, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, IntentSpecificationPackage.DOC_ITEM__TYPE, newType, newType)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getName() { return name; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setName(String newName) { String oldName = name; name = newName; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, IntentSpecificationPackage.DOC_ITEM__NAME, oldName, name)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getRef() { return ref; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setRef(String newRef) { String oldRef = ref; ref = newRef; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, IntentSpecificationPackage.DOC_ITEM__REF, oldRef, ref)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case IntentSpecificationPackage.DOC_ITEM__TYPE: return basicSetType(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case IntentSpecificationPackage.DOC_ITEM__TYPE: return getType(); case IntentSpecificationPackage.DOC_ITEM__NAME: return getName(); case IntentSpecificationPackage.DOC_ITEM__REF: return getRef(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case IntentSpecificationPackage.DOC_ITEM__TYPE: setType((DocItemType)newValue); return; case IntentSpecificationPackage.DOC_ITEM__NAME: setName((String)newValue); return; case IntentSpecificationPackage.DOC_ITEM__REF: setRef((String)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case IntentSpecificationPackage.DOC_ITEM__TYPE: setType((DocItemType)null); return; case IntentSpecificationPackage.DOC_ITEM__NAME: setName(NAME_EDEFAULT); return; case IntentSpecificationPackage.DOC_ITEM__REF: setRef(REF_EDEFAULT); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case IntentSpecificationPackage.DOC_ITEM__TYPE: return type != null; case IntentSpecificationPackage.DOC_ITEM__NAME: return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); case IntentSpecificationPackage.DOC_ITEM__REF: return REF_EDEFAULT == null ? ref != null : !REF_EDEFAULT.equals(ref); } return super.eIsSet(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); result.append(" (name: "); result.append(name); result.append(", ref: "); result.append(ref); result.append(')'); return result.toString(); } } //DocItemImpl