Преглед изворни кода

basic mapping operator now internally sorts descending

jascha Bohne пре 7 година
родитељ
комит
555bbf2d76

+ 4 - 3
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/metrics/BasicMappingOperator.java

@@ -81,16 +81,17 @@ public class BasicMappingOperator implements ScopvizGraphOperator {
 		@Override
 		public int compare(Node o1, Node o2) {
 			Main m = Main.getInstance();
-
+			
+			// the cmparator uses a reverse ordering so that the resulting list is sorted descending
 			// this does: process-need(o1) - process-need(o2)
 			Double result = m.convertAttributeTypes(o1.getAttribute("process-need"), new Double(0))
 					- m.convertAttributeTypes(o2.getAttribute("process-need"), new Double(0));
 			if (result == 0.0) {
 				return 0;
 			} else if (result < 0.0) {
-				return -1;
-			} else {
 				return 1;
+			} else {
+				return -1;
 			}
 		}
 	};