/******************************************************************************* * Copyright (c) 2003, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.jem.internal.instantiation.impl; /* */ import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.jem.internal.instantiation.ImplicitAllocation; import org.eclipse.jem.internal.instantiation.InstantiationPackage; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Implicit Allocation</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link org.eclipse.jem.internal.instantiation.impl.ImplicitAllocationImpl#getParent <em>Parent</em>}</li> * <li>{@link org.eclipse.jem.internal.instantiation.impl.ImplicitAllocationImpl#getFeature <em>Feature</em>}</li> * </ul> * </p> * * @generated */ public class ImplicitAllocationImpl extends JavaAllocationImpl implements ImplicitAllocation { /** * The cached value of the '{@link #getParent() <em>Parent</em>}' reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getParent() * @generated * @ordered */ protected EObject parent = null; /** * The cached value of the '{@link #getFeature() <em>Feature</em>}' reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getFeature() * @generated * @ordered */ protected EStructuralFeature feature = null; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected ImplicitAllocationImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected EClass eStaticClass() { return InstantiationPackage.eINSTANCE.getImplicitAllocation(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EObject getParent() { if (parent != null && parent.eIsProxy()) { EObject oldParent = parent; parent = eResolveProxy((InternalEObject)parent); if (parent != oldParent) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, InstantiationPackage.IMPLICIT_ALLOCATION__PARENT, oldParent, parent)); } } return parent; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EObject basicGetParent() { return parent; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setParent(EObject newParent) { EObject oldParent = parent; parent = newParent; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, InstantiationPackage.IMPLICIT_ALLOCATION__PARENT, oldParent, parent)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EStructuralFeature getFeature() { if (feature != null && feature.eIsProxy()) { EStructuralFeature oldFeature = feature; feature = (EStructuralFeature)eResolveProxy((InternalEObject)feature); if (feature != oldFeature) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, InstantiationPackage.IMPLICIT_ALLOCATION__FEATURE, oldFeature, feature)); } } return feature; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EStructuralFeature basicGetFeature() { return feature; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setFeature(EStructuralFeature newFeature) { EStructuralFeature oldFeature = feature; feature = newFeature; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, InstantiationPackage.IMPLICIT_ALLOCATION__FEATURE, oldFeature, feature)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Object eGet(EStructuralFeature eFeature, boolean resolve) { switch (eDerivedStructuralFeatureID(eFeature)) { case InstantiationPackage.IMPLICIT_ALLOCATION__PARENT: if (resolve) return getParent(); return basicGetParent(); case InstantiationPackage.IMPLICIT_ALLOCATION__FEATURE: if (resolve) return getFeature(); return basicGetFeature(); } return eDynamicGet(eFeature, resolve); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void eSet(EStructuralFeature eFeature, Object newValue) { switch (eDerivedStructuralFeatureID(eFeature)) { case InstantiationPackage.IMPLICIT_ALLOCATION__PARENT: setParent((EObject)newValue); return; case InstantiationPackage.IMPLICIT_ALLOCATION__FEATURE: setFeature((EStructuralFeature)newValue); return; } eDynamicSet(eFeature, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void eUnset(EStructuralFeature eFeature) { switch (eDerivedStructuralFeatureID(eFeature)) { case InstantiationPackage.IMPLICIT_ALLOCATION__PARENT: setParent((EObject)null); return; case InstantiationPackage.IMPLICIT_ALLOCATION__FEATURE: setFeature((EStructuralFeature)null); return; } eDynamicUnset(eFeature); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public boolean eIsSet(EStructuralFeature eFeature) { switch (eDerivedStructuralFeatureID(eFeature)) { case InstantiationPackage.IMPLICIT_ALLOCATION__PARENT: return parent != null; case InstantiationPackage.IMPLICIT_ALLOCATION__FEATURE: return feature != null; } return eDynamicIsSet(eFeature); } public String toString() { return "ImplicitAllocation(" + getParent() + "-" + getFeature(); } public boolean isImplicit() { return true; } } //ImplicitAllocationImpl