| 1 | /** |
| 2 | * <copyright> |
| 3 | * </copyright> |
| 4 | * |
| 5 | * $Id$ |
| 6 | */ |
| 7 | package LqnCore.impl; |
| 8 | |
| 9 | import LqnCore.ActivityListType; |
| 10 | import LqnCore.ActivityType; |
| 11 | import LqnCore.LqnCorePackage; |
| 12 | |
| 13 | import java.util.Collection; |
| 14 | |
| 15 | import org.eclipse.emf.common.notify.NotificationChain; |
| 16 | |
| 17 | import org.eclipse.emf.common.util.EList; |
| 18 | |
| 19 | import org.eclipse.emf.ecore.EClass; |
| 20 | import org.eclipse.emf.ecore.InternalEObject; |
| 21 | |
| 22 | import org.eclipse.emf.ecore.impl.EObjectImpl; |
| 23 | |
| 24 | import org.eclipse.emf.ecore.util.EObjectContainmentEList; |
| 25 | import org.eclipse.emf.ecore.util.InternalEList; |
| 26 | |
| 27 | /** |
| 28 | * <!-- begin-user-doc --> |
| 29 | * An implementation of the model object '<em><b>Activity List Type</b></em>'. |
| 30 | * <!-- end-user-doc --> |
| 31 | * <p> |
| 32 | * The following features are implemented: |
| 33 | * <ul> |
| 34 | * <li>{@link LqnCore.impl.ActivityListTypeImpl#getActivity <em>Activity</em>}</li> |
| 35 | * </ul> |
| 36 | * </p> |
| 37 | * |
| 38 | * @generated |
| 39 | */ |
| 40 | public class ActivityListTypeImpl extends EObjectImpl implements ActivityListType { |
| 41 | /** |
| 42 | * The cached value of the '{@link #getActivity() <em>Activity</em>}' containment reference list. |
| 43 | * <!-- begin-user-doc --> |
| 44 | * <!-- end-user-doc --> |
| 45 | * @see #getActivity() |
| 46 | * @generated |
| 47 | * @ordered |
| 48 | */ |
| 49 | protected EList<ActivityType> activity; |
| 50 | |
| 51 | /** |
| 52 | * <!-- begin-user-doc --> |
| 53 | * <!-- end-user-doc --> |
| 54 | * @generated |
| 55 | */ |
| 56 | protected ActivityListTypeImpl() { |
| 57 | super(); |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * <!-- begin-user-doc --> |
| 62 | * <!-- end-user-doc --> |
| 63 | * @generated |
| 64 | */ |
| 65 | @Override |
| 66 | protected EClass eStaticClass() { |
| 67 | return LqnCorePackage.Literals.ACTIVITY_LIST_TYPE; |
| 68 | } |
| 69 | |
| 70 | /** |
| 71 | * <!-- begin-user-doc --> |
| 72 | * <!-- end-user-doc --> |
| 73 | * @generated |
| 74 | */ |
| 75 | public EList<ActivityType> getActivity() { |
| 76 | if (activity == null) { |
| 77 | activity = new EObjectContainmentEList<ActivityType>(ActivityType.class, this, LqnCorePackage.ACTIVITY_LIST_TYPE__ACTIVITY); |
| 78 | } |
| 79 | return activity; |
| 80 | } |
| 81 | |
| 82 | /** |
| 83 | * <!-- begin-user-doc --> |
| 84 | * <!-- end-user-doc --> |
| 85 | * @generated |
| 86 | */ |
| 87 | @Override |
| 88 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| 89 | switch (featureID) { |
| 90 | case LqnCorePackage.ACTIVITY_LIST_TYPE__ACTIVITY: |
| 91 | return ((InternalEList<?>)getActivity()).basicRemove(otherEnd, msgs); |
| 92 | } |
| 93 | return super.eInverseRemove(otherEnd, featureID, msgs); |
| 94 | } |
| 95 | |
| 96 | /** |
| 97 | * <!-- begin-user-doc --> |
| 98 | * <!-- end-user-doc --> |
| 99 | * @generated |
| 100 | */ |
| 101 | @Override |
| 102 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| 103 | switch (featureID) { |
| 104 | case LqnCorePackage.ACTIVITY_LIST_TYPE__ACTIVITY: |
| 105 | return getActivity(); |
| 106 | } |
| 107 | return super.eGet(featureID, resolve, coreType); |
| 108 | } |
| 109 | |
| 110 | /** |
| 111 | * <!-- begin-user-doc --> |
| 112 | * <!-- end-user-doc --> |
| 113 | * @generated |
| 114 | */ |
| 115 | @SuppressWarnings("unchecked") |
| 116 | @Override |
| 117 | public void eSet(int featureID, Object newValue) { |
| 118 | switch (featureID) { |
| 119 | case LqnCorePackage.ACTIVITY_LIST_TYPE__ACTIVITY: |
| 120 | getActivity().clear(); |
| 121 | getActivity().addAll((Collection<? extends ActivityType>)newValue); |
| 122 | return; |
| 123 | } |
| 124 | super.eSet(featureID, newValue); |
| 125 | } |
| 126 | |
| 127 | /** |
| 128 | * <!-- begin-user-doc --> |
| 129 | * <!-- end-user-doc --> |
| 130 | * @generated |
| 131 | */ |
| 132 | @Override |
| 133 | public void eUnset(int featureID) { |
| 134 | switch (featureID) { |
| 135 | case LqnCorePackage.ACTIVITY_LIST_TYPE__ACTIVITY: |
| 136 | getActivity().clear(); |
| 137 | return; |
| 138 | } |
| 139 | super.eUnset(featureID); |
| 140 | } |
| 141 | |
| 142 | /** |
| 143 | * <!-- begin-user-doc --> |
| 144 | * <!-- end-user-doc --> |
| 145 | * @generated |
| 146 | */ |
| 147 | @Override |
| 148 | public boolean eIsSet(int featureID) { |
| 149 | switch (featureID) { |
| 150 | case LqnCorePackage.ACTIVITY_LIST_TYPE__ACTIVITY: |
| 151 | return activity != null && !activity.isEmpty(); |
| 152 | } |
| 153 | return super.eIsSet(featureID); |
| 154 | } |
| 155 | |
| 156 | } //ActivityListTypeImpl |