1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package EMOF.impl; |
8 | |
9 | import EMOF.EMOFPackage; |
10 | import EMOF.MultiplicityElement; |
11 | import EMOF.Property; |
12 | |
13 | import org.eclipse.emf.common.notify.Notification; |
14 | import org.eclipse.emf.common.notify.NotificationChain; |
15 | |
16 | import org.eclipse.emf.ecore.EClass; |
17 | import org.eclipse.emf.ecore.InternalEObject; |
18 | |
19 | import org.eclipse.emf.ecore.impl.ENotificationImpl; |
20 | |
21 | import org.eclipse.emf.ecore.util.EcoreUtil; |
22 | |
23 | /** |
24 | * <!-- begin-user-doc --> |
25 | * An implementation of the model object '<em><b>Property</b></em>'. |
26 | * <!-- end-user-doc --> |
27 | * <p> |
28 | * The following features are implemented: |
29 | * <ul> |
30 | * <li>{@link EMOF.impl.PropertyImpl#getIsOrdered <em>Is Ordered</em>}</li> |
31 | * <li>{@link EMOF.impl.PropertyImpl#getIsUnique <em>Is Unique</em>}</li> |
32 | * <li>{@link EMOF.impl.PropertyImpl#getLower <em>Lower</em>}</li> |
33 | * <li>{@link EMOF.impl.PropertyImpl#getUpper <em>Upper</em>}</li> |
34 | * <li>{@link EMOF.impl.PropertyImpl#getClass_ <em>Class</em>}</li> |
35 | * <li>{@link EMOF.impl.PropertyImpl#getDefault <em>Default</em>}</li> |
36 | * <li>{@link EMOF.impl.PropertyImpl#getIsComposite <em>Is Composite</em>}</li> |
37 | * <li>{@link EMOF.impl.PropertyImpl#getIsDerived <em>Is Derived</em>}</li> |
38 | * <li>{@link EMOF.impl.PropertyImpl#getIsID <em>Is ID</em>}</li> |
39 | * <li>{@link EMOF.impl.PropertyImpl#getIsReadOnly <em>Is Read Only</em>}</li> |
40 | * <li>{@link EMOF.impl.PropertyImpl#getOpposite <em>Opposite</em>}</li> |
41 | * </ul> |
42 | * </p> |
43 | * |
44 | * @generated |
45 | */ |
46 | public class PropertyImpl extends TypedElementImpl implements Property { |
47 | /** |
48 | * The default value of the '{@link #getIsOrdered() <em>Is Ordered</em>}' attribute. |
49 | * <!-- begin-user-doc --> |
50 | * <!-- end-user-doc --> |
51 | * @see #getIsOrdered() |
52 | * @generated |
53 | * @ordered |
54 | */ |
55 | protected static final Boolean IS_ORDERED_EDEFAULT = Boolean.FALSE; |
56 | |
57 | /** |
58 | * The cached value of the '{@link #getIsOrdered() <em>Is Ordered</em>}' attribute. |
59 | * <!-- begin-user-doc --> |
60 | * <!-- end-user-doc --> |
61 | * @see #getIsOrdered() |
62 | * @generated |
63 | * @ordered |
64 | */ |
65 | protected Boolean isOrdered = IS_ORDERED_EDEFAULT; |
66 | |
67 | /** |
68 | * The default value of the '{@link #getIsUnique() <em>Is Unique</em>}' attribute. |
69 | * <!-- begin-user-doc --> |
70 | * <!-- end-user-doc --> |
71 | * @see #getIsUnique() |
72 | * @generated |
73 | * @ordered |
74 | */ |
75 | protected static final Boolean IS_UNIQUE_EDEFAULT = Boolean.TRUE; |
76 | |
77 | /** |
78 | * The cached value of the '{@link #getIsUnique() <em>Is Unique</em>}' attribute. |
79 | * <!-- begin-user-doc --> |
80 | * <!-- end-user-doc --> |
81 | * @see #getIsUnique() |
82 | * @generated |
83 | * @ordered |
84 | */ |
85 | protected Boolean isUnique = IS_UNIQUE_EDEFAULT; |
86 | |
87 | /** |
88 | * The default value of the '{@link #getLower() <em>Lower</em>}' attribute. |
89 | * <!-- begin-user-doc --> |
90 | * <!-- end-user-doc --> |
91 | * @see #getLower() |
92 | * @generated |
93 | * @ordered |
94 | */ |
95 | protected static final Integer LOWER_EDEFAULT = new Integer(1); |
96 | |
97 | /** |
98 | * The cached value of the '{@link #getLower() <em>Lower</em>}' attribute. |
99 | * <!-- begin-user-doc --> |
100 | * <!-- end-user-doc --> |
101 | * @see #getLower() |
102 | * @generated |
103 | * @ordered |
104 | */ |
105 | protected Integer lower = LOWER_EDEFAULT; |
106 | |
107 | /** |
108 | * The default value of the '{@link #getUpper() <em>Upper</em>}' attribute. |
109 | * <!-- begin-user-doc --> |
110 | * <!-- end-user-doc --> |
111 | * @see #getUpper() |
112 | * @generated |
113 | * @ordered |
114 | */ |
115 | protected static final Integer UPPER_EDEFAULT = new Integer(1); |
116 | |
117 | /** |
118 | * The cached value of the '{@link #getUpper() <em>Upper</em>}' attribute. |
119 | * <!-- begin-user-doc --> |
120 | * <!-- end-user-doc --> |
121 | * @see #getUpper() |
122 | * @generated |
123 | * @ordered |
124 | */ |
125 | protected Integer upper = UPPER_EDEFAULT; |
126 | |
127 | /** |
128 | * The default value of the '{@link #getDefault() <em>Default</em>}' attribute. |
129 | * <!-- begin-user-doc --> |
130 | * <!-- end-user-doc --> |
131 | * @see #getDefault() |
132 | * @generated |
133 | * @ordered |
134 | */ |
135 | protected static final String DEFAULT_EDEFAULT = null; |
136 | |
137 | /** |
138 | * The cached value of the '{@link #getDefault() <em>Default</em>}' attribute. |
139 | * <!-- begin-user-doc --> |
140 | * <!-- end-user-doc --> |
141 | * @see #getDefault() |
142 | * @generated |
143 | * @ordered |
144 | */ |
145 | protected String default_ = DEFAULT_EDEFAULT; |
146 | |
147 | /** |
148 | * The default value of the '{@link #getIsComposite() <em>Is Composite</em>}' attribute. |
149 | * <!-- begin-user-doc --> |
150 | * <!-- end-user-doc --> |
151 | * @see #getIsComposite() |
152 | * @generated |
153 | * @ordered |
154 | */ |
155 | protected static final Boolean IS_COMPOSITE_EDEFAULT = Boolean.FALSE; |
156 | |
157 | /** |
158 | * The cached value of the '{@link #getIsComposite() <em>Is Composite</em>}' attribute. |
159 | * <!-- begin-user-doc --> |
160 | * <!-- end-user-doc --> |
161 | * @see #getIsComposite() |
162 | * @generated |
163 | * @ordered |
164 | */ |
165 | protected Boolean isComposite = IS_COMPOSITE_EDEFAULT; |
166 | |
167 | /** |
168 | * The default value of the '{@link #getIsDerived() <em>Is Derived</em>}' attribute. |
169 | * <!-- begin-user-doc --> |
170 | * <!-- end-user-doc --> |
171 | * @see #getIsDerived() |
172 | * @generated |
173 | * @ordered |
174 | */ |
175 | protected static final Boolean IS_DERIVED_EDEFAULT = Boolean.FALSE; |
176 | |
177 | /** |
178 | * The cached value of the '{@link #getIsDerived() <em>Is Derived</em>}' attribute. |
179 | * <!-- begin-user-doc --> |
180 | * <!-- end-user-doc --> |
181 | * @see #getIsDerived() |
182 | * @generated |
183 | * @ordered |
184 | */ |
185 | protected Boolean isDerived = IS_DERIVED_EDEFAULT; |
186 | |
187 | /** |
188 | * The default value of the '{@link #getIsID() <em>Is ID</em>}' attribute. |
189 | * <!-- begin-user-doc --> |
190 | * <!-- end-user-doc --> |
191 | * @see #getIsID() |
192 | * @generated |
193 | * @ordered |
194 | */ |
195 | protected static final Boolean IS_ID_EDEFAULT = null; |
196 | |
197 | /** |
198 | * The cached value of the '{@link #getIsID() <em>Is ID</em>}' attribute. |
199 | * <!-- begin-user-doc --> |
200 | * <!-- end-user-doc --> |
201 | * @see #getIsID() |
202 | * @generated |
203 | * @ordered |
204 | */ |
205 | protected Boolean isID = IS_ID_EDEFAULT; |
206 | |
207 | /** |
208 | * The default value of the '{@link #getIsReadOnly() <em>Is Read Only</em>}' attribute. |
209 | * <!-- begin-user-doc --> |
210 | * <!-- end-user-doc --> |
211 | * @see #getIsReadOnly() |
212 | * @generated |
213 | * @ordered |
214 | */ |
215 | protected static final Boolean IS_READ_ONLY_EDEFAULT = Boolean.FALSE; |
216 | |
217 | /** |
218 | * The cached value of the '{@link #getIsReadOnly() <em>Is Read Only</em>}' attribute. |
219 | * <!-- begin-user-doc --> |
220 | * <!-- end-user-doc --> |
221 | * @see #getIsReadOnly() |
222 | * @generated |
223 | * @ordered |
224 | */ |
225 | protected Boolean isReadOnly = IS_READ_ONLY_EDEFAULT; |
226 | |
227 | /** |
228 | * The cached value of the '{@link #getOpposite() <em>Opposite</em>}' reference. |
229 | * <!-- begin-user-doc --> |
230 | * <!-- end-user-doc --> |
231 | * @see #getOpposite() |
232 | * @generated |
233 | * @ordered |
234 | */ |
235 | protected Property opposite; |
236 | |
237 | /** |
238 | * <!-- begin-user-doc --> |
239 | * <!-- end-user-doc --> |
240 | * @generated |
241 | */ |
242 | protected PropertyImpl() { |
243 | super(); |
244 | } |
245 | |
246 | /** |
247 | * <!-- begin-user-doc --> |
248 | * <!-- end-user-doc --> |
249 | * @generated |
250 | */ |
251 | @Override |
252 | protected EClass eStaticClass() { |
253 | return EMOFPackage.Literals.PROPERTY; |
254 | } |
255 | |
256 | /** |
257 | * <!-- begin-user-doc --> |
258 | * <!-- end-user-doc --> |
259 | * @generated |
260 | */ |
261 | public Boolean getIsOrdered() { |
262 | return isOrdered; |
263 | } |
264 | |
265 | /** |
266 | * <!-- begin-user-doc --> |
267 | * <!-- end-user-doc --> |
268 | * @generated |
269 | */ |
270 | public void setIsOrdered(Boolean newIsOrdered) { |
271 | Boolean oldIsOrdered = isOrdered; |
272 | isOrdered = newIsOrdered; |
273 | if (eNotificationRequired()) |
274 | eNotify(new ENotificationImpl(this, Notification.SET, EMOFPackage.PROPERTY__IS_ORDERED, oldIsOrdered, isOrdered)); |
275 | } |
276 | |
277 | /** |
278 | * <!-- begin-user-doc --> |
279 | * <!-- end-user-doc --> |
280 | * @generated |
281 | */ |
282 | public Boolean getIsUnique() { |
283 | return isUnique; |
284 | } |
285 | |
286 | /** |
287 | * <!-- begin-user-doc --> |
288 | * <!-- end-user-doc --> |
289 | * @generated |
290 | */ |
291 | public void setIsUnique(Boolean newIsUnique) { |
292 | Boolean oldIsUnique = isUnique; |
293 | isUnique = newIsUnique; |
294 | if (eNotificationRequired()) |
295 | eNotify(new ENotificationImpl(this, Notification.SET, EMOFPackage.PROPERTY__IS_UNIQUE, oldIsUnique, isUnique)); |
296 | } |
297 | |
298 | /** |
299 | * <!-- begin-user-doc --> |
300 | * <!-- end-user-doc --> |
301 | * @generated |
302 | */ |
303 | public Integer getLower() { |
304 | return lower; |
305 | } |
306 | |
307 | /** |
308 | * <!-- begin-user-doc --> |
309 | * <!-- end-user-doc --> |
310 | * @generated |
311 | */ |
312 | public void setLower(Integer newLower) { |
313 | Integer oldLower = lower; |
314 | lower = newLower; |
315 | if (eNotificationRequired()) |
316 | eNotify(new ENotificationImpl(this, Notification.SET, EMOFPackage.PROPERTY__LOWER, oldLower, lower)); |
317 | } |
318 | |
319 | /** |
320 | * <!-- begin-user-doc --> |
321 | * <!-- end-user-doc --> |
322 | * @generated |
323 | */ |
324 | public Integer getUpper() { |
325 | return upper; |
326 | } |
327 | |
328 | /** |
329 | * <!-- begin-user-doc --> |
330 | * <!-- end-user-doc --> |
331 | * @generated |
332 | */ |
333 | public void setUpper(Integer newUpper) { |
334 | Integer oldUpper = upper; |
335 | upper = newUpper; |
336 | if (eNotificationRequired()) |
337 | eNotify(new ENotificationImpl(this, Notification.SET, EMOFPackage.PROPERTY__UPPER, oldUpper, upper)); |
338 | } |
339 | |
340 | /** |
341 | * <!-- begin-user-doc --> |
342 | * <!-- end-user-doc --> |
343 | * @generated |
344 | */ |
345 | public EMOF.Class getClass_() { |
346 | if (eContainerFeatureID() != EMOFPackage.PROPERTY__CLASS) return null; |
347 | return (EMOF.Class)eContainer(); |
348 | } |
349 | |
350 | /** |
351 | * <!-- begin-user-doc --> |
352 | * <!-- end-user-doc --> |
353 | * @generated |
354 | */ |
355 | public NotificationChain basicSetClass(EMOF.Class newClass, NotificationChain msgs) { |
356 | msgs = eBasicSetContainer((InternalEObject)newClass, EMOFPackage.PROPERTY__CLASS, msgs); |
357 | return msgs; |
358 | } |
359 | |
360 | /** |
361 | * <!-- begin-user-doc --> |
362 | * <!-- end-user-doc --> |
363 | * @generated |
364 | */ |
365 | public void setClass(EMOF.Class newClass) { |
366 | if (newClass != eInternalContainer() || (eContainerFeatureID() != EMOFPackage.PROPERTY__CLASS && newClass != null)) { |
367 | if (EcoreUtil.isAncestor(this, newClass)) |
368 | throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); |
369 | NotificationChain msgs = null; |
370 | if (eInternalContainer() != null) |
371 | msgs = eBasicRemoveFromContainer(msgs); |
372 | if (newClass != null) |
373 | msgs = ((InternalEObject)newClass).eInverseAdd(this, EMOFPackage.CLASS__OWNED_ATTRIBUTE, EMOF.Class.class, msgs); |
374 | msgs = basicSetClass(newClass, msgs); |
375 | if (msgs != null) msgs.dispatch(); |
376 | } |
377 | else if (eNotificationRequired()) |
378 | eNotify(new ENotificationImpl(this, Notification.SET, EMOFPackage.PROPERTY__CLASS, newClass, newClass)); |
379 | } |
380 | |
381 | /** |
382 | * <!-- begin-user-doc --> |
383 | * <!-- end-user-doc --> |
384 | * @generated |
385 | */ |
386 | public String getDefault() { |
387 | return default_; |
388 | } |
389 | |
390 | /** |
391 | * <!-- begin-user-doc --> |
392 | * <!-- end-user-doc --> |
393 | * @generated |
394 | */ |
395 | public void setDefault(String newDefault) { |
396 | String oldDefault = default_; |
397 | default_ = newDefault; |
398 | if (eNotificationRequired()) |
399 | eNotify(new ENotificationImpl(this, Notification.SET, EMOFPackage.PROPERTY__DEFAULT, oldDefault, default_)); |
400 | } |
401 | |
402 | /** |
403 | * <!-- begin-user-doc --> |
404 | * <!-- end-user-doc --> |
405 | * @generated |
406 | */ |
407 | public Boolean getIsComposite() { |
408 | return isComposite; |
409 | } |
410 | |
411 | /** |
412 | * <!-- begin-user-doc --> |
413 | * <!-- end-user-doc --> |
414 | * @generated |
415 | */ |
416 | public void setIsComposite(Boolean newIsComposite) { |
417 | Boolean oldIsComposite = isComposite; |
418 | isComposite = newIsComposite; |
419 | if (eNotificationRequired()) |
420 | eNotify(new ENotificationImpl(this, Notification.SET, EMOFPackage.PROPERTY__IS_COMPOSITE, oldIsComposite, isComposite)); |
421 | } |
422 | |
423 | /** |
424 | * <!-- begin-user-doc --> |
425 | * <!-- end-user-doc --> |
426 | * @generated |
427 | */ |
428 | public Boolean getIsDerived() { |
429 | return isDerived; |
430 | } |
431 | |
432 | /** |
433 | * <!-- begin-user-doc --> |
434 | * <!-- end-user-doc --> |
435 | * @generated |
436 | */ |
437 | public void setIsDerived(Boolean newIsDerived) { |
438 | Boolean oldIsDerived = isDerived; |
439 | isDerived = newIsDerived; |
440 | if (eNotificationRequired()) |
441 | eNotify(new ENotificationImpl(this, Notification.SET, EMOFPackage.PROPERTY__IS_DERIVED, oldIsDerived, isDerived)); |
442 | } |
443 | |
444 | /** |
445 | * <!-- begin-user-doc --> |
446 | * <!-- end-user-doc --> |
447 | * @generated |
448 | */ |
449 | public Boolean getIsID() { |
450 | return isID; |
451 | } |
452 | |
453 | /** |
454 | * <!-- begin-user-doc --> |
455 | * <!-- end-user-doc --> |
456 | * @generated |
457 | */ |
458 | public void setIsID(Boolean newIsID) { |
459 | Boolean oldIsID = isID; |
460 | isID = newIsID; |
461 | if (eNotificationRequired()) |
462 | eNotify(new ENotificationImpl(this, Notification.SET, EMOFPackage.PROPERTY__IS_ID, oldIsID, isID)); |
463 | } |
464 | |
465 | /** |
466 | * <!-- begin-user-doc --> |
467 | * <!-- end-user-doc --> |
468 | * @generated |
469 | */ |
470 | public Boolean getIsReadOnly() { |
471 | return isReadOnly; |
472 | } |
473 | |
474 | /** |
475 | * <!-- begin-user-doc --> |
476 | * <!-- end-user-doc --> |
477 | * @generated |
478 | */ |
479 | public void setIsReadOnly(Boolean newIsReadOnly) { |
480 | Boolean oldIsReadOnly = isReadOnly; |
481 | isReadOnly = newIsReadOnly; |
482 | if (eNotificationRequired()) |
483 | eNotify(new ENotificationImpl(this, Notification.SET, EMOFPackage.PROPERTY__IS_READ_ONLY, oldIsReadOnly, isReadOnly)); |
484 | } |
485 | |
486 | /** |
487 | * <!-- begin-user-doc --> |
488 | * <!-- end-user-doc --> |
489 | * @generated |
490 | */ |
491 | public Property getOpposite() { |
492 | if (opposite != null && opposite.eIsProxy()) { |
493 | InternalEObject oldOpposite = (InternalEObject)opposite; |
494 | opposite = (Property)eResolveProxy(oldOpposite); |
495 | if (opposite != oldOpposite) { |
496 | if (eNotificationRequired()) |
497 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, EMOFPackage.PROPERTY__OPPOSITE, oldOpposite, opposite)); |
498 | } |
499 | } |
500 | return opposite; |
501 | } |
502 | |
503 | /** |
504 | * <!-- begin-user-doc --> |
505 | * <!-- end-user-doc --> |
506 | * @generated |
507 | */ |
508 | public Property basicGetOpposite() { |
509 | return opposite; |
510 | } |
511 | |
512 | /** |
513 | * <!-- begin-user-doc --> |
514 | * <!-- end-user-doc --> |
515 | * @generated |
516 | */ |
517 | public void setOpposite(Property newOpposite) { |
518 | Property oldOpposite = opposite; |
519 | opposite = newOpposite; |
520 | if (eNotificationRequired()) |
521 | eNotify(new ENotificationImpl(this, Notification.SET, EMOFPackage.PROPERTY__OPPOSITE, oldOpposite, opposite)); |
522 | } |
523 | |
524 | /** |
525 | * <!-- begin-user-doc --> |
526 | * <!-- end-user-doc --> |
527 | * @generated |
528 | */ |
529 | @Override |
530 | public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
531 | switch (featureID) { |
532 | case EMOFPackage.PROPERTY__CLASS: |
533 | if (eInternalContainer() != null) |
534 | msgs = eBasicRemoveFromContainer(msgs); |
535 | return basicSetClass((EMOF.Class)otherEnd, msgs); |
536 | } |
537 | return super.eInverseAdd(otherEnd, featureID, msgs); |
538 | } |
539 | |
540 | /** |
541 | * <!-- begin-user-doc --> |
542 | * <!-- end-user-doc --> |
543 | * @generated |
544 | */ |
545 | @Override |
546 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
547 | switch (featureID) { |
548 | case EMOFPackage.PROPERTY__CLASS: |
549 | return basicSetClass(null, msgs); |
550 | } |
551 | return super.eInverseRemove(otherEnd, featureID, msgs); |
552 | } |
553 | |
554 | /** |
555 | * <!-- begin-user-doc --> |
556 | * <!-- end-user-doc --> |
557 | * @generated |
558 | */ |
559 | @Override |
560 | public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { |
561 | switch (eContainerFeatureID()) { |
562 | case EMOFPackage.PROPERTY__CLASS: |
563 | return eInternalContainer().eInverseRemove(this, EMOFPackage.CLASS__OWNED_ATTRIBUTE, EMOF.Class.class, msgs); |
564 | } |
565 | return super.eBasicRemoveFromContainerFeature(msgs); |
566 | } |
567 | |
568 | /** |
569 | * <!-- begin-user-doc --> |
570 | * <!-- end-user-doc --> |
571 | * @generated |
572 | */ |
573 | @Override |
574 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
575 | switch (featureID) { |
576 | case EMOFPackage.PROPERTY__IS_ORDERED: |
577 | return getIsOrdered(); |
578 | case EMOFPackage.PROPERTY__IS_UNIQUE: |
579 | return getIsUnique(); |
580 | case EMOFPackage.PROPERTY__LOWER: |
581 | return getLower(); |
582 | case EMOFPackage.PROPERTY__UPPER: |
583 | return getUpper(); |
584 | case EMOFPackage.PROPERTY__CLASS: |
585 | return getClass_(); |
586 | case EMOFPackage.PROPERTY__DEFAULT: |
587 | return getDefault(); |
588 | case EMOFPackage.PROPERTY__IS_COMPOSITE: |
589 | return getIsComposite(); |
590 | case EMOFPackage.PROPERTY__IS_DERIVED: |
591 | return getIsDerived(); |
592 | case EMOFPackage.PROPERTY__IS_ID: |
593 | return getIsID(); |
594 | case EMOFPackage.PROPERTY__IS_READ_ONLY: |
595 | return getIsReadOnly(); |
596 | case EMOFPackage.PROPERTY__OPPOSITE: |
597 | if (resolve) return getOpposite(); |
598 | return basicGetOpposite(); |
599 | } |
600 | return super.eGet(featureID, resolve, coreType); |
601 | } |
602 | |
603 | /** |
604 | * <!-- begin-user-doc --> |
605 | * <!-- end-user-doc --> |
606 | * @generated |
607 | */ |
608 | @Override |
609 | public void eSet(int featureID, Object newValue) { |
610 | switch (featureID) { |
611 | case EMOFPackage.PROPERTY__IS_ORDERED: |
612 | setIsOrdered((Boolean)newValue); |
613 | return; |
614 | case EMOFPackage.PROPERTY__IS_UNIQUE: |
615 | setIsUnique((Boolean)newValue); |
616 | return; |
617 | case EMOFPackage.PROPERTY__LOWER: |
618 | setLower((Integer)newValue); |
619 | return; |
620 | case EMOFPackage.PROPERTY__UPPER: |
621 | setUpper((Integer)newValue); |
622 | return; |
623 | case EMOFPackage.PROPERTY__CLASS: |
624 | setClass((EMOF.Class)newValue); |
625 | return; |
626 | case EMOFPackage.PROPERTY__DEFAULT: |
627 | setDefault((String)newValue); |
628 | return; |
629 | case EMOFPackage.PROPERTY__IS_COMPOSITE: |
630 | setIsComposite((Boolean)newValue); |
631 | return; |
632 | case EMOFPackage.PROPERTY__IS_DERIVED: |
633 | setIsDerived((Boolean)newValue); |
634 | return; |
635 | case EMOFPackage.PROPERTY__IS_ID: |
636 | setIsID((Boolean)newValue); |
637 | return; |
638 | case EMOFPackage.PROPERTY__IS_READ_ONLY: |
639 | setIsReadOnly((Boolean)newValue); |
640 | return; |
641 | case EMOFPackage.PROPERTY__OPPOSITE: |
642 | setOpposite((Property)newValue); |
643 | return; |
644 | } |
645 | super.eSet(featureID, newValue); |
646 | } |
647 | |
648 | /** |
649 | * <!-- begin-user-doc --> |
650 | * <!-- end-user-doc --> |
651 | * @generated |
652 | */ |
653 | @Override |
654 | public void eUnset(int featureID) { |
655 | switch (featureID) { |
656 | case EMOFPackage.PROPERTY__IS_ORDERED: |
657 | setIsOrdered(IS_ORDERED_EDEFAULT); |
658 | return; |
659 | case EMOFPackage.PROPERTY__IS_UNIQUE: |
660 | setIsUnique(IS_UNIQUE_EDEFAULT); |
661 | return; |
662 | case EMOFPackage.PROPERTY__LOWER: |
663 | setLower(LOWER_EDEFAULT); |
664 | return; |
665 | case EMOFPackage.PROPERTY__UPPER: |
666 | setUpper(UPPER_EDEFAULT); |
667 | return; |
668 | case EMOFPackage.PROPERTY__CLASS: |
669 | setClass((EMOF.Class)null); |
670 | return; |
671 | case EMOFPackage.PROPERTY__DEFAULT: |
672 | setDefault(DEFAULT_EDEFAULT); |
673 | return; |
674 | case EMOFPackage.PROPERTY__IS_COMPOSITE: |
675 | setIsComposite(IS_COMPOSITE_EDEFAULT); |
676 | return; |
677 | case EMOFPackage.PROPERTY__IS_DERIVED: |
678 | setIsDerived(IS_DERIVED_EDEFAULT); |
679 | return; |
680 | case EMOFPackage.PROPERTY__IS_ID: |
681 | setIsID(IS_ID_EDEFAULT); |
682 | return; |
683 | case EMOFPackage.PROPERTY__IS_READ_ONLY: |
684 | setIsReadOnly(IS_READ_ONLY_EDEFAULT); |
685 | return; |
686 | case EMOFPackage.PROPERTY__OPPOSITE: |
687 | setOpposite((Property)null); |
688 | return; |
689 | } |
690 | super.eUnset(featureID); |
691 | } |
692 | |
693 | /** |
694 | * <!-- begin-user-doc --> |
695 | * <!-- end-user-doc --> |
696 | * @generated |
697 | */ |
698 | @Override |
699 | public boolean eIsSet(int featureID) { |
700 | switch (featureID) { |
701 | case EMOFPackage.PROPERTY__IS_ORDERED: |
702 | return IS_ORDERED_EDEFAULT == null ? isOrdered != null : !IS_ORDERED_EDEFAULT.equals(isOrdered); |
703 | case EMOFPackage.PROPERTY__IS_UNIQUE: |
704 | return IS_UNIQUE_EDEFAULT == null ? isUnique != null : !IS_UNIQUE_EDEFAULT.equals(isUnique); |
705 | case EMOFPackage.PROPERTY__LOWER: |
706 | return LOWER_EDEFAULT == null ? lower != null : !LOWER_EDEFAULT.equals(lower); |
707 | case EMOFPackage.PROPERTY__UPPER: |
708 | return UPPER_EDEFAULT == null ? upper != null : !UPPER_EDEFAULT.equals(upper); |
709 | case EMOFPackage.PROPERTY__CLASS: |
710 | return getClass_() != null; |
711 | case EMOFPackage.PROPERTY__DEFAULT: |
712 | return DEFAULT_EDEFAULT == null ? default_ != null : !DEFAULT_EDEFAULT.equals(default_); |
713 | case EMOFPackage.PROPERTY__IS_COMPOSITE: |
714 | return IS_COMPOSITE_EDEFAULT == null ? isComposite != null : !IS_COMPOSITE_EDEFAULT.equals(isComposite); |
715 | case EMOFPackage.PROPERTY__IS_DERIVED: |
716 | return IS_DERIVED_EDEFAULT == null ? isDerived != null : !IS_DERIVED_EDEFAULT.equals(isDerived); |
717 | case EMOFPackage.PROPERTY__IS_ID: |
718 | return IS_ID_EDEFAULT == null ? isID != null : !IS_ID_EDEFAULT.equals(isID); |
719 | case EMOFPackage.PROPERTY__IS_READ_ONLY: |
720 | return IS_READ_ONLY_EDEFAULT == null ? isReadOnly != null : !IS_READ_ONLY_EDEFAULT.equals(isReadOnly); |
721 | case EMOFPackage.PROPERTY__OPPOSITE: |
722 | return opposite != null; |
723 | } |
724 | return super.eIsSet(featureID); |
725 | } |
726 | |
727 | /** |
728 | * <!-- begin-user-doc --> |
729 | * <!-- end-user-doc --> |
730 | * @generated |
731 | */ |
732 | @Override |
733 | public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) { |
734 | if (baseClass == MultiplicityElement.class) { |
735 | switch (derivedFeatureID) { |
736 | case EMOFPackage.PROPERTY__IS_ORDERED: return EMOFPackage.MULTIPLICITY_ELEMENT__IS_ORDERED; |
737 | case EMOFPackage.PROPERTY__IS_UNIQUE: return EMOFPackage.MULTIPLICITY_ELEMENT__IS_UNIQUE; |
738 | case EMOFPackage.PROPERTY__LOWER: return EMOFPackage.MULTIPLICITY_ELEMENT__LOWER; |
739 | case EMOFPackage.PROPERTY__UPPER: return EMOFPackage.MULTIPLICITY_ELEMENT__UPPER; |
740 | default: return -1; |
741 | } |
742 | } |
743 | return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); |
744 | } |
745 | |
746 | /** |
747 | * <!-- begin-user-doc --> |
748 | * <!-- end-user-doc --> |
749 | * @generated |
750 | */ |
751 | @Override |
752 | public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) { |
753 | if (baseClass == MultiplicityElement.class) { |
754 | switch (baseFeatureID) { |
755 | case EMOFPackage.MULTIPLICITY_ELEMENT__IS_ORDERED: return EMOFPackage.PROPERTY__IS_ORDERED; |
756 | case EMOFPackage.MULTIPLICITY_ELEMENT__IS_UNIQUE: return EMOFPackage.PROPERTY__IS_UNIQUE; |
757 | case EMOFPackage.MULTIPLICITY_ELEMENT__LOWER: return EMOFPackage.PROPERTY__LOWER; |
758 | case EMOFPackage.MULTIPLICITY_ELEMENT__UPPER: return EMOFPackage.PROPERTY__UPPER; |
759 | default: return -1; |
760 | } |
761 | } |
762 | return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); |
763 | } |
764 | |
765 | /** |
766 | * <!-- begin-user-doc --> |
767 | * <!-- end-user-doc --> |
768 | * @generated |
769 | */ |
770 | @Override |
771 | public String toString() { |
772 | if (eIsProxy()) return super.toString(); |
773 | |
774 | StringBuffer result = new StringBuffer(super.toString()); |
775 | result.append(" (isOrdered: "); |
776 | result.append(isOrdered); |
777 | result.append(", isUnique: "); |
778 | result.append(isUnique); |
779 | result.append(", lower: "); |
780 | result.append(lower); |
781 | result.append(", upper: "); |
782 | result.append(upper); |
783 | result.append(", default: "); |
784 | result.append(default_); |
785 | result.append(", isComposite: "); |
786 | result.append(isComposite); |
787 | result.append(", isDerived: "); |
788 | result.append(isDerived); |
789 | result.append(", isID: "); |
790 | result.append(isID); |
791 | result.append(", isReadOnly: "); |
792 | result.append(isReadOnly); |
793 | result.append(')'); |
794 | return result.toString(); |
795 | } |
796 | |
797 | } //PropertyImpl |