| /** |
| * <copyright> |
| * </copyright> |
| * |
| * $Id: ListOfValuesImpl.java,v 1.4 2008/11/18 22:24:38 gkessler Exp $ |
| */ |
| package org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.internal.impl; |
| |
| import java.util.Collection; |
| |
| 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.impl.EObjectImpl; |
| |
| import org.eclipse.emf.ecore.util.EObjectContainmentEList; |
| import org.eclipse.emf.ecore.util.InternalEList; |
| |
| import org.eclipse.emf.ecore.xml.type.SimpleAnyType; |
| |
| import org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.ListOfValues; |
| import org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.TraitTypesPackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>List Of Values</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.internal.impl.ListOfValuesImpl#getEntries <em>Entries</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class ListOfValuesImpl extends EObjectImpl implements ListOfValues { |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static final String copyright = "Copyright (c) 2007 Oracle Corporation"; //$NON-NLS-1$ |
| |
| /** |
| * 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 entries = null; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected ListOfValuesImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected EClass eStaticClass() { |
| return TraitTypesPackage.Literals.LIST_OF_VALUES; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList getEntries() { |
| if (entries == null) { |
| entries = new EObjectContainmentEList(SimpleAnyType.class, this, TraitTypesPackage.LIST_OF_VALUES__ENTRIES); |
| } |
| return entries; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case TraitTypesPackage.LIST_OF_VALUES__ENTRIES: |
| return ((InternalEList)getEntries()).basicRemove(otherEnd, msgs); |
| } |
| return super.eInverseRemove(otherEnd, featureID, msgs); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case TraitTypesPackage.LIST_OF_VALUES__ENTRIES: |
| return getEntries(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case TraitTypesPackage.LIST_OF_VALUES__ENTRIES: |
| getEntries().clear(); |
| getEntries().addAll((Collection)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case TraitTypesPackage.LIST_OF_VALUES__ENTRIES: |
| getEntries().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case TraitTypesPackage.LIST_OF_VALUES__ENTRIES: |
| return entries != null && !entries.isEmpty(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //ListOfValuesImpl |