diff options
Diffstat (limited to 'Tests/MODELS2020-CaseStudies/case.study.familyTree.model/src/familytree/util')
2 files changed, 269 insertions, 0 deletions
diff --git a/Tests/MODELS2020-CaseStudies/case.study.familyTree.model/src/familytree/util/FamilytreeAdapterFactory.java b/Tests/MODELS2020-CaseStudies/case.study.familyTree.model/src/familytree/util/FamilytreeAdapterFactory.java new file mode 100644 index 00000000..6412c40f --- /dev/null +++ b/Tests/MODELS2020-CaseStudies/case.study.familyTree.model/src/familytree/util/FamilytreeAdapterFactory.java | |||
@@ -0,0 +1,138 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package familytree.util; | ||
4 | |||
5 | import familytree.*; | ||
6 | |||
7 | import org.eclipse.emf.common.notify.Adapter; | ||
8 | import org.eclipse.emf.common.notify.Notifier; | ||
9 | |||
10 | import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; | ||
11 | |||
12 | import org.eclipse.emf.ecore.EObject; | ||
13 | |||
14 | /** | ||
15 | * <!-- begin-user-doc --> | ||
16 | * The <b>Adapter Factory</b> for the model. | ||
17 | * It provides an adapter <code>createXXX</code> method for each class of the model. | ||
18 | * <!-- end-user-doc --> | ||
19 | * @see familytree.FamilytreePackage | ||
20 | * @generated | ||
21 | */ | ||
22 | public class FamilytreeAdapterFactory extends AdapterFactoryImpl { | ||
23 | /** | ||
24 | * The cached model package. | ||
25 | * <!-- begin-user-doc --> | ||
26 | * <!-- end-user-doc --> | ||
27 | * @generated | ||
28 | */ | ||
29 | protected static FamilytreePackage modelPackage; | ||
30 | |||
31 | /** | ||
32 | * Creates an instance of the adapter factory. | ||
33 | * <!-- begin-user-doc --> | ||
34 | * <!-- end-user-doc --> | ||
35 | * @generated | ||
36 | */ | ||
37 | public FamilytreeAdapterFactory() { | ||
38 | if (modelPackage == null) { | ||
39 | modelPackage = FamilytreePackage.eINSTANCE; | ||
40 | } | ||
41 | } | ||
42 | |||
43 | /** | ||
44 | * Returns whether this factory is applicable for the type of the object. | ||
45 | * <!-- begin-user-doc --> | ||
46 | * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model. | ||
47 | * <!-- end-user-doc --> | ||
48 | * @return whether this factory is applicable for the type of the object. | ||
49 | * @generated | ||
50 | */ | ||
51 | @Override | ||
52 | public boolean isFactoryForType(Object object) { | ||
53 | if (object == modelPackage) { | ||
54 | return true; | ||
55 | } | ||
56 | if (object instanceof EObject) { | ||
57 | return ((EObject)object).eClass().getEPackage() == modelPackage; | ||
58 | } | ||
59 | return false; | ||
60 | } | ||
61 | |||
62 | /** | ||
63 | * The switch that delegates to the <code>createXXX</code> methods. | ||
64 | * <!-- begin-user-doc --> | ||
65 | * <!-- end-user-doc --> | ||
66 | * @generated | ||
67 | */ | ||
68 | protected FamilytreeSwitch<Adapter> modelSwitch = | ||
69 | new FamilytreeSwitch<Adapter>() { | ||
70 | @Override | ||
71 | public Adapter caseFamilyTree(FamilyTree object) { | ||
72 | return createFamilyTreeAdapter(); | ||
73 | } | ||
74 | @Override | ||
75 | public Adapter caseMember(Member object) { | ||
76 | return createMemberAdapter(); | ||
77 | } | ||
78 | @Override | ||
79 | public Adapter defaultCase(EObject object) { | ||
80 | return createEObjectAdapter(); | ||
81 | } | ||
82 | }; | ||
83 | |||
84 | /** | ||
85 | * Creates an adapter for the <code>target</code>. | ||
86 | * <!-- begin-user-doc --> | ||
87 | * <!-- end-user-doc --> | ||
88 | * @param target the object to adapt. | ||
89 | * @return the adapter for the <code>target</code>. | ||
90 | * @generated | ||
91 | */ | ||
92 | @Override | ||
93 | public Adapter createAdapter(Notifier target) { | ||
94 | return modelSwitch.doSwitch((EObject)target); | ||
95 | } | ||
96 | |||
97 | |||
98 | /** | ||
99 | * Creates a new adapter for an object of class '{@link familytree.FamilyTree <em>Family Tree</em>}'. | ||
100 | * <!-- begin-user-doc --> | ||
101 | * This default implementation returns null so that we can easily ignore cases; | ||
102 | * it's useful to ignore a case when inheritance will catch all the cases anyway. | ||
103 | * <!-- end-user-doc --> | ||
104 | * @return the new adapter. | ||
105 | * @see familytree.FamilyTree | ||
106 | * @generated | ||
107 | */ | ||
108 | public Adapter createFamilyTreeAdapter() { | ||
109 | return null; | ||
110 | } | ||
111 | |||
112 | /** | ||
113 | * Creates a new adapter for an object of class '{@link familytree.Member <em>Member</em>}'. | ||
114 | * <!-- begin-user-doc --> | ||
115 | * This default implementation returns null so that we can easily ignore cases; | ||
116 | * it's useful to ignore a case when inheritance will catch all the cases anyway. | ||
117 | * <!-- end-user-doc --> | ||
118 | * @return the new adapter. | ||
119 | * @see familytree.Member | ||
120 | * @generated | ||
121 | */ | ||
122 | public Adapter createMemberAdapter() { | ||
123 | return null; | ||
124 | } | ||
125 | |||
126 | /** | ||
127 | * Creates a new adapter for the default case. | ||
128 | * <!-- begin-user-doc --> | ||
129 | * This default implementation returns null. | ||
130 | * <!-- end-user-doc --> | ||
131 | * @return the new adapter. | ||
132 | * @generated | ||
133 | */ | ||
134 | public Adapter createEObjectAdapter() { | ||
135 | return null; | ||
136 | } | ||
137 | |||
138 | } //FamilytreeAdapterFactory | ||
diff --git a/Tests/MODELS2020-CaseStudies/case.study.familyTree.model/src/familytree/util/FamilytreeSwitch.java b/Tests/MODELS2020-CaseStudies/case.study.familyTree.model/src/familytree/util/FamilytreeSwitch.java new file mode 100644 index 00000000..75bbce3d --- /dev/null +++ b/Tests/MODELS2020-CaseStudies/case.study.familyTree.model/src/familytree/util/FamilytreeSwitch.java | |||
@@ -0,0 +1,131 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package familytree.util; | ||
4 | |||
5 | import familytree.*; | ||
6 | |||
7 | import org.eclipse.emf.ecore.EObject; | ||
8 | import org.eclipse.emf.ecore.EPackage; | ||
9 | |||
10 | import org.eclipse.emf.ecore.util.Switch; | ||
11 | |||
12 | /** | ||
13 | * <!-- begin-user-doc --> | ||
14 | * The <b>Switch</b> for the model's inheritance hierarchy. | ||
15 | * It supports the call {@link #doSwitch(EObject) doSwitch(object)} | ||
16 | * to invoke the <code>caseXXX</code> method for each class of the model, | ||
17 | * starting with the actual class of the object | ||
18 | * and proceeding up the inheritance hierarchy | ||
19 | * until a non-null result is returned, | ||
20 | * which is the result of the switch. | ||
21 | * <!-- end-user-doc --> | ||
22 | * @see familytree.FamilytreePackage | ||
23 | * @generated | ||
24 | */ | ||
25 | public class FamilytreeSwitch<T> extends Switch<T> { | ||
26 | /** | ||
27 | * The cached model package | ||
28 | * <!-- begin-user-doc --> | ||
29 | * <!-- end-user-doc --> | ||
30 | * @generated | ||
31 | */ | ||
32 | protected static FamilytreePackage modelPackage; | ||
33 | |||
34 | /** | ||
35 | * Creates an instance of the switch. | ||
36 | * <!-- begin-user-doc --> | ||
37 | * <!-- end-user-doc --> | ||
38 | * @generated | ||
39 | */ | ||
40 | public FamilytreeSwitch() { | ||
41 | if (modelPackage == null) { | ||
42 | modelPackage = FamilytreePackage.eINSTANCE; | ||
43 | } | ||
44 | } | ||
45 | |||
46 | /** | ||
47 | * Checks whether this is a switch for the given package. | ||
48 | * <!-- begin-user-doc --> | ||
49 | * <!-- end-user-doc --> | ||
50 | * @param ePackage the package in question. | ||
51 | * @return whether this is a switch for the given package. | ||
52 | * @generated | ||
53 | */ | ||
54 | @Override | ||
55 | protected boolean isSwitchFor(EPackage ePackage) { | ||
56 | return ePackage == modelPackage; | ||
57 | } | ||
58 | |||
59 | /** | ||
60 | * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result. | ||
61 | * <!-- begin-user-doc --> | ||
62 | * <!-- end-user-doc --> | ||
63 | * @return the first non-null result returned by a <code>caseXXX</code> call. | ||
64 | * @generated | ||
65 | */ | ||
66 | @Override | ||
67 | protected T doSwitch(int classifierID, EObject theEObject) { | ||
68 | switch (classifierID) { | ||
69 | case FamilytreePackage.FAMILY_TREE: { | ||
70 | FamilyTree familyTree = (FamilyTree)theEObject; | ||
71 | T result = caseFamilyTree(familyTree); | ||
72 | if (result == null) result = defaultCase(theEObject); | ||
73 | return result; | ||
74 | } | ||
75 | case FamilytreePackage.MEMBER: { | ||
76 | Member member = (Member)theEObject; | ||
77 | T result = caseMember(member); | ||
78 | if (result == null) result = defaultCase(theEObject); | ||
79 | return result; | ||
80 | } | ||
81 | default: return defaultCase(theEObject); | ||
82 | } | ||
83 | } | ||
84 | |||
85 | /** | ||
86 | * Returns the result of interpreting the object as an instance of '<em>Family Tree</em>'. | ||
87 | * <!-- begin-user-doc --> | ||
88 | * This implementation returns null; | ||
89 | * returning a non-null result will terminate the switch. | ||
90 | * <!-- end-user-doc --> | ||
91 | * @param object the target of the switch. | ||
92 | * @return the result of interpreting the object as an instance of '<em>Family Tree</em>'. | ||
93 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | ||
94 | * @generated | ||
95 | */ | ||
96 | public T caseFamilyTree(FamilyTree object) { | ||
97 | return null; | ||
98 | } | ||
99 | |||
100 | /** | ||
101 | * Returns the result of interpreting the object as an instance of '<em>Member</em>'. | ||
102 | * <!-- begin-user-doc --> | ||
103 | * This implementation returns null; | ||
104 | * returning a non-null result will terminate the switch. | ||
105 | * <!-- end-user-doc --> | ||
106 | * @param object the target of the switch. | ||
107 | * @return the result of interpreting the object as an instance of '<em>Member</em>'. | ||
108 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | ||
109 | * @generated | ||
110 | */ | ||
111 | public T caseMember(Member object) { | ||
112 | return null; | ||
113 | } | ||
114 | |||
115 | /** | ||
116 | * Returns the result of interpreting the object as an instance of '<em>EObject</em>'. | ||
117 | * <!-- begin-user-doc --> | ||
118 | * This implementation returns null; | ||
119 | * returning a non-null result will terminate the switch, but this is the last case anyway. | ||
120 | * <!-- end-user-doc --> | ||
121 | * @param object the target of the switch. | ||
122 | * @return the result of interpreting the object as an instance of '<em>EObject</em>'. | ||
123 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) | ||
124 | * @generated | ||
125 | */ | ||
126 | @Override | ||
127 | public T defaultCase(EObject object) { | ||
128 | return null; | ||
129 | } | ||
130 | |||
131 | } //FamilytreeSwitch | ||