diff options
author | 2019-05-19 04:57:59 -0400 | |
---|---|---|
committer | 2019-05-19 04:57:59 -0400 | |
commit | 250722c453223a238192fda8db9e692ea776afc7 (patch) | |
tree | d3ba95ae84e0119cb222cf9d3540f6a944cc7321 /Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/linkedList/impl | |
parent | add inital metrics project (diff) | |
download | VIATRA-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/impl')
5 files changed, 812 insertions, 0 deletions
diff --git a/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/linkedList/impl/ElementImpl.java b/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/linkedList/impl/ElementImpl.java new file mode 100644 index 00000000..d08f707b --- /dev/null +++ b/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/linkedList/impl/ElementImpl.java | |||
@@ -0,0 +1,241 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package linkedList.impl; | ||
4 | |||
5 | import linkedList.Element; | ||
6 | import linkedList.LinkedListPackage; | ||
7 | |||
8 | import org.eclipse.emf.common.notify.Notification; | ||
9 | import org.eclipse.emf.common.notify.NotificationChain; | ||
10 | |||
11 | import org.eclipse.emf.ecore.EClass; | ||
12 | import org.eclipse.emf.ecore.InternalEObject; | ||
13 | |||
14 | import org.eclipse.emf.ecore.impl.ENotificationImpl; | ||
15 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; | ||
16 | |||
17 | /** | ||
18 | * <!-- begin-user-doc --> | ||
19 | * An implementation of the model object '<em><b>Element</b></em>'. | ||
20 | * <!-- end-user-doc --> | ||
21 | * <p> | ||
22 | * The following features are implemented: | ||
23 | * </p> | ||
24 | * <ul> | ||
25 | * <li>{@link linkedList.impl.ElementImpl#getValue <em>Value</em>}</li> | ||
26 | * <li>{@link linkedList.impl.ElementImpl#getNext <em>Next</em>}</li> | ||
27 | * </ul> | ||
28 | * | ||
29 | * @generated | ||
30 | */ | ||
31 | public class ElementImpl extends MinimalEObjectImpl.Container implements Element { | ||
32 | /** | ||
33 | * The cached value of the '{@link #getValue() <em>Value</em>}' containment reference. | ||
34 | * <!-- begin-user-doc --> | ||
35 | * <!-- end-user-doc --> | ||
36 | * @see #getValue() | ||
37 | * @generated | ||
38 | * @ordered | ||
39 | */ | ||
40 | protected linkedList.Object value; | ||
41 | |||
42 | /** | ||
43 | * The cached value of the '{@link #getNext() <em>Next</em>}' containment reference. | ||
44 | * <!-- begin-user-doc --> | ||
45 | * <!-- end-user-doc --> | ||
46 | * @see #getNext() | ||
47 | * @generated | ||
48 | * @ordered | ||
49 | */ | ||
50 | protected Element next; | ||
51 | |||
52 | /** | ||
53 | * <!-- begin-user-doc --> | ||
54 | * <!-- end-user-doc --> | ||
55 | * @generated | ||
56 | */ | ||
57 | protected ElementImpl() { | ||
58 | super(); | ||
59 | } | ||
60 | |||
61 | /** | ||
62 | * <!-- begin-user-doc --> | ||
63 | * <!-- end-user-doc --> | ||
64 | * @generated | ||
65 | */ | ||
66 | @Override | ||
67 | protected EClass eStaticClass() { | ||
68 | return LinkedListPackage.Literals.ELEMENT; | ||
69 | } | ||
70 | |||
71 | /** | ||
72 | * <!-- begin-user-doc --> | ||
73 | * <!-- end-user-doc --> | ||
74 | * @generated | ||
75 | */ | ||
76 | public linkedList.Object getValue() { | ||
77 | return value; | ||
78 | } | ||
79 | |||
80 | /** | ||
81 | * <!-- begin-user-doc --> | ||
82 | * <!-- end-user-doc --> | ||
83 | * @generated | ||
84 | */ | ||
85 | public NotificationChain basicSetValue(linkedList.Object newValue, NotificationChain msgs) { | ||
86 | linkedList.Object oldValue = value; | ||
87 | value = newValue; | ||
88 | if (eNotificationRequired()) { | ||
89 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, LinkedListPackage.ELEMENT__VALUE, oldValue, newValue); | ||
90 | if (msgs == null) msgs = notification; else msgs.add(notification); | ||
91 | } | ||
92 | return msgs; | ||
93 | } | ||
94 | |||
95 | /** | ||
96 | * <!-- begin-user-doc --> | ||
97 | * <!-- end-user-doc --> | ||
98 | * @generated | ||
99 | */ | ||
100 | public void setValue(linkedList.Object newValue) { | ||
101 | if (newValue != value) { | ||
102 | NotificationChain msgs = null; | ||
103 | if (value != null) | ||
104 | msgs = ((InternalEObject)value).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - LinkedListPackage.ELEMENT__VALUE, null, msgs); | ||
105 | if (newValue != null) | ||
106 | msgs = ((InternalEObject)newValue).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - LinkedListPackage.ELEMENT__VALUE, null, msgs); | ||
107 | msgs = basicSetValue(newValue, msgs); | ||
108 | if (msgs != null) msgs.dispatch(); | ||
109 | } | ||
110 | else if (eNotificationRequired()) | ||
111 | eNotify(new ENotificationImpl(this, Notification.SET, LinkedListPackage.ELEMENT__VALUE, newValue, newValue)); | ||
112 | } | ||
113 | |||
114 | /** | ||
115 | * <!-- begin-user-doc --> | ||
116 | * <!-- end-user-doc --> | ||
117 | * @generated | ||
118 | */ | ||
119 | public Element getNext() { | ||
120 | return next; | ||
121 | } | ||
122 | |||
123 | /** | ||
124 | * <!-- begin-user-doc --> | ||
125 | * <!-- end-user-doc --> | ||
126 | * @generated | ||
127 | */ | ||
128 | public NotificationChain basicSetNext(Element newNext, NotificationChain msgs) { | ||
129 | Element oldNext = next; | ||
130 | next = newNext; | ||
131 | if (eNotificationRequired()) { | ||
132 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, LinkedListPackage.ELEMENT__NEXT, oldNext, newNext); | ||
133 | if (msgs == null) msgs = notification; else msgs.add(notification); | ||
134 | } | ||
135 | return msgs; | ||
136 | } | ||
137 | |||
138 | /** | ||
139 | * <!-- begin-user-doc --> | ||
140 | * <!-- end-user-doc --> | ||
141 | * @generated | ||
142 | */ | ||
143 | public void setNext(Element newNext) { | ||
144 | if (newNext != next) { | ||
145 | NotificationChain msgs = null; | ||
146 | if (next != null) | ||
147 | msgs = ((InternalEObject)next).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - LinkedListPackage.ELEMENT__NEXT, null, msgs); | ||
148 | if (newNext != null) | ||
149 | msgs = ((InternalEObject)newNext).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - LinkedListPackage.ELEMENT__NEXT, null, msgs); | ||
150 | msgs = basicSetNext(newNext, msgs); | ||
151 | if (msgs != null) msgs.dispatch(); | ||
152 | } | ||
153 | else if (eNotificationRequired()) | ||
154 | eNotify(new ENotificationImpl(this, Notification.SET, LinkedListPackage.ELEMENT__NEXT, newNext, newNext)); | ||
155 | } | ||
156 | |||
157 | /** | ||
158 | * <!-- begin-user-doc --> | ||
159 | * <!-- end-user-doc --> | ||
160 | * @generated | ||
161 | */ | ||
162 | @Override | ||
163 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
164 | switch (featureID) { | ||
165 | case LinkedListPackage.ELEMENT__VALUE: | ||
166 | return basicSetValue(null, msgs); | ||
167 | case LinkedListPackage.ELEMENT__NEXT: | ||
168 | return basicSetNext(null, msgs); | ||
169 | } | ||
170 | return super.eInverseRemove(otherEnd, featureID, msgs); | ||
171 | } | ||
172 | |||
173 | /** | ||
174 | * <!-- begin-user-doc --> | ||
175 | * <!-- end-user-doc --> | ||
176 | * @generated | ||
177 | */ | ||
178 | @Override | ||
179 | public Object eGet(int featureID, boolean resolve, boolean coreType) { | ||
180 | switch (featureID) { | ||
181 | case LinkedListPackage.ELEMENT__VALUE: | ||
182 | return getValue(); | ||
183 | case LinkedListPackage.ELEMENT__NEXT: | ||
184 | return getNext(); | ||
185 | } | ||
186 | return super.eGet(featureID, resolve, coreType); | ||
187 | } | ||
188 | |||
189 | /** | ||
190 | * <!-- begin-user-doc --> | ||
191 | * <!-- end-user-doc --> | ||
192 | * @generated | ||
193 | */ | ||
194 | @Override | ||
195 | public void eSet(int featureID, Object newValue) { | ||
196 | switch (featureID) { | ||
197 | case LinkedListPackage.ELEMENT__VALUE: | ||
198 | setValue((linkedList.Object)newValue); | ||
199 | return; | ||
200 | case LinkedListPackage.ELEMENT__NEXT: | ||
201 | setNext((Element)newValue); | ||
202 | return; | ||
203 | } | ||
204 | super.eSet(featureID, newValue); | ||
205 | } | ||
206 | |||
207 | /** | ||
208 | * <!-- begin-user-doc --> | ||
209 | * <!-- end-user-doc --> | ||
210 | * @generated | ||
211 | */ | ||
212 | @Override | ||
213 | public void eUnset(int featureID) { | ||
214 | switch (featureID) { | ||
215 | case LinkedListPackage.ELEMENT__VALUE: | ||
216 | setValue((linkedList.Object)null); | ||
217 | return; | ||
218 | case LinkedListPackage.ELEMENT__NEXT: | ||
219 | setNext((Element)null); | ||
220 | return; | ||
221 | } | ||
222 | super.eUnset(featureID); | ||
223 | } | ||
224 | |||
225 | /** | ||
226 | * <!-- begin-user-doc --> | ||
227 | * <!-- end-user-doc --> | ||
228 | * @generated | ||
229 | */ | ||
230 | @Override | ||
231 | public boolean eIsSet(int featureID) { | ||
232 | switch (featureID) { | ||
233 | case LinkedListPackage.ELEMENT__VALUE: | ||
234 | return value != null; | ||
235 | case LinkedListPackage.ELEMENT__NEXT: | ||
236 | return next != null; | ||
237 | } | ||
238 | return super.eIsSet(featureID); | ||
239 | } | ||
240 | |||
241 | } //ElementImpl | ||
diff --git a/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/linkedList/impl/LinkedListFactoryImpl.java b/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/linkedList/impl/LinkedListFactoryImpl.java new file mode 100644 index 00000000..1a66a5e4 --- /dev/null +++ b/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/linkedList/impl/LinkedListFactoryImpl.java | |||
@@ -0,0 +1,120 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package linkedList.impl; | ||
4 | |||
5 | import linkedList.Element; | ||
6 | import linkedList.LinkedListFactory; | ||
7 | import linkedList.LinkedListPackage; | ||
8 | import linkedList.List; | ||
9 | |||
10 | import org.eclipse.emf.ecore.EClass; | ||
11 | import org.eclipse.emf.ecore.EObject; | ||
12 | import org.eclipse.emf.ecore.EPackage; | ||
13 | |||
14 | import org.eclipse.emf.ecore.impl.EFactoryImpl; | ||
15 | |||
16 | import org.eclipse.emf.ecore.plugin.EcorePlugin; | ||
17 | |||
18 | /** | ||
19 | * <!-- begin-user-doc --> | ||
20 | * An implementation of the model <b>Factory</b>. | ||
21 | * <!-- end-user-doc --> | ||
22 | * @generated | ||
23 | */ | ||
24 | public class LinkedListFactoryImpl extends EFactoryImpl implements LinkedListFactory { | ||
25 | /** | ||
26 | * Creates the default factory implementation. | ||
27 | * <!-- begin-user-doc --> | ||
28 | * <!-- end-user-doc --> | ||
29 | * @generated | ||
30 | */ | ||
31 | public static LinkedListFactory init() { | ||
32 | try { | ||
33 | LinkedListFactory theLinkedListFactory = (LinkedListFactory)EPackage.Registry.INSTANCE.getEFactory(LinkedListPackage.eNS_URI); | ||
34 | if (theLinkedListFactory != null) { | ||
35 | return theLinkedListFactory; | ||
36 | } | ||
37 | } | ||
38 | catch (Exception exception) { | ||
39 | EcorePlugin.INSTANCE.log(exception); | ||
40 | } | ||
41 | return new LinkedListFactoryImpl(); | ||
42 | } | ||
43 | |||
44 | /** | ||
45 | * Creates an instance of the factory. | ||
46 | * <!-- begin-user-doc --> | ||
47 | * <!-- end-user-doc --> | ||
48 | * @generated | ||
49 | */ | ||
50 | public LinkedListFactoryImpl() { | ||
51 | super(); | ||
52 | } | ||
53 | |||
54 | /** | ||
55 | * <!-- begin-user-doc --> | ||
56 | * <!-- end-user-doc --> | ||
57 | * @generated | ||
58 | */ | ||
59 | @Override | ||
60 | public EObject create(EClass eClass) { | ||
61 | switch (eClass.getClassifierID()) { | ||
62 | case LinkedListPackage.LIST: return createList(); | ||
63 | case LinkedListPackage.ELEMENT: return createElement(); | ||
64 | case LinkedListPackage.OBJECT: return createObject(); | ||
65 | default: | ||
66 | throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); | ||
67 | } | ||
68 | } | ||
69 | |||
70 | /** | ||
71 | * <!-- begin-user-doc --> | ||
72 | * <!-- end-user-doc --> | ||
73 | * @generated | ||
74 | */ | ||
75 | public List createList() { | ||
76 | ListImpl list = new ListImpl(); | ||
77 | return list; | ||
78 | } | ||
79 | |||
80 | /** | ||
81 | * <!-- begin-user-doc --> | ||
82 | * <!-- end-user-doc --> | ||
83 | * @generated | ||
84 | */ | ||
85 | public Element createElement() { | ||
86 | ElementImpl element = new ElementImpl(); | ||
87 | return element; | ||
88 | } | ||
89 | |||
90 | /** | ||
91 | * <!-- begin-user-doc --> | ||
92 | * <!-- end-user-doc --> | ||
93 | * @generated | ||
94 | */ | ||
95 | public linkedList.Object createObject() { | ||
96 | ObjectImpl object = new ObjectImpl(); | ||
97 | return object; | ||
98 | } | ||
99 | |||
100 | /** | ||
101 | * <!-- begin-user-doc --> | ||
102 | * <!-- end-user-doc --> | ||
103 | * @generated | ||
104 | */ | ||
105 | public LinkedListPackage getLinkedListPackage() { | ||
106 | return (LinkedListPackage)getEPackage(); | ||
107 | } | ||
108 | |||
109 | /** | ||
110 | * <!-- begin-user-doc --> | ||
111 | * <!-- end-user-doc --> | ||
112 | * @deprecated | ||
113 | * @generated | ||
114 | */ | ||
115 | @Deprecated | ||
116 | public static LinkedListPackage getPackage() { | ||
117 | return LinkedListPackage.eINSTANCE; | ||
118 | } | ||
119 | |||
120 | } //LinkedListFactoryImpl | ||
diff --git a/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/linkedList/impl/LinkedListPackageImpl.java b/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/linkedList/impl/LinkedListPackageImpl.java new file mode 100644 index 00000000..f190c4d0 --- /dev/null +++ b/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/linkedList/impl/LinkedListPackageImpl.java | |||
@@ -0,0 +1,239 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package linkedList.impl; | ||
4 | |||
5 | import linkedList.Element; | ||
6 | import linkedList.LinkedListFactory; | ||
7 | import linkedList.LinkedListPackage; | ||
8 | import linkedList.List; | ||
9 | import org.eclipse.emf.ecore.EClass; | ||
10 | import org.eclipse.emf.ecore.EPackage; | ||
11 | import org.eclipse.emf.ecore.EReference; | ||
12 | |||
13 | import org.eclipse.emf.ecore.impl.EPackageImpl; | ||
14 | |||
15 | /** | ||
16 | * <!-- begin-user-doc --> | ||
17 | * An implementation of the model <b>Package</b>. | ||
18 | * <!-- end-user-doc --> | ||
19 | * @generated | ||
20 | */ | ||
21 | public class LinkedListPackageImpl extends EPackageImpl implements LinkedListPackage { | ||
22 | /** | ||
23 | * <!-- begin-user-doc --> | ||
24 | * <!-- end-user-doc --> | ||
25 | * @generated | ||
26 | */ | ||
27 | private EClass listEClass = null; | ||
28 | |||
29 | /** | ||
30 | * <!-- begin-user-doc --> | ||
31 | * <!-- end-user-doc --> | ||
32 | * @generated | ||
33 | */ | ||
34 | private EClass elementEClass = null; | ||
35 | |||
36 | /** | ||
37 | * <!-- begin-user-doc --> | ||
38 | * <!-- end-user-doc --> | ||
39 | * @generated | ||
40 | */ | ||
41 | private EClass objectEClass = null; | ||
42 | |||
43 | /** | ||
44 | * Creates an instance of the model <b>Package</b>, registered with | ||
45 | * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package | ||
46 | * package URI value. | ||
47 | * <p>Note: the correct way to create the package is via the static | ||
48 | * factory method {@link #init init()}, which also performs | ||
49 | * initialization of the package, or returns the registered package, | ||
50 | * if one already exists. | ||
51 | * <!-- begin-user-doc --> | ||
52 | * <!-- end-user-doc --> | ||
53 | * @see org.eclipse.emf.ecore.EPackage.Registry | ||
54 | * @see linkedList.LinkedListPackage#eNS_URI | ||
55 | * @see #init() | ||
56 | * @generated | ||
57 | */ | ||
58 | private LinkedListPackageImpl() { | ||
59 | super(eNS_URI, LinkedListFactory.eINSTANCE); | ||
60 | } | ||
61 | |||
62 | /** | ||
63 | * <!-- begin-user-doc --> | ||
64 | * <!-- end-user-doc --> | ||
65 | * @generated | ||
66 | */ | ||
67 | private static boolean isInited = false; | ||
68 | |||
69 | /** | ||
70 | * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends. | ||
71 | * | ||
72 | * <p>This method is used to initialize {@link LinkedListPackage#eINSTANCE} when that field is accessed. | ||
73 | * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. | ||
74 | * <!-- begin-user-doc --> | ||
75 | * <!-- end-user-doc --> | ||
76 | * @see #eNS_URI | ||
77 | * @see #createPackageContents() | ||
78 | * @see #initializePackageContents() | ||
79 | * @generated | ||
80 | */ | ||
81 | public static LinkedListPackage init() { | ||
82 | if (isInited) return (LinkedListPackage)EPackage.Registry.INSTANCE.getEPackage(LinkedListPackage.eNS_URI); | ||
83 | |||
84 | // Obtain or create and register package | ||
85 | Object registeredLinkedListPackage = EPackage.Registry.INSTANCE.get(eNS_URI); | ||
86 | LinkedListPackageImpl theLinkedListPackage = registeredLinkedListPackage instanceof LinkedListPackageImpl ? (LinkedListPackageImpl)registeredLinkedListPackage : new LinkedListPackageImpl(); | ||
87 | |||
88 | isInited = true; | ||
89 | |||
90 | // Create package meta-data objects | ||
91 | theLinkedListPackage.createPackageContents(); | ||
92 | |||
93 | // Initialize created meta-data | ||
94 | theLinkedListPackage.initializePackageContents(); | ||
95 | |||
96 | // Mark meta-data to indicate it can't be changed | ||
97 | theLinkedListPackage.freeze(); | ||
98 | |||
99 | // Update the registry and return the package | ||
100 | EPackage.Registry.INSTANCE.put(LinkedListPackage.eNS_URI, theLinkedListPackage); | ||
101 | return theLinkedListPackage; | ||
102 | } | ||
103 | |||
104 | /** | ||
105 | * <!-- begin-user-doc --> | ||
106 | * <!-- end-user-doc --> | ||
107 | * @generated | ||
108 | */ | ||
109 | public EClass getList() { | ||
110 | return listEClass; | ||
111 | } | ||
112 | |||
113 | /** | ||
114 | * <!-- begin-user-doc --> | ||
115 | * <!-- end-user-doc --> | ||
116 | * @generated | ||
117 | */ | ||
118 | public EReference getList_First() { | ||
119 | return (EReference)listEClass.getEStructuralFeatures().get(0); | ||
120 | } | ||
121 | |||
122 | /** | ||
123 | * <!-- begin-user-doc --> | ||
124 | * <!-- end-user-doc --> | ||
125 | * @generated | ||
126 | */ | ||
127 | public EClass getElement() { | ||
128 | return elementEClass; | ||
129 | } | ||
130 | |||
131 | /** | ||
132 | * <!-- begin-user-doc --> | ||
133 | * <!-- end-user-doc --> | ||
134 | * @generated | ||
135 | */ | ||
136 | public EReference getElement_Value() { | ||
137 | return (EReference)elementEClass.getEStructuralFeatures().get(0); | ||
138 | } | ||
139 | |||
140 | /** | ||
141 | * <!-- begin-user-doc --> | ||
142 | * <!-- end-user-doc --> | ||
143 | * @generated | ||
144 | */ | ||
145 | public EReference getElement_Next() { | ||
146 | return (EReference)elementEClass.getEStructuralFeatures().get(1); | ||
147 | } | ||
148 | |||
149 | /** | ||
150 | * <!-- begin-user-doc --> | ||
151 | * <!-- end-user-doc --> | ||
152 | * @generated | ||
153 | */ | ||
154 | public EClass getObject() { | ||
155 | return objectEClass; | ||
156 | } | ||
157 | |||
158 | /** | ||
159 | * <!-- begin-user-doc --> | ||
160 | * <!-- end-user-doc --> | ||
161 | * @generated | ||
162 | */ | ||
163 | public LinkedListFactory getLinkedListFactory() { | ||
164 | return (LinkedListFactory)getEFactoryInstance(); | ||
165 | } | ||
166 | |||
167 | /** | ||
168 | * <!-- begin-user-doc --> | ||
169 | * <!-- end-user-doc --> | ||
170 | * @generated | ||
171 | */ | ||
172 | private boolean isCreated = false; | ||
173 | |||
174 | /** | ||
175 | * Creates the meta-model objects for the package. This method is | ||
176 | * guarded to have no affect on any invocation but its first. | ||
177 | * <!-- begin-user-doc --> | ||
178 | * <!-- end-user-doc --> | ||
179 | * @generated | ||
180 | */ | ||
181 | public void createPackageContents() { | ||
182 | if (isCreated) return; | ||
183 | isCreated = true; | ||
184 | |||
185 | // Create classes and their features | ||
186 | listEClass = createEClass(LIST); | ||
187 | createEReference(listEClass, LIST__FIRST); | ||
188 | |||
189 | elementEClass = createEClass(ELEMENT); | ||
190 | createEReference(elementEClass, ELEMENT__VALUE); | ||
191 | createEReference(elementEClass, ELEMENT__NEXT); | ||
192 | |||
193 | objectEClass = createEClass(OBJECT); | ||
194 | } | ||
195 | |||
196 | /** | ||
197 | * <!-- begin-user-doc --> | ||
198 | * <!-- end-user-doc --> | ||
199 | * @generated | ||
200 | */ | ||
201 | private boolean isInitialized = false; | ||
202 | |||
203 | /** | ||
204 | * Complete the initialization of the package and its meta-model. This | ||
205 | * method is guarded to have no affect on any invocation but its first. | ||
206 | * <!-- begin-user-doc --> | ||
207 | * <!-- end-user-doc --> | ||
208 | * @generated | ||
209 | */ | ||
210 | public void initializePackageContents() { | ||
211 | if (isInitialized) return; | ||
212 | isInitialized = true; | ||
213 | |||
214 | // Initialize package | ||
215 | setName(eNAME); | ||
216 | setNsPrefix(eNS_PREFIX); | ||
217 | setNsURI(eNS_URI); | ||
218 | |||
219 | // Create type parameters | ||
220 | |||
221 | // Set bounds for type parameters | ||
222 | |||
223 | // Add supertypes to classes | ||
224 | |||
225 | // Initialize classes, features, and operations; add parameters | ||
226 | initEClass(listEClass, List.class, "List", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); | ||
227 | initEReference(getList_First(), this.getElement(), null, "first", null, 0, 1, List.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
228 | |||
229 | initEClass(elementEClass, Element.class, "Element", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); | ||
230 | initEReference(getElement_Value(), this.getObject(), null, "value", null, 1, 1, Element.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
231 | initEReference(getElement_Next(), this.getElement(), null, "next", null, 0, 1, Element.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
232 | |||
233 | initEClass(objectEClass, linkedList.Object.class, "Object", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); | ||
234 | |||
235 | // Create resource | ||
236 | createResource(eNS_URI); | ||
237 | } | ||
238 | |||
239 | } //LinkedListPackageImpl | ||
diff --git a/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/linkedList/impl/ListImpl.java b/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/linkedList/impl/ListImpl.java new file mode 100644 index 00000000..30d006cd --- /dev/null +++ b/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/linkedList/impl/ListImpl.java | |||
@@ -0,0 +1,176 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package linkedList.impl; | ||
4 | |||
5 | import linkedList.Element; | ||
6 | import linkedList.LinkedListPackage; | ||
7 | import linkedList.List; | ||
8 | |||
9 | import org.eclipse.emf.common.notify.Notification; | ||
10 | import org.eclipse.emf.common.notify.NotificationChain; | ||
11 | import org.eclipse.emf.ecore.EClass; | ||
12 | import org.eclipse.emf.ecore.InternalEObject; | ||
13 | |||
14 | import org.eclipse.emf.ecore.impl.ENotificationImpl; | ||
15 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; | ||
16 | |||
17 | /** | ||
18 | * <!-- begin-user-doc --> | ||
19 | * An implementation of the model object '<em><b>List</b></em>'. | ||
20 | * <!-- end-user-doc --> | ||
21 | * <p> | ||
22 | * The following features are implemented: | ||
23 | * </p> | ||
24 | * <ul> | ||
25 | * <li>{@link linkedList.impl.ListImpl#getFirst <em>First</em>}</li> | ||
26 | * </ul> | ||
27 | * | ||
28 | * @generated | ||
29 | */ | ||
30 | public class ListImpl extends MinimalEObjectImpl.Container implements List { | ||
31 | /** | ||
32 | * The cached value of the '{@link #getFirst() <em>First</em>}' containment reference. | ||
33 | * <!-- begin-user-doc --> | ||
34 | * <!-- end-user-doc --> | ||
35 | * @see #getFirst() | ||
36 | * @generated | ||
37 | * @ordered | ||
38 | */ | ||
39 | protected Element first; | ||
40 | |||
41 | /** | ||
42 | * <!-- begin-user-doc --> | ||
43 | * <!-- end-user-doc --> | ||
44 | * @generated | ||
45 | */ | ||
46 | protected ListImpl() { | ||
47 | super(); | ||
48 | } | ||
49 | |||
50 | /** | ||
51 | * <!-- begin-user-doc --> | ||
52 | * <!-- end-user-doc --> | ||
53 | * @generated | ||
54 | */ | ||
55 | @Override | ||
56 | protected EClass eStaticClass() { | ||
57 | return LinkedListPackage.Literals.LIST; | ||
58 | } | ||
59 | |||
60 | /** | ||
61 | * <!-- begin-user-doc --> | ||
62 | * <!-- end-user-doc --> | ||
63 | * @generated | ||
64 | */ | ||
65 | public Element getFirst() { | ||
66 | return first; | ||
67 | } | ||
68 | |||
69 | /** | ||
70 | * <!-- begin-user-doc --> | ||
71 | * <!-- end-user-doc --> | ||
72 | * @generated | ||
73 | */ | ||
74 | public NotificationChain basicSetFirst(Element newFirst, NotificationChain msgs) { | ||
75 | Element oldFirst = first; | ||
76 | first = newFirst; | ||
77 | if (eNotificationRequired()) { | ||
78 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, LinkedListPackage.LIST__FIRST, oldFirst, newFirst); | ||
79 | if (msgs == null) msgs = notification; else msgs.add(notification); | ||
80 | } | ||
81 | return msgs; | ||
82 | } | ||
83 | |||
84 | /** | ||
85 | * <!-- begin-user-doc --> | ||
86 | * <!-- end-user-doc --> | ||
87 | * @generated | ||
88 | */ | ||
89 | public void setFirst(Element newFirst) { | ||
90 | if (newFirst != first) { | ||
91 | NotificationChain msgs = null; | ||
92 | if (first != null) | ||
93 | msgs = ((InternalEObject)first).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - LinkedListPackage.LIST__FIRST, null, msgs); | ||
94 | if (newFirst != null) | ||
95 | msgs = ((InternalEObject)newFirst).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - LinkedListPackage.LIST__FIRST, null, msgs); | ||
96 | msgs = basicSetFirst(newFirst, msgs); | ||
97 | if (msgs != null) msgs.dispatch(); | ||
98 | } | ||
99 | else if (eNotificationRequired()) | ||
100 | eNotify(new ENotificationImpl(this, Notification.SET, LinkedListPackage.LIST__FIRST, newFirst, newFirst)); | ||
101 | } | ||
102 | |||
103 | /** | ||
104 | * <!-- begin-user-doc --> | ||
105 | * <!-- end-user-doc --> | ||
106 | * @generated | ||
107 | */ | ||
108 | @Override | ||
109 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
110 | switch (featureID) { | ||
111 | case LinkedListPackage.LIST__FIRST: | ||
112 | return basicSetFirst(null, msgs); | ||
113 | } | ||
114 | return super.eInverseRemove(otherEnd, featureID, msgs); | ||
115 | } | ||
116 | |||
117 | /** | ||
118 | * <!-- begin-user-doc --> | ||
119 | * <!-- end-user-doc --> | ||
120 | * @generated | ||
121 | */ | ||
122 | @Override | ||
123 | public Object eGet(int featureID, boolean resolve, boolean coreType) { | ||
124 | switch (featureID) { | ||
125 | case LinkedListPackage.LIST__FIRST: | ||
126 | return getFirst(); | ||
127 | } | ||
128 | return super.eGet(featureID, resolve, coreType); | ||
129 | } | ||
130 | |||
131 | /** | ||
132 | * <!-- begin-user-doc --> | ||
133 | * <!-- end-user-doc --> | ||
134 | * @generated | ||
135 | */ | ||
136 | @SuppressWarnings("unchecked") | ||
137 | @Override | ||
138 | public void eSet(int featureID, Object newValue) { | ||
139 | switch (featureID) { | ||
140 | case LinkedListPackage.LIST__FIRST: | ||
141 | setFirst((Element)newValue); | ||
142 | return; | ||
143 | } | ||
144 | super.eSet(featureID, newValue); | ||
145 | } | ||
146 | |||
147 | /** | ||
148 | * <!-- begin-user-doc --> | ||
149 | * <!-- end-user-doc --> | ||
150 | * @generated | ||
151 | */ | ||
152 | @Override | ||
153 | public void eUnset(int featureID) { | ||
154 | switch (featureID) { | ||
155 | case LinkedListPackage.LIST__FIRST: | ||
156 | setFirst((Element)null); | ||
157 | return; | ||
158 | } | ||
159 | super.eUnset(featureID); | ||
160 | } | ||
161 | |||
162 | /** | ||
163 | * <!-- begin-user-doc --> | ||
164 | * <!-- end-user-doc --> | ||
165 | * @generated | ||
166 | */ | ||
167 | @Override | ||
168 | public boolean eIsSet(int featureID) { | ||
169 | switch (featureID) { | ||
170 | case LinkedListPackage.LIST__FIRST: | ||
171 | return first != null; | ||
172 | } | ||
173 | return super.eIsSet(featureID); | ||
174 | } | ||
175 | |||
176 | } //ListImpl | ||
diff --git a/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/linkedList/impl/ObjectImpl.java b/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/linkedList/impl/ObjectImpl.java new file mode 100644 index 00000000..c9b55c8d --- /dev/null +++ b/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/linkedList/impl/ObjectImpl.java | |||
@@ -0,0 +1,36 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package linkedList.impl; | ||
4 | |||
5 | import linkedList.LinkedListPackage; | ||
6 | import org.eclipse.emf.ecore.EClass; | ||
7 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; | ||
8 | |||
9 | /** | ||
10 | * <!-- begin-user-doc --> | ||
11 | * An implementation of the model object '<em><b>Object</b></em>'. | ||
12 | * <!-- end-user-doc --> | ||
13 | * | ||
14 | * @generated | ||
15 | */ | ||
16 | public class ObjectImpl extends MinimalEObjectImpl.Container implements linkedList.Object { | ||
17 | /** | ||
18 | * <!-- begin-user-doc --> | ||
19 | * <!-- end-user-doc --> | ||
20 | * @generated | ||
21 | */ | ||
22 | protected ObjectImpl() { | ||
23 | super(); | ||
24 | } | ||
25 | |||
26 | /** | ||
27 | * <!-- begin-user-doc --> | ||
28 | * <!-- end-user-doc --> | ||
29 | * @generated | ||
30 | */ | ||
31 | @Override | ||
32 | protected EClass eStaticClass() { | ||
33 | return LinkedListPackage.Literals.OBJECT; | ||
34 | } | ||
35 | |||
36 | } //ObjectImpl | ||