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