|
a |
|
b/src/main/java/genericbcm/impl/LogicalGroupMemberLinkImpl.java |
|
|
1 |
/**
|
|
|
2 |
*/
|
|
|
3 |
package genericbcm.impl;
|
|
|
4 |
|
|
|
5 |
import genericbcm.GenericbcmPackage;
|
|
|
6 |
import genericbcm.LogicalGroup;
|
|
|
7 |
import genericbcm.LogicalGroupMemberLink;
|
|
|
8 |
import genericbcm.Unit;
|
|
|
9 |
|
|
|
10 |
import org.eclipse.emf.common.notify.Notification;
|
|
|
11 |
import org.eclipse.emf.common.notify.NotificationChain;
|
|
|
12 |
|
|
|
13 |
import org.eclipse.emf.ecore.EClass;
|
|
|
14 |
import org.eclipse.emf.ecore.InternalEObject;
|
|
|
15 |
|
|
|
16 |
import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
|
|
17 |
|
|
|
18 |
/**
|
|
|
19 |
* <!-- begin-user-doc -->
|
|
|
20 |
* An implementation of the model object '<em><b>Logical Group Member Link</b></em>'.
|
|
|
21 |
* <!-- end-user-doc -->
|
|
|
22 |
* <p>
|
|
|
23 |
* The following features are implemented:
|
|
|
24 |
* <ul>
|
|
|
25 |
* <li>{@link genericbcm.impl.LogicalGroupMemberLinkImpl#getFrom <em>From</em>}</li>
|
|
|
26 |
* <li>{@link genericbcm.impl.LogicalGroupMemberLinkImpl#getTo <em>To</em>}</li>
|
|
|
27 |
* </ul>
|
|
|
28 |
* </p>
|
|
|
29 |
*
|
|
|
30 |
* @generated
|
|
|
31 |
*/
|
|
|
32 |
public class LogicalGroupMemberLinkImpl extends NameableImpl implements LogicalGroupMemberLink {
|
|
|
33 |
/**
|
|
|
34 |
* The cached value of the '{@link #getFrom() <em>From</em>}' reference.
|
|
|
35 |
* <!-- begin-user-doc -->
|
|
|
36 |
* <!-- end-user-doc -->
|
|
|
37 |
* @see #getFrom()
|
|
|
38 |
* @generated
|
|
|
39 |
* @ordered
|
|
|
40 |
*/
|
|
|
41 |
protected LogicalGroup from;
|
|
|
42 |
|
|
|
43 |
/**
|
|
|
44 |
* The cached value of the '{@link #getTo() <em>To</em>}' reference.
|
|
|
45 |
* <!-- begin-user-doc -->
|
|
|
46 |
* <!-- end-user-doc -->
|
|
|
47 |
* @see #getTo()
|
|
|
48 |
* @generated
|
|
|
49 |
* @ordered
|
|
|
50 |
*/
|
|
|
51 |
protected Unit to;
|
|
|
52 |
|
|
|
53 |
/**
|
|
|
54 |
* <!-- begin-user-doc -->
|
|
|
55 |
* <!-- end-user-doc -->
|
|
|
56 |
* @generated
|
|
|
57 |
*/
|
|
|
58 |
protected LogicalGroupMemberLinkImpl() {
|
|
|
59 |
super();
|
|
|
60 |
}
|
|
|
61 |
|
|
|
62 |
/**
|
|
|
63 |
* <!-- begin-user-doc -->
|
|
|
64 |
* <!-- end-user-doc -->
|
|
|
65 |
* @generated
|
|
|
66 |
*/
|
|
|
67 |
@Override
|
|
|
68 |
protected EClass eStaticClass() {
|
|
|
69 |
return GenericbcmPackage.Literals.LOGICAL_GROUP_MEMBER_LINK;
|
|
|
70 |
}
|
|
|
71 |
|
|
|
72 |
/**
|
|
|
73 |
* <!-- begin-user-doc -->
|
|
|
74 |
* <!-- end-user-doc -->
|
|
|
75 |
* @generated
|
|
|
76 |
*/
|
|
|
77 |
public LogicalGroup getFrom() {
|
|
|
78 |
if (from != null && from.eIsProxy()) {
|
|
|
79 |
InternalEObject oldFrom = (InternalEObject)from;
|
|
|
80 |
from = (LogicalGroup)eResolveProxy(oldFrom);
|
|
|
81 |
if (from != oldFrom) {
|
|
|
82 |
if (eNotificationRequired())
|
|
|
83 |
eNotify(new ENotificationImpl(this, Notification.RESOLVE, GenericbcmPackage.LOGICAL_GROUP_MEMBER_LINK__FROM, oldFrom, from));
|
|
|
84 |
}
|
|
|
85 |
}
|
|
|
86 |
return from;
|
|
|
87 |
}
|
|
|
88 |
|
|
|
89 |
/**
|
|
|
90 |
* <!-- begin-user-doc -->
|
|
|
91 |
* <!-- end-user-doc -->
|
|
|
92 |
* @generated
|
|
|
93 |
*/
|
|
|
94 |
public LogicalGroup basicGetFrom() {
|
|
|
95 |
return from;
|
|
|
96 |
}
|
|
|
97 |
|
|
|
98 |
/**
|
|
|
99 |
* <!-- begin-user-doc -->
|
|
|
100 |
* <!-- end-user-doc -->
|
|
|
101 |
* @generated
|
|
|
102 |
*/
|
|
|
103 |
public void setFrom(LogicalGroup newFrom) {
|
|
|
104 |
LogicalGroup oldFrom = from;
|
|
|
105 |
from = newFrom;
|
|
|
106 |
if (eNotificationRequired())
|
|
|
107 |
eNotify(new ENotificationImpl(this, Notification.SET, GenericbcmPackage.LOGICAL_GROUP_MEMBER_LINK__FROM, oldFrom, from));
|
|
|
108 |
}
|
|
|
109 |
|
|
|
110 |
/**
|
|
|
111 |
* <!-- begin-user-doc -->
|
|
|
112 |
* <!-- end-user-doc -->
|
|
|
113 |
* @generated
|
|
|
114 |
*/
|
|
|
115 |
public Unit getTo() {
|
|
|
116 |
if (to != null && to.eIsProxy()) {
|
|
|
117 |
InternalEObject oldTo = (InternalEObject)to;
|
|
|
118 |
to = (Unit)eResolveProxy(oldTo);
|
|
|
119 |
if (to != oldTo) {
|
|
|
120 |
if (eNotificationRequired())
|
|
|
121 |
eNotify(new ENotificationImpl(this, Notification.RESOLVE, GenericbcmPackage.LOGICAL_GROUP_MEMBER_LINK__TO, oldTo, to));
|
|
|
122 |
}
|
|
|
123 |
}
|
|
|
124 |
return to;
|
|
|
125 |
}
|
|
|
126 |
|
|
|
127 |
/**
|
|
|
128 |
* <!-- begin-user-doc -->
|
|
|
129 |
* <!-- end-user-doc -->
|
|
|
130 |
* @generated
|
|
|
131 |
*/
|
|
|
132 |
public Unit basicGetTo() {
|
|
|
133 |
return to;
|
|
|
134 |
}
|
|
|
135 |
|
|
|
136 |
/**
|
|
|
137 |
* <!-- begin-user-doc -->
|
|
|
138 |
* <!-- end-user-doc -->
|
|
|
139 |
* @generated
|
|
|
140 |
*/
|
|
|
141 |
public NotificationChain basicSetTo(Unit newTo, NotificationChain msgs) {
|
|
|
142 |
Unit oldTo = to;
|
|
|
143 |
to = newTo;
|
|
|
144 |
if (eNotificationRequired()) {
|
|
|
145 |
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GenericbcmPackage.LOGICAL_GROUP_MEMBER_LINK__TO, oldTo, newTo);
|
|
|
146 |
if (msgs == null) msgs = notification; else msgs.add(notification);
|
|
|
147 |
}
|
|
|
148 |
return msgs;
|
|
|
149 |
}
|
|
|
150 |
|
|
|
151 |
/**
|
|
|
152 |
* <!-- begin-user-doc -->
|
|
|
153 |
* <!-- end-user-doc -->
|
|
|
154 |
* @generated
|
|
|
155 |
*/
|
|
|
156 |
public void setTo(Unit newTo) {
|
|
|
157 |
if (newTo != to) {
|
|
|
158 |
NotificationChain msgs = null;
|
|
|
159 |
if (to != null)
|
|
|
160 |
msgs = ((InternalEObject)to).eInverseRemove(this, GenericbcmPackage.UNIT__MEMBER_OF_LOGICAL_GROUP, Unit.class, msgs);
|
|
|
161 |
if (newTo != null)
|
|
|
162 |
msgs = ((InternalEObject)newTo).eInverseAdd(this, GenericbcmPackage.UNIT__MEMBER_OF_LOGICAL_GROUP, Unit.class, msgs);
|
|
|
163 |
msgs = basicSetTo(newTo, msgs);
|
|
|
164 |
if (msgs != null) msgs.dispatch();
|
|
|
165 |
}
|
|
|
166 |
else if (eNotificationRequired())
|
|
|
167 |
eNotify(new ENotificationImpl(this, Notification.SET, GenericbcmPackage.LOGICAL_GROUP_MEMBER_LINK__TO, newTo, newTo));
|
|
|
168 |
}
|
|
|
169 |
|
|
|
170 |
/**
|
|
|
171 |
* <!-- begin-user-doc -->
|
|
|
172 |
* <!-- end-user-doc -->
|
|
|
173 |
* @generated
|
|
|
174 |
*/
|
|
|
175 |
@Override
|
|
|
176 |
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
|
|
|
177 |
switch (featureID) {
|
|
|
178 |
case GenericbcmPackage.LOGICAL_GROUP_MEMBER_LINK__TO:
|
|
|
179 |
if (to != null)
|
|
|
180 |
msgs = ((InternalEObject)to).eInverseRemove(this, GenericbcmPackage.UNIT__MEMBER_OF_LOGICAL_GROUP, Unit.class, msgs);
|
|
|
181 |
return basicSetTo((Unit)otherEnd, msgs);
|
|
|
182 |
}
|
|
|
183 |
return super.eInverseAdd(otherEnd, featureID, msgs);
|
|
|
184 |
}
|
|
|
185 |
|
|
|
186 |
/**
|
|
|
187 |
* <!-- begin-user-doc -->
|
|
|
188 |
* <!-- end-user-doc -->
|
|
|
189 |
* @generated
|
|
|
190 |
*/
|
|
|
191 |
@Override
|
|
|
192 |
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
|
|
|
193 |
switch (featureID) {
|
|
|
194 |
case GenericbcmPackage.LOGICAL_GROUP_MEMBER_LINK__TO:
|
|
|
195 |
return basicSetTo(null, msgs);
|
|
|
196 |
}
|
|
|
197 |
return super.eInverseRemove(otherEnd, featureID, msgs);
|
|
|
198 |
}
|
|
|
199 |
|
|
|
200 |
/**
|
|
|
201 |
* <!-- begin-user-doc -->
|
|
|
202 |
* <!-- end-user-doc -->
|
|
|
203 |
* @generated
|
|
|
204 |
*/
|
|
|
205 |
@Override
|
|
|
206 |
public Object eGet(int featureID, boolean resolve, boolean coreType) {
|
|
|
207 |
switch (featureID) {
|
|
|
208 |
case GenericbcmPackage.LOGICAL_GROUP_MEMBER_LINK__FROM:
|
|
|
209 |
if (resolve) return getFrom();
|
|
|
210 |
return basicGetFrom();
|
|
|
211 |
case GenericbcmPackage.LOGICAL_GROUP_MEMBER_LINK__TO:
|
|
|
212 |
if (resolve) return getTo();
|
|
|
213 |
return basicGetTo();
|
|
|
214 |
}
|
|
|
215 |
return super.eGet(featureID, resolve, coreType);
|
|
|
216 |
}
|
|
|
217 |
|
|
|
218 |
/**
|
|
|
219 |
* <!-- begin-user-doc -->
|
|
|
220 |
* <!-- end-user-doc -->
|
|
|
221 |
* @generated
|
|
|
222 |
*/
|
|
|
223 |
@Override
|
|
|
224 |
public void eSet(int featureID, Object newValue) {
|
|
|
225 |
switch (featureID) {
|
|
|
226 |
case GenericbcmPackage.LOGICAL_GROUP_MEMBER_LINK__FROM:
|
|
|
227 |
setFrom((LogicalGroup)newValue);
|
|
|
228 |
return;
|
|
|
229 |
case GenericbcmPackage.LOGICAL_GROUP_MEMBER_LINK__TO:
|
|
|
230 |
setTo((Unit)newValue);
|
|
|
231 |
return;
|
|
|
232 |
}
|
|
|
233 |
super.eSet(featureID, newValue);
|
|
|
234 |
}
|
|
|
235 |
|
|
|
236 |
/**
|
|
|
237 |
* <!-- begin-user-doc -->
|
|
|
238 |
* <!-- end-user-doc -->
|
|
|
239 |
* @generated
|
|
|
240 |
*/
|
|
|
241 |
@Override
|
|
|
242 |
public void eUnset(int featureID) {
|
|
|
243 |
switch (featureID) {
|
|
|
244 |
case GenericbcmPackage.LOGICAL_GROUP_MEMBER_LINK__FROM:
|
|
|
245 |
setFrom((LogicalGroup)null);
|
|
|
246 |
return;
|
|
|
247 |
case GenericbcmPackage.LOGICAL_GROUP_MEMBER_LINK__TO:
|
|
|
248 |
setTo((Unit)null);
|
|
|
249 |
return;
|
|
|
250 |
}
|
|
|
251 |
super.eUnset(featureID);
|
|
|
252 |
}
|
|
|
253 |
|
|
|
254 |
/**
|
|
|
255 |
* <!-- begin-user-doc -->
|
|
|
256 |
* <!-- end-user-doc -->
|
|
|
257 |
* @generated
|
|
|
258 |
*/
|
|
|
259 |
@Override
|
|
|
260 |
public boolean eIsSet(int featureID) {
|
|
|
261 |
switch (featureID) {
|
|
|
262 |
case GenericbcmPackage.LOGICAL_GROUP_MEMBER_LINK__FROM:
|
|
|
263 |
return from != null;
|
|
|
264 |
case GenericbcmPackage.LOGICAL_GROUP_MEMBER_LINK__TO:
|
|
|
265 |
return to != null;
|
|
|
266 |
}
|
|
|
267 |
return super.eIsSet(featureID);
|
|
|
268 |
}
|
|
|
269 |
|
|
|
270 |
} //LogicalGroupMemberLinkImpl
|