diff options
author | 2020-04-27 10:45:28 -0400 | |
---|---|---|
committer | 2020-04-27 10:45:28 -0400 | |
commit | 36ca60e5b6bd047a4f444d96241bd60a01bbab17 (patch) | |
tree | 472ee15861945af6b7056d19250734ffab4c3aef /Tests/MODELS2020-CaseStudies/case.study.familyTree.model/src/familytree/impl | |
parent | Merge branch 'Attribute-Solver' (diff) | |
download | VIATRA-Generator-36ca60e5b6bd047a4f444d96241bd60a01bbab17.tar.gz VIATRA-Generator-36ca60e5b6bd047a4f444d96241bd60a01bbab17.tar.zst VIATRA-Generator-36ca60e5b6bd047a4f444d96241bd60a01bbab17.zip |
rename Pledge Case Studies and add familyTree case study
Diffstat (limited to 'Tests/MODELS2020-CaseStudies/case.study.familyTree.model/src/familytree/impl')
4 files changed, 847 insertions, 0 deletions
diff --git a/Tests/MODELS2020-CaseStudies/case.study.familyTree.model/src/familytree/impl/FamilyTreeImpl.java b/Tests/MODELS2020-CaseStudies/case.study.familyTree.model/src/familytree/impl/FamilyTreeImpl.java new file mode 100644 index 00000000..07b0a1dd --- /dev/null +++ b/Tests/MODELS2020-CaseStudies/case.study.familyTree.model/src/familytree/impl/FamilyTreeImpl.java | |||
@@ -0,0 +1,153 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package familytree.impl; | ||
4 | |||
5 | import familytree.FamilyTree; | ||
6 | import familytree.FamilytreePackage; | ||
7 | import familytree.Member; | ||
8 | |||
9 | import java.util.Collection; | ||
10 | |||
11 | import org.eclipse.emf.common.notify.NotificationChain; | ||
12 | |||
13 | import org.eclipse.emf.common.util.EList; | ||
14 | |||
15 | import org.eclipse.emf.ecore.EClass; | ||
16 | import org.eclipse.emf.ecore.InternalEObject; | ||
17 | |||
18 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; | ||
19 | |||
20 | import org.eclipse.emf.ecore.util.EObjectContainmentEList; | ||
21 | import org.eclipse.emf.ecore.util.InternalEList; | ||
22 | |||
23 | /** | ||
24 | * <!-- begin-user-doc --> | ||
25 | * An implementation of the model object '<em><b>Family Tree</b></em>'. | ||
26 | * <!-- end-user-doc --> | ||
27 | * <p> | ||
28 | * The following features are implemented: | ||
29 | * </p> | ||
30 | * <ul> | ||
31 | * <li>{@link familytree.impl.FamilyTreeImpl#getMembers <em>Members</em>}</li> | ||
32 | * </ul> | ||
33 | * | ||
34 | * @generated | ||
35 | */ | ||
36 | public class FamilyTreeImpl extends MinimalEObjectImpl.Container implements FamilyTree { | ||
37 | /** | ||
38 | * The cached value of the '{@link #getMembers() <em>Members</em>}' containment reference list. | ||
39 | * <!-- begin-user-doc --> | ||
40 | * <!-- end-user-doc --> | ||
41 | * @see #getMembers() | ||
42 | * @generated | ||
43 | * @ordered | ||
44 | */ | ||
45 | protected EList<Member> members; | ||
46 | |||
47 | /** | ||
48 | * <!-- begin-user-doc --> | ||
49 | * <!-- end-user-doc --> | ||
50 | * @generated | ||
51 | */ | ||
52 | protected FamilyTreeImpl() { | ||
53 | super(); | ||
54 | } | ||
55 | |||
56 | /** | ||
57 | * <!-- begin-user-doc --> | ||
58 | * <!-- end-user-doc --> | ||
59 | * @generated | ||
60 | */ | ||
61 | @Override | ||
62 | protected EClass eStaticClass() { | ||
63 | return FamilytreePackage.Literals.FAMILY_TREE; | ||
64 | } | ||
65 | |||
66 | /** | ||
67 | * <!-- begin-user-doc --> | ||
68 | * <!-- end-user-doc --> | ||
69 | * @generated | ||
70 | */ | ||
71 | @Override | ||
72 | public EList<Member> getMembers() { | ||
73 | if (members == null) { | ||
74 | members = new EObjectContainmentEList<Member>(Member.class, this, FamilytreePackage.FAMILY_TREE__MEMBERS); | ||
75 | } | ||
76 | return members; | ||
77 | } | ||
78 | |||
79 | /** | ||
80 | * <!-- begin-user-doc --> | ||
81 | * <!-- end-user-doc --> | ||
82 | * @generated | ||
83 | */ | ||
84 | @Override | ||
85 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
86 | switch (featureID) { | ||
87 | case FamilytreePackage.FAMILY_TREE__MEMBERS: | ||
88 | return ((InternalEList<?>)getMembers()).basicRemove(otherEnd, msgs); | ||
89 | } | ||
90 | return super.eInverseRemove(otherEnd, featureID, msgs); | ||
91 | } | ||
92 | |||
93 | /** | ||
94 | * <!-- begin-user-doc --> | ||
95 | * <!-- end-user-doc --> | ||
96 | * @generated | ||
97 | */ | ||
98 | @Override | ||
99 | public Object eGet(int featureID, boolean resolve, boolean coreType) { | ||
100 | switch (featureID) { | ||
101 | case FamilytreePackage.FAMILY_TREE__MEMBERS: | ||
102 | return getMembers(); | ||
103 | } | ||
104 | return super.eGet(featureID, resolve, coreType); | ||
105 | } | ||
106 | |||
107 | /** | ||
108 | * <!-- begin-user-doc --> | ||
109 | * <!-- end-user-doc --> | ||
110 | * @generated | ||
111 | */ | ||
112 | @SuppressWarnings("unchecked") | ||
113 | @Override | ||
114 | public void eSet(int featureID, Object newValue) { | ||
115 | switch (featureID) { | ||
116 | case FamilytreePackage.FAMILY_TREE__MEMBERS: | ||
117 | getMembers().clear(); | ||
118 | getMembers().addAll((Collection<? extends Member>)newValue); | ||
119 | return; | ||
120 | } | ||
121 | super.eSet(featureID, newValue); | ||
122 | } | ||
123 | |||
124 | /** | ||
125 | * <!-- begin-user-doc --> | ||
126 | * <!-- end-user-doc --> | ||
127 | * @generated | ||
128 | */ | ||
129 | @Override | ||
130 | public void eUnset(int featureID) { | ||
131 | switch (featureID) { | ||
132 | case FamilytreePackage.FAMILY_TREE__MEMBERS: | ||
133 | getMembers().clear(); | ||
134 | return; | ||
135 | } | ||
136 | super.eUnset(featureID); | ||
137 | } | ||
138 | |||
139 | /** | ||
140 | * <!-- begin-user-doc --> | ||
141 | * <!-- end-user-doc --> | ||
142 | * @generated | ||
143 | */ | ||
144 | @Override | ||
145 | public boolean eIsSet(int featureID) { | ||
146 | switch (featureID) { | ||
147 | case FamilytreePackage.FAMILY_TREE__MEMBERS: | ||
148 | return members != null && !members.isEmpty(); | ||
149 | } | ||
150 | return super.eIsSet(featureID); | ||
151 | } | ||
152 | |||
153 | } //FamilyTreeImpl | ||
diff --git a/Tests/MODELS2020-CaseStudies/case.study.familyTree.model/src/familytree/impl/FamilytreeFactoryImpl.java b/Tests/MODELS2020-CaseStudies/case.study.familyTree.model/src/familytree/impl/FamilytreeFactoryImpl.java new file mode 100644 index 00000000..bc54d09c --- /dev/null +++ b/Tests/MODELS2020-CaseStudies/case.study.familyTree.model/src/familytree/impl/FamilytreeFactoryImpl.java | |||
@@ -0,0 +1,109 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package familytree.impl; | ||
4 | |||
5 | import familytree.*; | ||
6 | |||
7 | import org.eclipse.emf.ecore.EClass; | ||
8 | import org.eclipse.emf.ecore.EObject; | ||
9 | import org.eclipse.emf.ecore.EPackage; | ||
10 | |||
11 | import org.eclipse.emf.ecore.impl.EFactoryImpl; | ||
12 | |||
13 | import org.eclipse.emf.ecore.plugin.EcorePlugin; | ||
14 | |||
15 | /** | ||
16 | * <!-- begin-user-doc --> | ||
17 | * An implementation of the model <b>Factory</b>. | ||
18 | * <!-- end-user-doc --> | ||
19 | * @generated | ||
20 | */ | ||
21 | public class FamilytreeFactoryImpl extends EFactoryImpl implements FamilytreeFactory { | ||
22 | /** | ||
23 | * Creates the default factory implementation. | ||
24 | * <!-- begin-user-doc --> | ||
25 | * <!-- end-user-doc --> | ||
26 | * @generated | ||
27 | */ | ||
28 | public static FamilytreeFactory init() { | ||
29 | try { | ||
30 | FamilytreeFactory theFamilytreeFactory = (FamilytreeFactory)EPackage.Registry.INSTANCE.getEFactory(FamilytreePackage.eNS_URI); | ||
31 | if (theFamilytreeFactory != null) { | ||
32 | return theFamilytreeFactory; | ||
33 | } | ||
34 | } | ||
35 | catch (Exception exception) { | ||
36 | EcorePlugin.INSTANCE.log(exception); | ||
37 | } | ||
38 | return new FamilytreeFactoryImpl(); | ||
39 | } | ||
40 | |||
41 | /** | ||
42 | * Creates an instance of the factory. | ||
43 | * <!-- begin-user-doc --> | ||
44 | * <!-- end-user-doc --> | ||
45 | * @generated | ||
46 | */ | ||
47 | public FamilytreeFactoryImpl() { | ||
48 | super(); | ||
49 | } | ||
50 | |||
51 | /** | ||
52 | * <!-- begin-user-doc --> | ||
53 | * <!-- end-user-doc --> | ||
54 | * @generated | ||
55 | */ | ||
56 | @Override | ||
57 | public EObject create(EClass eClass) { | ||
58 | switch (eClass.getClassifierID()) { | ||
59 | case FamilytreePackage.FAMILY_TREE: return createFamilyTree(); | ||
60 | case FamilytreePackage.MEMBER: return createMember(); | ||
61 | default: | ||
62 | throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); | ||
63 | } | ||
64 | } | ||
65 | |||
66 | /** | ||
67 | * <!-- begin-user-doc --> | ||
68 | * <!-- end-user-doc --> | ||
69 | * @generated | ||
70 | */ | ||
71 | @Override | ||
72 | public FamilyTree createFamilyTree() { | ||
73 | FamilyTreeImpl familyTree = new FamilyTreeImpl(); | ||
74 | return familyTree; | ||
75 | } | ||
76 | |||
77 | /** | ||
78 | * <!-- begin-user-doc --> | ||
79 | * <!-- end-user-doc --> | ||
80 | * @generated | ||
81 | */ | ||
82 | @Override | ||
83 | public Member createMember() { | ||
84 | MemberImpl member = new MemberImpl(); | ||
85 | return member; | ||
86 | } | ||
87 | |||
88 | /** | ||
89 | * <!-- begin-user-doc --> | ||
90 | * <!-- end-user-doc --> | ||
91 | * @generated | ||
92 | */ | ||
93 | @Override | ||
94 | public FamilytreePackage getFamilytreePackage() { | ||
95 | return (FamilytreePackage)getEPackage(); | ||
96 | } | ||
97 | |||
98 | /** | ||
99 | * <!-- begin-user-doc --> | ||
100 | * <!-- end-user-doc --> | ||
101 | * @deprecated | ||
102 | * @generated | ||
103 | */ | ||
104 | @Deprecated | ||
105 | public static FamilytreePackage getPackage() { | ||
106 | return FamilytreePackage.eINSTANCE; | ||
107 | } | ||
108 | |||
109 | } //FamilytreeFactoryImpl | ||
diff --git a/Tests/MODELS2020-CaseStudies/case.study.familyTree.model/src/familytree/impl/FamilytreePackageImpl.java b/Tests/MODELS2020-CaseStudies/case.study.familyTree.model/src/familytree/impl/FamilytreePackageImpl.java new file mode 100644 index 00000000..0980260e --- /dev/null +++ b/Tests/MODELS2020-CaseStudies/case.study.familyTree.model/src/familytree/impl/FamilytreePackageImpl.java | |||
@@ -0,0 +1,251 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package familytree.impl; | ||
4 | |||
5 | import familytree.FamilyTree; | ||
6 | import familytree.FamilytreeFactory; | ||
7 | import familytree.FamilytreePackage; | ||
8 | import familytree.Member; | ||
9 | |||
10 | import org.eclipse.emf.ecore.EAttribute; | ||
11 | import org.eclipse.emf.ecore.EClass; | ||
12 | import org.eclipse.emf.ecore.EPackage; | ||
13 | import org.eclipse.emf.ecore.EReference; | ||
14 | |||
15 | import org.eclipse.emf.ecore.impl.EPackageImpl; | ||
16 | |||
17 | /** | ||
18 | * <!-- begin-user-doc --> | ||
19 | * An implementation of the model <b>Package</b>. | ||
20 | * <!-- end-user-doc --> | ||
21 | * @generated | ||
22 | */ | ||
23 | public class FamilytreePackageImpl extends EPackageImpl implements FamilytreePackage { | ||
24 | /** | ||
25 | * <!-- begin-user-doc --> | ||
26 | * <!-- end-user-doc --> | ||
27 | * @generated | ||
28 | */ | ||
29 | private EClass familyTreeEClass = null; | ||
30 | |||
31 | /** | ||
32 | * <!-- begin-user-doc --> | ||
33 | * <!-- end-user-doc --> | ||
34 | * @generated | ||
35 | */ | ||
36 | private EClass memberEClass = null; | ||
37 | |||
38 | /** | ||
39 | * Creates an instance of the model <b>Package</b>, registered with | ||
40 | * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package | ||
41 | * package URI value. | ||
42 | * <p>Note: the correct way to create the package is via the static | ||
43 | * factory method {@link #init init()}, which also performs | ||
44 | * initialization of the package, or returns the registered package, | ||
45 | * if one already exists. | ||
46 | * <!-- begin-user-doc --> | ||
47 | * <!-- end-user-doc --> | ||
48 | * @see org.eclipse.emf.ecore.EPackage.Registry | ||
49 | * @see familytree.FamilytreePackage#eNS_URI | ||
50 | * @see #init() | ||
51 | * @generated | ||
52 | */ | ||
53 | private FamilytreePackageImpl() { | ||
54 | super(eNS_URI, FamilytreeFactory.eINSTANCE); | ||
55 | } | ||
56 | |||
57 | /** | ||
58 | * <!-- begin-user-doc --> | ||
59 | * <!-- end-user-doc --> | ||
60 | * @generated | ||
61 | */ | ||
62 | private static boolean isInited = false; | ||
63 | |||
64 | /** | ||
65 | * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends. | ||
66 | * | ||
67 | * <p>This method is used to initialize {@link FamilytreePackage#eINSTANCE} when that field is accessed. | ||
68 | * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. | ||
69 | * <!-- begin-user-doc --> | ||
70 | * <!-- end-user-doc --> | ||
71 | * @see #eNS_URI | ||
72 | * @see #createPackageContents() | ||
73 | * @see #initializePackageContents() | ||
74 | * @generated | ||
75 | */ | ||
76 | public static FamilytreePackage init() { | ||
77 | if (isInited) return (FamilytreePackage)EPackage.Registry.INSTANCE.getEPackage(FamilytreePackage.eNS_URI); | ||
78 | |||
79 | // Obtain or create and register package | ||
80 | Object registeredFamilytreePackage = EPackage.Registry.INSTANCE.get(eNS_URI); | ||
81 | FamilytreePackageImpl theFamilytreePackage = registeredFamilytreePackage instanceof FamilytreePackageImpl ? (FamilytreePackageImpl)registeredFamilytreePackage : new FamilytreePackageImpl(); | ||
82 | |||
83 | isInited = true; | ||
84 | |||
85 | // Create package meta-data objects | ||
86 | theFamilytreePackage.createPackageContents(); | ||
87 | |||
88 | // Initialize created meta-data | ||
89 | theFamilytreePackage.initializePackageContents(); | ||
90 | |||
91 | // Mark meta-data to indicate it can't be changed | ||
92 | theFamilytreePackage.freeze(); | ||
93 | |||
94 | // Update the registry and return the package | ||
95 | EPackage.Registry.INSTANCE.put(FamilytreePackage.eNS_URI, theFamilytreePackage); | ||
96 | return theFamilytreePackage; | ||
97 | } | ||
98 | |||
99 | /** | ||
100 | * <!-- begin-user-doc --> | ||
101 | * <!-- end-user-doc --> | ||
102 | * @generated | ||
103 | */ | ||
104 | @Override | ||
105 | public EClass getFamilyTree() { | ||
106 | return familyTreeEClass; | ||
107 | } | ||
108 | |||
109 | /** | ||
110 | * <!-- begin-user-doc --> | ||
111 | * <!-- end-user-doc --> | ||
112 | * @generated | ||
113 | */ | ||
114 | @Override | ||
115 | public EReference getFamilyTree_Members() { | ||
116 | return (EReference)familyTreeEClass.getEStructuralFeatures().get(0); | ||
117 | } | ||
118 | |||
119 | /** | ||
120 | * <!-- begin-user-doc --> | ||
121 | * <!-- end-user-doc --> | ||
122 | * @generated | ||
123 | */ | ||
124 | @Override | ||
125 | public EClass getMember() { | ||
126 | return memberEClass; | ||
127 | } | ||
128 | |||
129 | /** | ||
130 | * <!-- begin-user-doc --> | ||
131 | * <!-- end-user-doc --> | ||
132 | * @generated | ||
133 | */ | ||
134 | @Override | ||
135 | public EAttribute getMember_Name() { | ||
136 | return (EAttribute)memberEClass.getEStructuralFeatures().get(0); | ||
137 | } | ||
138 | |||
139 | /** | ||
140 | * <!-- begin-user-doc --> | ||
141 | * <!-- end-user-doc --> | ||
142 | * @generated | ||
143 | */ | ||
144 | @Override | ||
145 | public EAttribute getMember_Age() { | ||
146 | return (EAttribute)memberEClass.getEStructuralFeatures().get(1); | ||
147 | } | ||
148 | |||
149 | /** | ||
150 | * <!-- begin-user-doc --> | ||
151 | * <!-- end-user-doc --> | ||
152 | * @generated | ||
153 | */ | ||
154 | @Override | ||
155 | public EReference getMember_Children() { | ||
156 | return (EReference)memberEClass.getEStructuralFeatures().get(2); | ||
157 | } | ||
158 | |||
159 | /** | ||
160 | * <!-- begin-user-doc --> | ||
161 | * <!-- end-user-doc --> | ||
162 | * @generated | ||
163 | */ | ||
164 | @Override | ||
165 | public EReference getMember_Parents() { | ||
166 | return (EReference)memberEClass.getEStructuralFeatures().get(3); | ||
167 | } | ||
168 | |||
169 | /** | ||
170 | * <!-- begin-user-doc --> | ||
171 | * <!-- end-user-doc --> | ||
172 | * @generated | ||
173 | */ | ||
174 | @Override | ||
175 | public FamilytreeFactory getFamilytreeFactory() { | ||
176 | return (FamilytreeFactory)getEFactoryInstance(); | ||
177 | } | ||
178 | |||
179 | /** | ||
180 | * <!-- begin-user-doc --> | ||
181 | * <!-- end-user-doc --> | ||
182 | * @generated | ||
183 | */ | ||
184 | private boolean isCreated = false; | ||
185 | |||
186 | /** | ||
187 | * Creates the meta-model objects for the package. This method is | ||
188 | * guarded to have no affect on any invocation but its first. | ||
189 | * <!-- begin-user-doc --> | ||
190 | * <!-- end-user-doc --> | ||
191 | * @generated | ||
192 | */ | ||
193 | public void createPackageContents() { | ||
194 | if (isCreated) return; | ||
195 | isCreated = true; | ||
196 | |||
197 | // Create classes and their features | ||
198 | familyTreeEClass = createEClass(FAMILY_TREE); | ||
199 | createEReference(familyTreeEClass, FAMILY_TREE__MEMBERS); | ||
200 | |||
201 | memberEClass = createEClass(MEMBER); | ||
202 | createEAttribute(memberEClass, MEMBER__NAME); | ||
203 | createEAttribute(memberEClass, MEMBER__AGE); | ||
204 | createEReference(memberEClass, MEMBER__CHILDREN); | ||
205 | createEReference(memberEClass, MEMBER__PARENTS); | ||
206 | } | ||
207 | |||
208 | /** | ||
209 | * <!-- begin-user-doc --> | ||
210 | * <!-- end-user-doc --> | ||
211 | * @generated | ||
212 | */ | ||
213 | private boolean isInitialized = false; | ||
214 | |||
215 | /** | ||
216 | * Complete the initialization of the package and its meta-model. This | ||
217 | * method is guarded to have no affect on any invocation but its first. | ||
218 | * <!-- begin-user-doc --> | ||
219 | * <!-- end-user-doc --> | ||
220 | * @generated | ||
221 | */ | ||
222 | public void initializePackageContents() { | ||
223 | if (isInitialized) return; | ||
224 | isInitialized = true; | ||
225 | |||
226 | // Initialize package | ||
227 | setName(eNAME); | ||
228 | setNsPrefix(eNS_PREFIX); | ||
229 | setNsURI(eNS_URI); | ||
230 | |||
231 | // Create type parameters | ||
232 | |||
233 | // Set bounds for type parameters | ||
234 | |||
235 | // Add supertypes to classes | ||
236 | |||
237 | // Initialize classes, features, and operations; add parameters | ||
238 | initEClass(familyTreeEClass, FamilyTree.class, "FamilyTree", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); | ||
239 | initEReference(getFamilyTree_Members(), this.getMember(), null, "members", null, 0, -1, FamilyTree.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
240 | |||
241 | initEClass(memberEClass, Member.class, "Member", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); | ||
242 | initEAttribute(getMember_Name(), ecorePackage.getEString(), "name", null, 0, 1, Member.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
243 | initEAttribute(getMember_Age(), ecorePackage.getEInt(), "age", "0", 0, 1, Member.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
244 | initEReference(getMember_Children(), this.getMember(), this.getMember_Parents(), "children", null, 0, -1, Member.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
245 | initEReference(getMember_Parents(), this.getMember(), this.getMember_Children(), "parents", null, 0, 2, Member.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
246 | |||
247 | // Create resource | ||
248 | createResource(eNS_URI); | ||
249 | } | ||
250 | |||
251 | } //FamilytreePackageImpl | ||
diff --git a/Tests/MODELS2020-CaseStudies/case.study.familyTree.model/src/familytree/impl/MemberImpl.java b/Tests/MODELS2020-CaseStudies/case.study.familyTree.model/src/familytree/impl/MemberImpl.java new file mode 100644 index 00000000..77e423bd --- /dev/null +++ b/Tests/MODELS2020-CaseStudies/case.study.familyTree.model/src/familytree/impl/MemberImpl.java | |||
@@ -0,0 +1,334 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package familytree.impl; | ||
4 | |||
5 | import familytree.FamilytreePackage; | ||
6 | import familytree.Member; | ||
7 | |||
8 | import java.util.Collection; | ||
9 | |||
10 | import org.eclipse.emf.common.notify.Notification; | ||
11 | import org.eclipse.emf.common.notify.NotificationChain; | ||
12 | |||
13 | import org.eclipse.emf.common.util.EList; | ||
14 | |||
15 | import org.eclipse.emf.ecore.EClass; | ||
16 | import org.eclipse.emf.ecore.InternalEObject; | ||
17 | |||
18 | import org.eclipse.emf.ecore.impl.ENotificationImpl; | ||
19 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; | ||
20 | |||
21 | import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList; | ||
22 | import org.eclipse.emf.ecore.util.InternalEList; | ||
23 | |||
24 | /** | ||
25 | * <!-- begin-user-doc --> | ||
26 | * An implementation of the model object '<em><b>Member</b></em>'. | ||
27 | * <!-- end-user-doc --> | ||
28 | * <p> | ||
29 | * The following features are implemented: | ||
30 | * </p> | ||
31 | * <ul> | ||
32 | * <li>{@link familytree.impl.MemberImpl#getName <em>Name</em>}</li> | ||
33 | * <li>{@link familytree.impl.MemberImpl#getAge <em>Age</em>}</li> | ||
34 | * <li>{@link familytree.impl.MemberImpl#getChildren <em>Children</em>}</li> | ||
35 | * <li>{@link familytree.impl.MemberImpl#getParents <em>Parents</em>}</li> | ||
36 | * </ul> | ||
37 | * | ||
38 | * @generated | ||
39 | */ | ||
40 | public class MemberImpl extends MinimalEObjectImpl.Container implements Member { | ||
41 | /** | ||
42 | * The default value of the '{@link #getName() <em>Name</em>}' attribute. | ||
43 | * <!-- begin-user-doc --> | ||
44 | * <!-- end-user-doc --> | ||
45 | * @see #getName() | ||
46 | * @generated | ||
47 | * @ordered | ||
48 | */ | ||
49 | protected static final String NAME_EDEFAULT = null; | ||
50 | |||
51 | /** | ||
52 | * The cached value of the '{@link #getName() <em>Name</em>}' attribute. | ||
53 | * <!-- begin-user-doc --> | ||
54 | * <!-- end-user-doc --> | ||
55 | * @see #getName() | ||
56 | * @generated | ||
57 | * @ordered | ||
58 | */ | ||
59 | protected String name = NAME_EDEFAULT; | ||
60 | |||
61 | /** | ||
62 | * The default value of the '{@link #getAge() <em>Age</em>}' attribute. | ||
63 | * <!-- begin-user-doc --> | ||
64 | * <!-- end-user-doc --> | ||
65 | * @see #getAge() | ||
66 | * @generated | ||
67 | * @ordered | ||
68 | */ | ||
69 | protected static final int AGE_EDEFAULT = 0; | ||
70 | |||
71 | /** | ||
72 | * The cached value of the '{@link #getAge() <em>Age</em>}' attribute. | ||
73 | * <!-- begin-user-doc --> | ||
74 | * <!-- end-user-doc --> | ||
75 | * @see #getAge() | ||
76 | * @generated | ||
77 | * @ordered | ||
78 | */ | ||
79 | protected int age = AGE_EDEFAULT; | ||
80 | |||
81 | /** | ||
82 | * The cached value of the '{@link #getChildren() <em>Children</em>}' reference list. | ||
83 | * <!-- begin-user-doc --> | ||
84 | * <!-- end-user-doc --> | ||
85 | * @see #getChildren() | ||
86 | * @generated | ||
87 | * @ordered | ||
88 | */ | ||
89 | protected EList<Member> children; | ||
90 | |||
91 | /** | ||
92 | * The cached value of the '{@link #getParents() <em>Parents</em>}' reference list. | ||
93 | * <!-- begin-user-doc --> | ||
94 | * <!-- end-user-doc --> | ||
95 | * @see #getParents() | ||
96 | * @generated | ||
97 | * @ordered | ||
98 | */ | ||
99 | protected EList<Member> parents; | ||
100 | |||
101 | /** | ||
102 | * <!-- begin-user-doc --> | ||
103 | * <!-- end-user-doc --> | ||
104 | * @generated | ||
105 | */ | ||
106 | protected MemberImpl() { | ||
107 | super(); | ||
108 | } | ||
109 | |||
110 | /** | ||
111 | * <!-- begin-user-doc --> | ||
112 | * <!-- end-user-doc --> | ||
113 | * @generated | ||
114 | */ | ||
115 | @Override | ||
116 | protected EClass eStaticClass() { | ||
117 | return FamilytreePackage.Literals.MEMBER; | ||
118 | } | ||
119 | |||
120 | /** | ||
121 | * <!-- begin-user-doc --> | ||
122 | * <!-- end-user-doc --> | ||
123 | * @generated | ||
124 | */ | ||
125 | @Override | ||
126 | public String getName() { | ||
127 | return name; | ||
128 | } | ||
129 | |||
130 | /** | ||
131 | * <!-- begin-user-doc --> | ||
132 | * <!-- end-user-doc --> | ||
133 | * @generated | ||
134 | */ | ||
135 | @Override | ||
136 | public void setName(String newName) { | ||
137 | String oldName = name; | ||
138 | name = newName; | ||
139 | if (eNotificationRequired()) | ||
140 | eNotify(new ENotificationImpl(this, Notification.SET, FamilytreePackage.MEMBER__NAME, oldName, name)); | ||
141 | } | ||
142 | |||
143 | /** | ||
144 | * <!-- begin-user-doc --> | ||
145 | * <!-- end-user-doc --> | ||
146 | * @generated | ||
147 | */ | ||
148 | @Override | ||
149 | public int getAge() { | ||
150 | return age; | ||
151 | } | ||
152 | |||
153 | /** | ||
154 | * <!-- begin-user-doc --> | ||
155 | * <!-- end-user-doc --> | ||
156 | * @generated | ||
157 | */ | ||
158 | @Override | ||
159 | public void setAge(int newAge) { | ||
160 | int oldAge = age; | ||
161 | age = newAge; | ||
162 | if (eNotificationRequired()) | ||
163 | eNotify(new ENotificationImpl(this, Notification.SET, FamilytreePackage.MEMBER__AGE, oldAge, age)); | ||
164 | } | ||
165 | |||
166 | /** | ||
167 | * <!-- begin-user-doc --> | ||
168 | * <!-- end-user-doc --> | ||
169 | * @generated | ||
170 | */ | ||
171 | @Override | ||
172 | public EList<Member> getChildren() { | ||
173 | if (children == null) { | ||
174 | children = new EObjectWithInverseResolvingEList.ManyInverse<Member>(Member.class, this, FamilytreePackage.MEMBER__CHILDREN, FamilytreePackage.MEMBER__PARENTS); | ||
175 | } | ||
176 | return children; | ||
177 | } | ||
178 | |||
179 | /** | ||
180 | * <!-- begin-user-doc --> | ||
181 | * <!-- end-user-doc --> | ||
182 | * @generated | ||
183 | */ | ||
184 | @Override | ||
185 | public EList<Member> getParents() { | ||
186 | if (parents == null) { | ||
187 | parents = new EObjectWithInverseResolvingEList.ManyInverse<Member>(Member.class, this, FamilytreePackage.MEMBER__PARENTS, FamilytreePackage.MEMBER__CHILDREN); | ||
188 | } | ||
189 | return parents; | ||
190 | } | ||
191 | |||
192 | /** | ||
193 | * <!-- begin-user-doc --> | ||
194 | * <!-- end-user-doc --> | ||
195 | * @generated | ||
196 | */ | ||
197 | @SuppressWarnings("unchecked") | ||
198 | @Override | ||
199 | public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
200 | switch (featureID) { | ||
201 | case FamilytreePackage.MEMBER__CHILDREN: | ||
202 | return ((InternalEList<InternalEObject>)(InternalEList<?>)getChildren()).basicAdd(otherEnd, msgs); | ||
203 | case FamilytreePackage.MEMBER__PARENTS: | ||
204 | return ((InternalEList<InternalEObject>)(InternalEList<?>)getParents()).basicAdd(otherEnd, msgs); | ||
205 | } | ||
206 | return super.eInverseAdd(otherEnd, featureID, msgs); | ||
207 | } | ||
208 | |||
209 | /** | ||
210 | * <!-- begin-user-doc --> | ||
211 | * <!-- end-user-doc --> | ||
212 | * @generated | ||
213 | */ | ||
214 | @Override | ||
215 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
216 | switch (featureID) { | ||
217 | case FamilytreePackage.MEMBER__CHILDREN: | ||
218 | return ((InternalEList<?>)getChildren()).basicRemove(otherEnd, msgs); | ||
219 | case FamilytreePackage.MEMBER__PARENTS: | ||
220 | return ((InternalEList<?>)getParents()).basicRemove(otherEnd, msgs); | ||
221 | } | ||
222 | return super.eInverseRemove(otherEnd, featureID, msgs); | ||
223 | } | ||
224 | |||
225 | /** | ||
226 | * <!-- begin-user-doc --> | ||
227 | * <!-- end-user-doc --> | ||
228 | * @generated | ||
229 | */ | ||
230 | @Override | ||
231 | public Object eGet(int featureID, boolean resolve, boolean coreType) { | ||
232 | switch (featureID) { | ||
233 | case FamilytreePackage.MEMBER__NAME: | ||
234 | return getName(); | ||
235 | case FamilytreePackage.MEMBER__AGE: | ||
236 | return getAge(); | ||
237 | case FamilytreePackage.MEMBER__CHILDREN: | ||
238 | return getChildren(); | ||
239 | case FamilytreePackage.MEMBER__PARENTS: | ||
240 | return getParents(); | ||
241 | } | ||
242 | return super.eGet(featureID, resolve, coreType); | ||
243 | } | ||
244 | |||
245 | /** | ||
246 | * <!-- begin-user-doc --> | ||
247 | * <!-- end-user-doc --> | ||
248 | * @generated | ||
249 | */ | ||
250 | @SuppressWarnings("unchecked") | ||
251 | @Override | ||
252 | public void eSet(int featureID, Object newValue) { | ||
253 | switch (featureID) { | ||
254 | case FamilytreePackage.MEMBER__NAME: | ||
255 | setName((String)newValue); | ||
256 | return; | ||
257 | case FamilytreePackage.MEMBER__AGE: | ||
258 | setAge((Integer)newValue); | ||
259 | return; | ||
260 | case FamilytreePackage.MEMBER__CHILDREN: | ||
261 | getChildren().clear(); | ||
262 | getChildren().addAll((Collection<? extends Member>)newValue); | ||
263 | return; | ||
264 | case FamilytreePackage.MEMBER__PARENTS: | ||
265 | getParents().clear(); | ||
266 | getParents().addAll((Collection<? extends Member>)newValue); | ||
267 | return; | ||
268 | } | ||
269 | super.eSet(featureID, newValue); | ||
270 | } | ||
271 | |||
272 | /** | ||
273 | * <!-- begin-user-doc --> | ||
274 | * <!-- end-user-doc --> | ||
275 | * @generated | ||
276 | */ | ||
277 | @Override | ||
278 | public void eUnset(int featureID) { | ||
279 | switch (featureID) { | ||
280 | case FamilytreePackage.MEMBER__NAME: | ||
281 | setName(NAME_EDEFAULT); | ||
282 | return; | ||
283 | case FamilytreePackage.MEMBER__AGE: | ||
284 | setAge(AGE_EDEFAULT); | ||
285 | return; | ||
286 | case FamilytreePackage.MEMBER__CHILDREN: | ||
287 | getChildren().clear(); | ||
288 | return; | ||
289 | case FamilytreePackage.MEMBER__PARENTS: | ||
290 | getParents().clear(); | ||
291 | return; | ||
292 | } | ||
293 | super.eUnset(featureID); | ||
294 | } | ||
295 | |||
296 | /** | ||
297 | * <!-- begin-user-doc --> | ||
298 | * <!-- end-user-doc --> | ||
299 | * @generated | ||
300 | */ | ||
301 | @Override | ||
302 | public boolean eIsSet(int featureID) { | ||
303 | switch (featureID) { | ||
304 | case FamilytreePackage.MEMBER__NAME: | ||
305 | return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); | ||
306 | case FamilytreePackage.MEMBER__AGE: | ||
307 | return age != AGE_EDEFAULT; | ||
308 | case FamilytreePackage.MEMBER__CHILDREN: | ||
309 | return children != null && !children.isEmpty(); | ||
310 | case FamilytreePackage.MEMBER__PARENTS: | ||
311 | return parents != null && !parents.isEmpty(); | ||
312 | } | ||
313 | return super.eIsSet(featureID); | ||
314 | } | ||
315 | |||
316 | /** | ||
317 | * <!-- begin-user-doc --> | ||
318 | * <!-- end-user-doc --> | ||
319 | * @generated | ||
320 | */ | ||
321 | @Override | ||
322 | public String toString() { | ||
323 | if (eIsProxy()) return super.toString(); | ||
324 | |||
325 | StringBuilder result = new StringBuilder(super.toString()); | ||
326 | result.append(" (name: "); | ||
327 | result.append(name); | ||
328 | result.append(", age: "); | ||
329 | result.append(age); | ||
330 | result.append(')'); | ||
331 | return result.toString(); | ||
332 | } | ||
333 | |||
334 | } //MemberImpl | ||