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