| /** |
| * Copyright (c) 2011 NumberFour AG |
| * |
| * This program and the accompanying materials are made available under the |
| * terms of the Eclipse Public License v. 2.0 which is available at |
| * http://www.eclipse.org/legal/epl-2.0. |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Contributors: |
| * NumberFour AG - initial API and Implementation (Alex Panchenko) |
| */ |
| package org.eclipse.dltk.javascript.typeinfo.model.impl; |
| |
| import java.util.Collection; |
| |
| import org.eclipse.dltk.javascript.typeinfo.model.GenericMethod; |
| import org.eclipse.dltk.javascript.typeinfo.model.TypeInfoModelPackage; |
| import org.eclipse.dltk.javascript.typeinfo.model.TypeVariable; |
| |
| import org.eclipse.emf.common.notify.NotificationChain; |
| |
| import org.eclipse.emf.common.util.EList; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.InternalEObject; |
| |
| import org.eclipse.emf.ecore.util.EObjectContainmentEList; |
| import org.eclipse.emf.ecore.util.InternalEList; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Generic Method</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.dltk.javascript.typeinfo.model.impl.GenericMethodImpl#getTypeParameters <em>Type Parameters</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class GenericMethodImpl extends MethodImpl implements GenericMethod { |
| /** |
| * The cached value of the '{@link #getTypeParameters() <em>Type Parameters</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getTypeParameters() |
| * @generated |
| * @ordered |
| */ |
| protected EList<TypeVariable> typeParameters; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected GenericMethodImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return TypeInfoModelPackage.Literals.GENERIC_METHOD; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<TypeVariable> getTypeParameters() { |
| if (typeParameters == null) { |
| typeParameters = new EObjectContainmentEList<TypeVariable>(TypeVariable.class, this, TypeInfoModelPackage.GENERIC_METHOD__TYPE_PARAMETERS); |
| } |
| return typeParameters; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case TypeInfoModelPackage.GENERIC_METHOD__TYPE_PARAMETERS: |
| return ((InternalEList<?>)getTypeParameters()).basicRemove(otherEnd, 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 TypeInfoModelPackage.GENERIC_METHOD__TYPE_PARAMETERS: |
| return getTypeParameters(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @SuppressWarnings("unchecked") |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case TypeInfoModelPackage.GENERIC_METHOD__TYPE_PARAMETERS: |
| getTypeParameters().clear(); |
| getTypeParameters().addAll((Collection<? extends TypeVariable>)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case TypeInfoModelPackage.GENERIC_METHOD__TYPE_PARAMETERS: |
| getTypeParameters().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case TypeInfoModelPackage.GENERIC_METHOD__TYPE_PARAMETERS: |
| return typeParameters != null && !typeParameters.isEmpty(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //GenericMethodImpl |