]> gitweb.fperrin.net Git - GpsPrune.git/blobdiff - tim/prune/function/sew/CandidateSorter.java
Moved source into separate src directory due to popular request
[GpsPrune.git] / tim / prune / function / sew / CandidateSorter.java
diff --git a/tim/prune/function/sew/CandidateSorter.java b/tim/prune/function/sew/CandidateSorter.java
deleted file mode 100644 (file)
index 6736f32..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-package tim.prune.function.sew;
-
-import java.util.Comparator;
-
-/**
- * Class to sort the candidates for segment splitting
- */
-public class CandidateSorter implements Comparator<SplitPoint>
-{
-       /**
-        * Sort the objects by distance (greatest first)
-        */
-       public int compare(SplitPoint inFirst, SplitPoint inSecond)
-       {
-               if (inFirst == null)  return 1;
-               if (inSecond == null) return -1;
-               // First, sort by distance
-               final double dist1 = inFirst.getDistanceToPrevPoint();
-               final double dist2 = inSecond.getDistanceToPrevPoint();
-               if (dist1 > dist2) {
-                       return -1;
-               }
-               if (dist1 < dist2) {
-                       return 1;
-               }
-               // If the distances are identical, then just sort by point index
-               return inFirst.getPointIndex() - inSecond.getPointIndex();
-       }
-}