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