diff options
Diffstat (limited to 'Tests/hu.bme.mit.inf.dslreasoner.application.FAMTest/src/functionalarchitecture/impl/FunctionImpl.java')
-rw-r--r-- | Tests/hu.bme.mit.inf.dslreasoner.application.FAMTest/src/functionalarchitecture/impl/FunctionImpl.java | 240 |
1 files changed, 240 insertions, 0 deletions
diff --git a/Tests/hu.bme.mit.inf.dslreasoner.application.FAMTest/src/functionalarchitecture/impl/FunctionImpl.java b/Tests/hu.bme.mit.inf.dslreasoner.application.FAMTest/src/functionalarchitecture/impl/FunctionImpl.java new file mode 100644 index 00000000..cc41bd6f --- /dev/null +++ b/Tests/hu.bme.mit.inf.dslreasoner.application.FAMTest/src/functionalarchitecture/impl/FunctionImpl.java | |||
@@ -0,0 +1,240 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package functionalarchitecture.impl; | ||
4 | |||
5 | import functionalarchitecture.Function; | ||
6 | import functionalarchitecture.FunctionType; | ||
7 | import functionalarchitecture.FunctionalElement; | ||
8 | import functionalarchitecture.FunctionalarchitecturePackage; | ||
9 | |||
10 | import java.util.Collection; | ||
11 | |||
12 | import org.eclipse.emf.common.notify.Notification; | ||
13 | import org.eclipse.emf.common.notify.NotificationChain; | ||
14 | |||
15 | import org.eclipse.emf.common.util.EList; | ||
16 | |||
17 | import org.eclipse.emf.ecore.EClass; | ||
18 | import org.eclipse.emf.ecore.InternalEObject; | ||
19 | |||
20 | import org.eclipse.emf.ecore.impl.ENotificationImpl; | ||
21 | |||
22 | import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList; | ||
23 | import org.eclipse.emf.ecore.util.InternalEList; | ||
24 | |||
25 | /** | ||
26 | * <!-- begin-user-doc --> | ||
27 | * An implementation of the model object '<em><b>Function</b></em>'. | ||
28 | * <!-- end-user-doc --> | ||
29 | * <p> | ||
30 | * The following features are implemented: | ||
31 | * </p> | ||
32 | * <ul> | ||
33 | * <li>{@link functionalarchitecture.impl.FunctionImpl#getSubElements <em>Sub Elements</em>}</li> | ||
34 | * <li>{@link functionalarchitecture.impl.FunctionImpl#getType <em>Type</em>}</li> | ||
35 | * </ul> | ||
36 | * | ||
37 | * @generated | ||
38 | */ | ||
39 | public class FunctionImpl extends FunctionalElementImpl implements Function { | ||
40 | /** | ||
41 | * The cached value of the '{@link #getSubElements() <em>Sub Elements</em>}' containment reference list. | ||
42 | * <!-- begin-user-doc --> | ||
43 | * <!-- end-user-doc --> | ||
44 | * @see #getSubElements() | ||
45 | * @generated | ||
46 | * @ordered | ||
47 | */ | ||
48 | protected EList<FunctionalElement> subElements; | ||
49 | |||
50 | /** | ||
51 | * The default value of the '{@link #getType() <em>Type</em>}' attribute. | ||
52 | * <!-- begin-user-doc --> | ||
53 | * <!-- end-user-doc --> | ||
54 | * @see #getType() | ||
55 | * @generated | ||
56 | * @ordered | ||
57 | */ | ||
58 | protected static final FunctionType TYPE_EDEFAULT = FunctionType.ROOT; | ||
59 | |||
60 | /** | ||
61 | * The cached value of the '{@link #getType() <em>Type</em>}' attribute. | ||
62 | * <!-- begin-user-doc --> | ||
63 | * <!-- end-user-doc --> | ||
64 | * @see #getType() | ||
65 | * @generated | ||
66 | * @ordered | ||
67 | */ | ||
68 | protected FunctionType type = TYPE_EDEFAULT; | ||
69 | |||
70 | /** | ||
71 | * <!-- begin-user-doc --> | ||
72 | * <!-- end-user-doc --> | ||
73 | * @generated | ||
74 | */ | ||
75 | protected FunctionImpl() { | ||
76 | super(); | ||
77 | } | ||
78 | |||
79 | /** | ||
80 | * <!-- begin-user-doc --> | ||
81 | * <!-- end-user-doc --> | ||
82 | * @generated | ||
83 | */ | ||
84 | @Override | ||
85 | protected EClass eStaticClass() { | ||
86 | return FunctionalarchitecturePackage.Literals.FUNCTION; | ||
87 | } | ||
88 | |||
89 | /** | ||
90 | * <!-- begin-user-doc --> | ||
91 | * <!-- end-user-doc --> | ||
92 | * @generated | ||
93 | */ | ||
94 | @Override | ||
95 | public EList<FunctionalElement> getSubElements() { | ||
96 | if (subElements == null) { | ||
97 | subElements = new EObjectContainmentWithInverseEList<FunctionalElement>(FunctionalElement.class, this, FunctionalarchitecturePackage.FUNCTION__SUB_ELEMENTS, FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__PARENT); | ||
98 | } | ||
99 | return subElements; | ||
100 | } | ||
101 | |||
102 | /** | ||
103 | * <!-- begin-user-doc --> | ||
104 | * <!-- end-user-doc --> | ||
105 | * @generated | ||
106 | */ | ||
107 | @Override | ||
108 | public FunctionType getType() { | ||
109 | return type; | ||
110 | } | ||
111 | |||
112 | /** | ||
113 | * <!-- begin-user-doc --> | ||
114 | * <!-- end-user-doc --> | ||
115 | * @generated | ||
116 | */ | ||
117 | @Override | ||
118 | public void setType(FunctionType newType) { | ||
119 | FunctionType oldType = type; | ||
120 | type = newType == null ? TYPE_EDEFAULT : newType; | ||
121 | if (eNotificationRequired()) | ||
122 | eNotify(new ENotificationImpl(this, Notification.SET, FunctionalarchitecturePackage.FUNCTION__TYPE, oldType, type)); | ||
123 | } | ||
124 | |||
125 | /** | ||
126 | * <!-- begin-user-doc --> | ||
127 | * <!-- end-user-doc --> | ||
128 | * @generated | ||
129 | */ | ||
130 | @SuppressWarnings("unchecked") | ||
131 | @Override | ||
132 | public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
133 | switch (featureID) { | ||
134 | case FunctionalarchitecturePackage.FUNCTION__SUB_ELEMENTS: | ||
135 | return ((InternalEList<InternalEObject>)(InternalEList<?>)getSubElements()).basicAdd(otherEnd, msgs); | ||
136 | } | ||
137 | return super.eInverseAdd(otherEnd, featureID, msgs); | ||
138 | } | ||
139 | |||
140 | /** | ||
141 | * <!-- begin-user-doc --> | ||
142 | * <!-- end-user-doc --> | ||
143 | * @generated | ||
144 | */ | ||
145 | @Override | ||
146 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
147 | switch (featureID) { | ||
148 | case FunctionalarchitecturePackage.FUNCTION__SUB_ELEMENTS: | ||
149 | return ((InternalEList<?>)getSubElements()).basicRemove(otherEnd, msgs); | ||
150 | } | ||
151 | return super.eInverseRemove(otherEnd, featureID, msgs); | ||
152 | } | ||
153 | |||
154 | /** | ||
155 | * <!-- begin-user-doc --> | ||
156 | * <!-- end-user-doc --> | ||
157 | * @generated | ||
158 | */ | ||
159 | @Override | ||
160 | public Object eGet(int featureID, boolean resolve, boolean coreType) { | ||
161 | switch (featureID) { | ||
162 | case FunctionalarchitecturePackage.FUNCTION__SUB_ELEMENTS: | ||
163 | return getSubElements(); | ||
164 | case FunctionalarchitecturePackage.FUNCTION__TYPE: | ||
165 | return getType(); | ||
166 | } | ||
167 | return super.eGet(featureID, resolve, coreType); | ||
168 | } | ||
169 | |||
170 | /** | ||
171 | * <!-- begin-user-doc --> | ||
172 | * <!-- end-user-doc --> | ||
173 | * @generated | ||
174 | */ | ||
175 | @SuppressWarnings("unchecked") | ||
176 | @Override | ||
177 | public void eSet(int featureID, Object newValue) { | ||
178 | switch (featureID) { | ||
179 | case FunctionalarchitecturePackage.FUNCTION__SUB_ELEMENTS: | ||
180 | getSubElements().clear(); | ||
181 | getSubElements().addAll((Collection<? extends FunctionalElement>)newValue); | ||
182 | return; | ||
183 | case FunctionalarchitecturePackage.FUNCTION__TYPE: | ||
184 | setType((FunctionType)newValue); | ||
185 | return; | ||
186 | } | ||
187 | super.eSet(featureID, newValue); | ||
188 | } | ||
189 | |||
190 | /** | ||
191 | * <!-- begin-user-doc --> | ||
192 | * <!-- end-user-doc --> | ||
193 | * @generated | ||
194 | */ | ||
195 | @Override | ||
196 | public void eUnset(int featureID) { | ||
197 | switch (featureID) { | ||
198 | case FunctionalarchitecturePackage.FUNCTION__SUB_ELEMENTS: | ||
199 | getSubElements().clear(); | ||
200 | return; | ||
201 | case FunctionalarchitecturePackage.FUNCTION__TYPE: | ||
202 | setType(TYPE_EDEFAULT); | ||
203 | return; | ||
204 | } | ||
205 | super.eUnset(featureID); | ||
206 | } | ||
207 | |||
208 | /** | ||
209 | * <!-- begin-user-doc --> | ||
210 | * <!-- end-user-doc --> | ||
211 | * @generated | ||
212 | */ | ||
213 | @Override | ||
214 | public boolean eIsSet(int featureID) { | ||
215 | switch (featureID) { | ||
216 | case FunctionalarchitecturePackage.FUNCTION__SUB_ELEMENTS: | ||
217 | return subElements != null && !subElements.isEmpty(); | ||
218 | case FunctionalarchitecturePackage.FUNCTION__TYPE: | ||
219 | return type != TYPE_EDEFAULT; | ||
220 | } | ||
221 | return super.eIsSet(featureID); | ||
222 | } | ||
223 | |||
224 | /** | ||
225 | * <!-- begin-user-doc --> | ||
226 | * <!-- end-user-doc --> | ||
227 | * @generated | ||
228 | */ | ||
229 | @Override | ||
230 | public String toString() { | ||
231 | if (eIsProxy()) return super.toString(); | ||
232 | |||
233 | StringBuilder result = new StringBuilder(super.toString()); | ||
234 | result.append(" (type: "); | ||
235 | result.append(type); | ||
236 | result.append(')'); | ||
237 | return result.toString(); | ||
238 | } | ||
239 | |||
240 | } //FunctionImpl | ||