| /******************************************************************************* |
| * Copyright (c) 2009, 2019 Xored Software Inc and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v2.0 |
| * which accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-v20.html |
| * |
| * Contributors: |
| * Xored Software Inc - initial API and implementation and/or initial documentation |
| *******************************************************************************/ |
| package org.eclipse.rcptt.debug.impl; |
| |
| import org.eclipse.rcptt.core.scenario.NamedElement; |
| |
| import org.eclipse.rcptt.core.scenario.impl.NamedElementImpl; |
| |
| import org.eclipse.rcptt.debug.Collection; |
| import org.eclipse.rcptt.debug.DebugPackage; |
| |
| 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>Collection</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.rcptt.debug.impl.CollectionImpl#getEntries <em>Entries</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class CollectionImpl extends NamedElementImpl implements Collection { |
| /** |
| * The cached value of the '{@link #getEntries() <em>Entries</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getEntries() |
| * @generated |
| * @ordered |
| */ |
| protected EList<NamedElement> entries; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected CollectionImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return DebugPackage.Literals.COLLECTION; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<NamedElement> getEntries() { |
| if (entries == null) { |
| entries = new EObjectContainmentEList<NamedElement>(NamedElement.class, this, DebugPackage.COLLECTION__ENTRIES); |
| } |
| return entries; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case DebugPackage.COLLECTION__ENTRIES: |
| return ((InternalEList<?>)getEntries()).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 DebugPackage.COLLECTION__ENTRIES: |
| return getEntries(); |
| } |
| 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 DebugPackage.COLLECTION__ENTRIES: |
| getEntries().clear(); |
| getEntries().addAll((java.util.Collection<? extends NamedElement>)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case DebugPackage.COLLECTION__ENTRIES: |
| getEntries().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case DebugPackage.COLLECTION__ENTRIES: |
| return entries != null && !entries.isEmpty(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //CollectionImpl |