Package org.openstreetmap.josm.data.osm
Class PrimitiveComparator
- java.lang.Object
-
- org.openstreetmap.josm.data.osm.PrimitiveComparator
-
public final class PrimitiveComparator extends java.lang.Object
Comparators for comparingIPrimitive
.- Since:
- 13803
-
-
Constructor Summary
Constructors Modifier Constructor Description private
PrimitiveComparator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Comparator<IPrimitive>
comparingNames()
Returns a comparator comparing primitives by their name usingDefaultNameFormatter
.static java.util.Comparator<IPrimitive>
comparingUniqueId()
Returns a comparator comparing primitives by their unique id.(package private) static <T extends IPrimitive>
java.util.Comparator<T>doComparingNames()
(package private) static <T extends IPrimitive>
java.util.Comparator<T>doComparingUniqueId()
(package private) static <T extends IPrimitive>
java.util.Comparator<T>doOrderingNodesWaysRelations()
(package private) static <T extends IPrimitive>
java.util.Comparator<T>doOrderingRelationsWaysNodes()
(package private) static <T extends IPrimitive>
java.util.Comparator<T>doOrderingWaysRelationsNodes()
private static <T,R>
java.util.function.Function<T,R>memoize(java.util.function.Function<T,R> base)
static java.util.Comparator<IPrimitive>
orderingNodesWaysRelations()
Returns a comparator ordering the primitives by type in the order NODE, WAY, RELATIONstatic java.util.Comparator<IPrimitive>
orderingRelationsWaysNodes()
Returns a comparator ordering the primitives by type in the order RELATION, WAY, NODEstatic java.util.Comparator<IPrimitive>
orderingWaysRelationsNodes()
Returns a comparator ordering the primitives by type in the order WAY, RELATION, NODE
-
-
-
Constructor Detail
-
PrimitiveComparator
private PrimitiveComparator()
-
-
Method Detail
-
comparingNames
public static java.util.Comparator<IPrimitive> comparingNames()
Returns a comparator comparing primitives by their name usingDefaultNameFormatter
. Formatted names are cached.- Returns:
- a comparator comparing primitives by their name using
DefaultNameFormatter
-
doComparingNames
static <T extends IPrimitive> java.util.Comparator<T> doComparingNames()
-
comparingUniqueId
public static java.util.Comparator<IPrimitive> comparingUniqueId()
Returns a comparator comparing primitives by their unique id.- Returns:
- a comparator comparing primitives by their unique id.
-
doComparingUniqueId
static <T extends IPrimitive> java.util.Comparator<T> doComparingUniqueId()
-
orderingNodesWaysRelations
public static java.util.Comparator<IPrimitive> orderingNodesWaysRelations()
Returns a comparator ordering the primitives by type in the order NODE, WAY, RELATION- Returns:
- a comparator ordering the primitives by type in the order NODE, WAY, RELATION
-
doOrderingNodesWaysRelations
static <T extends IPrimitive> java.util.Comparator<T> doOrderingNodesWaysRelations()
-
orderingWaysRelationsNodes
public static java.util.Comparator<IPrimitive> orderingWaysRelationsNodes()
Returns a comparator ordering the primitives by type in the order WAY, RELATION, NODE- Returns:
- a comparator ordering the primitives by type in the order WAY, RELATION, NODE
-
doOrderingWaysRelationsNodes
static <T extends IPrimitive> java.util.Comparator<T> doOrderingWaysRelationsNodes()
-
orderingRelationsWaysNodes
public static java.util.Comparator<IPrimitive> orderingRelationsWaysNodes()
Returns a comparator ordering the primitives by type in the order RELATION, WAY, NODE- Returns:
- a comparator ordering the primitives by type in the order RELATION, WAY, NODE
-
doOrderingRelationsWaysNodes
static <T extends IPrimitive> java.util.Comparator<T> doOrderingRelationsWaysNodes()
-
memoize
private static <T,R> java.util.function.Function<T,R> memoize(java.util.function.Function<T,R> base)
-
-