Package qupath.lib.objects
Class DefaultPathObjectComparator
java.lang.Object
qupath.lib.objects.DefaultPathObjectComparator
- All Implemented Interfaces:
Comparator<PathObject>
Default comparator to enable objects to be sorted in a more predictable manner.
The aim is to help sorted lists to keep non-detection objects near the top,
and thereafter to sort by classification and ROI location (y coordinate first, then x) according to
the DefaultROIComparator
.
Note: The precise comparison is undefined and subject to change/optimization. This is intended for more reproducible behavior while QuPath is running, but it not guaranteed to apply the same comparison across software versions.
- Author:
- Pete Bankhead
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
compare
(PathObject o1, PathObject o2) static Comparator
<PathObject> Get shared comparator instance to sort PathObjects repeatably.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
DefaultPathObjectComparator
public DefaultPathObjectComparator()
-
-
Method Details
-
compare
- Specified by:
compare
in interfaceComparator<PathObject>
-
getInstance
Get shared comparator instance to sort PathObjects repeatably.- Returns:
-