aboutsummaryrefslogtreecommitdiffstats
path: root/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/linkedList/util
diff options
context:
space:
mode:
authorLibravatar ArenBabikian <aren.babikian@mail.mcgill.ca>2019-05-19 04:57:59 -0400
committerLibravatar ArenBabikian <aren.babikian@mail.mcgill.ca>2019-05-19 04:57:59 -0400
commit250722c453223a238192fda8db9e692ea776afc7 (patch)
treed3ba95ae84e0119cb222cf9d3540f6a944cc7321 /Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/linkedList/util
parentadd inital metrics project (diff)
downloadVIATRA-Generator-250722c453223a238192fda8db9e692ea776afc7.tar.gz
VIATRA-Generator-250722c453223a238192fda8db9e692ea776afc7.tar.zst
VIATRA-Generator-250722c453223a238192fda8db9e692ea776afc7.zip
REALMET: first impl of n'hood visualis. minor bug with adding outgng 0s.
Diffstat (limited to 'Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/linkedList/util')
-rw-r--r--Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/linkedList/util/LinkedListAdapterFactory.java158
-rw-r--r--Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/linkedList/util/LinkedListSwitch.java154
2 files changed, 312 insertions, 0 deletions
diff --git a/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/linkedList/util/LinkedListAdapterFactory.java b/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/linkedList/util/LinkedListAdapterFactory.java
new file mode 100644
index 00000000..583192ba
--- /dev/null
+++ b/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/linkedList/util/LinkedListAdapterFactory.java
@@ -0,0 +1,158 @@
1/**
2 */
3package linkedList.util;
4
5import linkedList.Element;
6import linkedList.LinkedListPackage;
7import linkedList.List;
8
9import org.eclipse.emf.common.notify.Adapter;
10import org.eclipse.emf.common.notify.Notifier;
11
12import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
13
14import org.eclipse.emf.ecore.EObject;
15
16/**
17 * <!-- begin-user-doc -->
18 * The <b>Adapter Factory</b> for the model.
19 * It provides an adapter <code>createXXX</code> method for each class of the model.
20 * <!-- end-user-doc -->
21 * @see linkedList.LinkedListPackage
22 * @generated
23 */
24public class LinkedListAdapterFactory extends AdapterFactoryImpl {
25 /**
26 * The cached model package.
27 * <!-- begin-user-doc -->
28 * <!-- end-user-doc -->
29 * @generated
30 */
31 protected static LinkedListPackage modelPackage;
32
33 /**
34 * Creates an instance of the adapter factory.
35 * <!-- begin-user-doc -->
36 * <!-- end-user-doc -->
37 * @generated
38 */
39 public LinkedListAdapterFactory() {
40 if (modelPackage == null) {
41 modelPackage = LinkedListPackage.eINSTANCE;
42 }
43 }
44
45 /**
46 * Returns whether this factory is applicable for the type of the object.
47 * <!-- begin-user-doc -->
48 * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
49 * <!-- end-user-doc -->
50 * @return whether this factory is applicable for the type of the object.
51 * @generated
52 */
53 @Override
54 public boolean isFactoryForType(Object object) {
55 if (object == modelPackage) {
56 return true;
57 }
58 if (object instanceof EObject) {
59 return ((EObject)object).eClass().getEPackage() == modelPackage;
60 }
61 return false;
62 }
63
64 /**
65 * The switch that delegates to the <code>createXXX</code> methods.
66 * <!-- begin-user-doc -->
67 * <!-- end-user-doc -->
68 * @generated
69 */
70 protected LinkedListSwitch<Adapter> modelSwitch =
71 new LinkedListSwitch<Adapter>() {
72 @Override
73 public Adapter caseList(List object) {
74 return createListAdapter();
75 }
76 @Override
77 public Adapter caseElement(Element object) {
78 return createElementAdapter();
79 }
80 @Override
81 public Adapter caseObject(linkedList.Object object) {
82 return createObjectAdapter();
83 }
84 @Override
85 public Adapter defaultCase(EObject object) {
86 return createEObjectAdapter();
87 }
88 };
89
90 /**
91 * Creates an adapter for the <code>target</code>.
92 * <!-- begin-user-doc -->
93 * <!-- end-user-doc -->
94 * @param target the object to adapt.
95 * @return the adapter for the <code>target</code>.
96 * @generated
97 */
98 @Override
99 public Adapter createAdapter(Notifier target) {
100 return modelSwitch.doSwitch((EObject)target);
101 }
102
103
104 /**
105 * Creates a new adapter for an object of class '{@link linkedList.List <em>List</em>}'.
106 * <!-- begin-user-doc -->
107 * This default implementation returns null so that we can easily ignore cases;
108 * it's useful to ignore a case when inheritance will catch all the cases anyway.
109 * <!-- end-user-doc -->
110 * @return the new adapter.
111 * @see linkedList.List
112 * @generated
113 */
114 public Adapter createListAdapter() {
115 return null;
116 }
117
118 /**
119 * Creates a new adapter for an object of class '{@link linkedList.Element <em>Element</em>}'.
120 * <!-- begin-user-doc -->
121 * This default implementation returns null so that we can easily ignore cases;
122 * it's useful to ignore a case when inheritance will catch all the cases anyway.
123 * <!-- end-user-doc -->
124 * @return the new adapter.
125 * @see linkedList.Element
126 * @generated
127 */
128 public Adapter createElementAdapter() {
129 return null;
130 }
131
132 /**
133 * Creates a new adapter for an object of class '{@link linkedList.Object <em>Object</em>}'.
134 * <!-- begin-user-doc -->
135 * This default implementation returns null so that we can easily ignore cases;
136 * it's useful to ignore a case when inheritance will catch all the cases anyway.
137 * <!-- end-user-doc -->
138 * @return the new adapter.
139 * @see linkedList.Object
140 * @generated
141 */
142 public Adapter createObjectAdapter() {
143 return null;
144 }
145
146 /**
147 * Creates a new adapter for the default case.
148 * <!-- begin-user-doc -->
149 * This default implementation returns null.
150 * <!-- end-user-doc -->
151 * @return the new adapter.
152 * @generated
153 */
154 public Adapter createEObjectAdapter() {
155 return null;
156 }
157
158} //LinkedListAdapterFactory
diff --git a/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/linkedList/util/LinkedListSwitch.java b/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/linkedList/util/LinkedListSwitch.java
new file mode 100644
index 00000000..f5dcf560
--- /dev/null
+++ b/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/linkedList/util/LinkedListSwitch.java
@@ -0,0 +1,154 @@
1/**
2 */
3package linkedList.util;
4
5import linkedList.Element;
6import linkedList.LinkedListPackage;
7import linkedList.List;
8
9import org.eclipse.emf.ecore.EObject;
10import org.eclipse.emf.ecore.EPackage;
11
12import org.eclipse.emf.ecore.util.Switch;
13
14/**
15 * <!-- begin-user-doc -->
16 * The <b>Switch</b> for the model's inheritance hierarchy.
17 * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
18 * to invoke the <code>caseXXX</code> method for each class of the model,
19 * starting with the actual class of the object
20 * and proceeding up the inheritance hierarchy
21 * until a non-null result is returned,
22 * which is the result of the switch.
23 * <!-- end-user-doc -->
24 * @see linkedList.LinkedListPackage
25 * @generated
26 */
27public class LinkedListSwitch<T> extends Switch<T> {
28 /**
29 * The cached model package
30 * <!-- begin-user-doc -->
31 * <!-- end-user-doc -->
32 * @generated
33 */
34 protected static LinkedListPackage modelPackage;
35
36 /**
37 * Creates an instance of the switch.
38 * <!-- begin-user-doc -->
39 * <!-- end-user-doc -->
40 * @generated
41 */
42 public LinkedListSwitch() {
43 if (modelPackage == null) {
44 modelPackage = LinkedListPackage.eINSTANCE;
45 }
46 }
47
48 /**
49 * Checks whether this is a switch for the given package.
50 * <!-- begin-user-doc -->
51 * <!-- end-user-doc -->
52 * @param ePackage the package in question.
53 * @return whether this is a switch for the given package.
54 * @generated
55 */
56 @Override
57 protected boolean isSwitchFor(EPackage ePackage) {
58 return ePackage == modelPackage;
59 }
60
61 /**
62 * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
63 * <!-- begin-user-doc -->
64 * <!-- end-user-doc -->
65 * @return the first non-null result returned by a <code>caseXXX</code> call.
66 * @generated
67 */
68 @Override
69 protected T doSwitch(int classifierID, EObject theEObject) {
70 switch (classifierID) {
71 case LinkedListPackage.LIST: {
72 List list = (List)theEObject;
73 T result = caseList(list);
74 if (result == null) result = defaultCase(theEObject);
75 return result;
76 }
77 case LinkedListPackage.ELEMENT: {
78 Element element = (Element)theEObject;
79 T result = caseElement(element);
80 if (result == null) result = defaultCase(theEObject);
81 return result;
82 }
83 case LinkedListPackage.OBJECT: {
84 linkedList.Object object = (linkedList.Object)theEObject;
85 T result = caseObject(object);
86 if (result == null) result = defaultCase(theEObject);
87 return result;
88 }
89 default: return defaultCase(theEObject);
90 }
91 }
92
93 /**
94 * Returns the result of interpreting the object as an instance of '<em>List</em>'.
95 * <!-- begin-user-doc -->
96 * This implementation returns null;
97 * returning a non-null result will terminate the switch.
98 * <!-- end-user-doc -->
99 * @param object the target of the switch.
100 * @return the result of interpreting the object as an instance of '<em>List</em>'.
101 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
102 * @generated
103 */
104 public T caseList(List object) {
105 return null;
106 }
107
108 /**
109 * Returns the result of interpreting the object as an instance of '<em>Element</em>'.
110 * <!-- begin-user-doc -->
111 * This implementation returns null;
112 * returning a non-null result will terminate the switch.
113 * <!-- end-user-doc -->
114 * @param object the target of the switch.
115 * @return the result of interpreting the object as an instance of '<em>Element</em>'.
116 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
117 * @generated
118 */
119 public T caseElement(Element object) {
120 return null;
121 }
122
123 /**
124 * Returns the result of interpreting the object as an instance of '<em>Object</em>'.
125 * <!-- begin-user-doc -->
126 * This implementation returns null;
127 * returning a non-null result will terminate the switch.
128 * <!-- end-user-doc -->
129 * @param object the target of the switch.
130 * @return the result of interpreting the object as an instance of '<em>Object</em>'.
131 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
132 * @generated
133 */
134 public T caseObject(linkedList.Object object) {
135 return null;
136 }
137
138 /**
139 * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
140 * <!-- begin-user-doc -->
141 * This implementation returns null;
142 * returning a non-null result will terminate the switch, but this is the last case anyway.
143 * <!-- end-user-doc -->
144 * @param object the target of the switch.
145 * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
146 * @see #doSwitch(org.eclipse.emf.ecore.EObject)
147 * @generated
148 */
149 @Override
150 public T defaultCase(EObject object) {
151 return null;
152 }
153
154} //LinkedListSwitch