| package comps.impl; |
| |
| |
| import comps.Component; |
| import comps.ComponentInstance; |
| import comps.CompsPackage; |
| 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; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Component Instance</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link comps.impl.ComponentInstanceImpl#getPrototype <em>Prototype</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class ComponentInstanceImpl extends ComponentImpl implements ComponentInstance { |
| /** |
| * The cached value of the '{@link #getPrototype() <em>Prototype</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getPrototype() |
| * @generated |
| * @ordered |
| */ |
| protected Component prototype; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected ComponentInstanceImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return CompsPackage.Literals.COMPONENT_INSTANCE; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Component getPrototype() { |
| if (prototype != null && prototype.eIsProxy()) { |
| InternalEObject oldPrototype = (InternalEObject)prototype; |
| prototype = (Component)eResolveProxy(oldPrototype); |
| if (prototype != oldPrototype) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, CompsPackage.COMPONENT_INSTANCE__PROTOTYPE, oldPrototype, prototype)); |
| } |
| } |
| return prototype; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Component basicGetPrototype() { |
| return prototype; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setPrototype(Component newPrototype) { |
| Component oldPrototype = prototype; |
| prototype = newPrototype; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, CompsPackage.COMPONENT_INSTANCE__PROTOTYPE, oldPrototype, prototype)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case CompsPackage.COMPONENT_INSTANCE__PROTOTYPE: |
| if (resolve) return getPrototype(); |
| return basicGetPrototype(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case CompsPackage.COMPONENT_INSTANCE__PROTOTYPE: |
| setPrototype((Component)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case CompsPackage.COMPONENT_INSTANCE__PROTOTYPE: |
| setPrototype((Component)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case CompsPackage.COMPONENT_INSTANCE__PROTOTYPE: |
| return prototype != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| |
| /** |
| * @generated |
| */ |
| @Override |
| public java.lang.String getName() { |
| if (name == null) { |
| return prototype.getName(); |
| } |
| else return name; |
| } |
| |
| /** |
| * @generated |
| */ |
| @Override |
| public java.lang.String getAction() { |
| if (action == null) { |
| return prototype.getAction(); |
| } |
| else return action; |
| } |
| } //ComponentInstanceImpl (Patched) |