/** * Copyright (c) 2010 Martin Schnabel <mb0@mb0.org> 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 */ package org.axdt.as3.model.impl; import org.axdt.as3.As3EPackage; import org.axdt.as3.model.As3TypeParameter; import org.axdt.avm.model.AvmType; import org.axdt.avm.util.AvmTypeAccess; 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>As3 Type Parameter</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link org.axdt.as3.model.impl.As3TypeParameterImpl#getParameter <em>Parameter</em>}</li> * </ul> * </p> * * @generated */ public class As3TypeParameterImpl extends As3PostfixExpressionImpl implements As3TypeParameter { /** * The cached value of the '{@link #getParameter() <em>Parameter</em>}' reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getParameter() * @generated * @ordered */ protected AvmType parameter; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected As3TypeParameterImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return As3EPackage.Literals.AS3_TYPE_PARAMETER; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public AvmType getParameter() { if (parameter != null && parameter.eIsProxy()) { InternalEObject oldParameter = (InternalEObject)parameter; parameter = (AvmType)eResolveProxy(oldParameter); if (parameter != oldParameter) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, As3EPackage.AS3_TYPE_PARAMETER__PARAMETER, oldParameter, parameter)); } } return parameter; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public AvmType basicGetParameter() { return parameter; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setParameter(AvmType newParameter) { AvmType oldParameter = parameter; parameter = newParameter; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, As3EPackage.AS3_TYPE_PARAMETER__PARAMETER, oldParameter, parameter)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case As3EPackage.AS3_TYPE_PARAMETER__PARAMETER: if (resolve) return getParameter(); return basicGetParameter(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case As3EPackage.AS3_TYPE_PARAMETER__PARAMETER: setParameter((AvmType)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case As3EPackage.AS3_TYPE_PARAMETER__PARAMETER: setParameter((AvmType)null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case As3EPackage.AS3_TYPE_PARAMETER__PARAMETER: return parameter != null; } return super.eIsSet(featureID); } @Override public AvmTypeAccess resolveType() { if (getExpression() != null) return getExpression().resolveType(); return AvmTypeAccess.NULL; } } //As3TypeParameterImpl