Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortarendt2013-09-24 06:49:43 -0400
committertarendt2013-09-24 06:49:43 -0400
commit01b08b15d468878abb612e56403d30a8c640cfdf (patch)
treeb4c1eafba14988d32ffdcd5191a2325450268651
parent10ea05d95d35e4f292754eed0048d7d878dd5439 (diff)
downloadorg.eclipse.emf.refactor.metrics-01b08b15d468878abb612e56403d30a8c640cfdf.tar.gz
org.eclipse.emf.refactor.metrics-01b08b15d468878abb612e56403d30a8c640cfdf.tar.xz
org.eclipse.emf.refactor.metrics-01b08b15d468878abb612e56403d30a8c640cfdf.zip
sorting (metrics and smells) added
-rw-r--r--org.eclipse.emf.refactor.metrics/bin/org/eclipse/emf/refactor/metrics/core/Metric.classbin2228 -> 2699 bytes
-rw-r--r--org.eclipse.emf.refactor.metrics/bin/org/eclipse/emf/refactor/metrics/core/MetricLoader.classbin2931 -> 3005 bytes
-rw-r--r--org.eclipse.emf.refactor.metrics/src/org/eclipse/emf/refactor/metrics/core/Metric.java14
-rw-r--r--org.eclipse.emf.refactor.metrics/src/org/eclipse/emf/refactor/metrics/core/MetricLoader.java1
4 files changed, 14 insertions, 1 deletions
diff --git a/org.eclipse.emf.refactor.metrics/bin/org/eclipse/emf/refactor/metrics/core/Metric.class b/org.eclipse.emf.refactor.metrics/bin/org/eclipse/emf/refactor/metrics/core/Metric.class
index 0bea310..00194d6 100644
--- a/org.eclipse.emf.refactor.metrics/bin/org/eclipse/emf/refactor/metrics/core/Metric.class
+++ b/org.eclipse.emf.refactor.metrics/bin/org/eclipse/emf/refactor/metrics/core/Metric.class
Binary files differ
diff --git a/org.eclipse.emf.refactor.metrics/bin/org/eclipse/emf/refactor/metrics/core/MetricLoader.class b/org.eclipse.emf.refactor.metrics/bin/org/eclipse/emf/refactor/metrics/core/MetricLoader.class
index 9b6983a..5d05f77 100644
--- a/org.eclipse.emf.refactor.metrics/bin/org/eclipse/emf/refactor/metrics/core/MetricLoader.class
+++ b/org.eclipse.emf.refactor.metrics/bin/org/eclipse/emf/refactor/metrics/core/MetricLoader.class
Binary files differ
diff --git a/org.eclipse.emf.refactor.metrics/src/org/eclipse/emf/refactor/metrics/core/Metric.java b/org.eclipse.emf.refactor.metrics/src/org/eclipse/emf/refactor/metrics/core/Metric.java
index ad57734..a91cac2 100644
--- a/org.eclipse.emf.refactor.metrics/src/org/eclipse/emf/refactor/metrics/core/Metric.java
+++ b/org.eclipse.emf.refactor.metrics/src/org/eclipse/emf/refactor/metrics/core/Metric.java
@@ -10,7 +10,7 @@ import org.eclipse.emf.refactor.metrics.managers.MetricManager;
*
* @author Pawel Stepien
*/
-public class Metric {
+public class Metric implements Comparable<Metric> {
private String id;
private String name;
@@ -105,4 +105,16 @@ public class Metric {
}
return null;
}
+
+ @Override
+ public int compareTo(Metric metric) {
+ if(this.equals(metric)) {
+ return 0;
+ }
+ if(this.getName().equals(metric.getName())) {
+ return 0;
+ } else {
+ return this.getName().compareTo(metric.getName());
+ }
+ }
}
diff --git a/org.eclipse.emf.refactor.metrics/src/org/eclipse/emf/refactor/metrics/core/MetricLoader.java b/org.eclipse.emf.refactor.metrics/src/org/eclipse/emf/refactor/metrics/core/MetricLoader.java
index bb89b98..70e6c81 100644
--- a/org.eclipse.emf.refactor.metrics/src/org/eclipse/emf/refactor/metrics/core/MetricLoader.java
+++ b/org.eclipse.emf.refactor.metrics/src/org/eclipse/emf/refactor/metrics/core/MetricLoader.java
@@ -24,6 +24,7 @@ public class MetricLoader {
e.printStackTrace();
}
}
+ java.util.Collections.sort(metrics);
return metrics;
}

Back to the top