diff options
Diffstat (limited to 'Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/io/GraphReader.xtend')
-rw-r--r-- | Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/io/GraphReader.xtend | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/io/GraphReader.xtend b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/io/GraphReader.xtend index 491501b0..858113e9 100644 --- a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/io/GraphReader.xtend +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/io/GraphReader.xtend | |||
@@ -20,6 +20,8 @@ import org.eclipse.emf.ecore.resource.Resource | |||
20 | import org.eclipse.emf.ecore.resource.ResourceSet | 20 | import org.eclipse.emf.ecore.resource.ResourceSet |
21 | import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl | 21 | import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl |
22 | import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl | 22 | import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl |
23 | import org.eclipse.emf.ecore.EGenericType | ||
24 | import org.eclipse.emf.ecore.EStructuralFeature | ||
23 | 25 | ||
24 | class GraphReader{ | 26 | class GraphReader{ |
25 | val ResourceSet resSet = new ResourceSetImpl(); | 27 | val ResourceSet resSet = new ResourceSetImpl(); |
@@ -53,9 +55,11 @@ class GraphReader{ | |||
53 | metrics.add(new TypedOutDegree()); | 55 | metrics.add(new TypedOutDegree()); |
54 | metrics.add(new NodeTypeMetric()); | 56 | metrics.add(new NodeTypeMetric()); |
55 | metrics.add(new EdgeTypeMetric()); | 57 | metrics.add(new EdgeTypeMetric()); |
56 | 58 | var count = 1 | |
57 | //check all files in the directory with suffix | 59 | //check all files in the directory with suffix |
58 | for(String name : dir.list.filter[it| it.endsWith(suffix)]){ | 60 | for(String name : dir.list.filter[it| it.endsWith(suffix)]){ |
61 | println(name) | ||
62 | println(count) | ||
59 | val file = new File(name); | 63 | val file = new File(name); |
60 | val roots = readModel(EObject, path, file.name); | 64 | val roots = readModel(EObject, path, file.name); |
61 | //add a list of metrics | 65 | //add a list of metrics |
@@ -63,7 +67,8 @@ class GraphReader{ | |||
63 | for(root : roots){ | 67 | for(root : roots){ |
64 | g.init(root, metrics, name.replaceFirst(suffix, ""), referenceTypes); | 68 | g.init(root, metrics, name.replaceFirst(suffix, ""), referenceTypes); |
65 | } | 69 | } |
66 | 70 | ||
71 | count ++; | ||
67 | graphs.add(g); | 72 | graphs.add(g); |
68 | } | 73 | } |
69 | 74 | ||